The 1917 Bolsheviks led a working class revolution which established, for the first time in history, a workers’ state. However before describing the normative workers’ state, we must explain what a state is.
“The state is, therefore, by no means a power forced on society from without; just as little is it 'the reality of the ethical idea', 'the image and reality of reason', as Hegel maintains. Rather, it is a product of society at a certain stage of development; it is the admission that this society has become entangled in an insoluble contradiction with itself, that it has split into irreconcilable antagonisms which it is powerless to dispel. But in order that these antagonisms, these classes with conflicting economic interests, might not consume themselves and society in fruitless struggle, it became necessary to have a power, seemingly standing above society, that would alleviate the conflict and keep it within the bounds of 'order'; and this power, arisen out of society but placing itself above it, and alienating itself more and more from it, is the state.” 
Lenin in State and Revolution wrote:
“… the “Kautskyite” distortion of Marxism is far more subtle. “Theoretically”, it is not denied that the state is an organ of class rule, or that class antagonisms are irreconcilable. But what is overlooked or glossed over is this: if the state is the product of the irreconcilability of class antagonisms, if it is a power standing above society and “alienating itself more and more from it", it is clear that the liberation of the oppressed class is impossible not only without a violent revolution, but also without the destruction of the apparatus of state power which was created by the ruling class and which is the embodiment of this “alienation”. As we shall see later, Marx very explicitly drew this theoretically self-evident conclusion on the strength of a concrete historical analysis of the tasks of the revolution. And — as we shall show in detail further on — it is this conclusion which Kautsky has “forgotten” and “distorted””.
Relying on Engels, Lenin further wrote:
“”Because the state arose from the need to hold class antagonisms in check, but because it arose, at the same time, in the midst of the conflict of these classes, it is, as a rule, the state of the most powerful, economically dominant class, which, through the medium of the state, becomes also the politically dominant class, and thus acquires new means of holding down and exploiting the oppressed class. ... The ancient and feudal states were organs for the exploitation of the slaves and serfs; likewise, “the modern representative state is an instrument of exploitation of wage-labor by capital. By way of exception, however, periods occur in which the warring classes balance each other so nearly that the state power as ostensible mediator acquires, for the moment, a certain degree of independence of both....” Such were the absolute monarchies of the 17th and 18th centuries, the Bonapartism of the First and Second Empires in France, and the Bismarck regime in Germany.” 
Thus the state is not a neutral body holding power; rather it is the instrument of the ruling class and in capitalism the ruling class is the capitalist class. The state apparatus (the army, police, courts, jails, public administration, etc.) defend the ruling class’s mode of production. For the workers and the poor peasants to liberate themselves it is necessary to smash this instrument and replace it with a workers’ state apparatus and expropriate the big capitalists under workers control in the economy and in the state apparatus.
In October 1917, the old Czarist state apparatus was smashed and a new revolutionary state apparatus replaced it. At the same time Lenin wrote:
“The proletariat needs the state—this is repeated by all the opportunists, social-chauvinists and Kautskyites, who assure us that this is what Marx taught. But they “forget” to add that, in the first place, according to Marx, the proletariat needs only a state which is withering away, i.e., a state so constituted that it begins to wither away immediately, and cannot but wither away.” 
Lenin was very concerned with the danger of the growing power of the bureaucracy and he wrote:
“The workers, after winning political power, will smash the old bureaucratic apparatus, shatter it to its very foundations, and raze it to the ground; they will replace it by a new one, consisting of the very same workers and other employees, against whose transformation into bureaucrats the measures will at once be taken which were specified in detail by Marx and Engels: (1) not only election, but also recall at any time; (2) pay not to exceed that of a workman; (3) immediate introduction of control and supervision by all, so that all may become “bureaucrats” for a time and that, therefore, nobody may be able to become a “bureaucrat”.” 
The Soviets became state organs and the executive committee of the Supreme Soviet became the government. As Lenin wrote:
“In this country, in Russia, for the first time in the world history, the government of the country is so organised that only the workers and the working peasants, to the exclusion of the exploiters; constitute those mass organisations known as Soviets, and these Soviets wield all state power.” 
The Bolsheviks eliminated the old ruling classes as classes by expropriation of the banks, big industry, and the large estates. They nationalized industry and the banking system and distributed lands to the peasants. The nationalized economy was under workers control.
The program of the Communist Party of Russia declared:
“The organisational apparatus of socialised industry must in the first place rely on the trade unions. The latter must to an increasing degree free themselves from the narrow craft spirit and become big industrial associations embracing the majority and gradually all the workers in the given branch of production. Since, according to the laws of the Soviet Republic and by established practice, the trade unions already participate in all the local and central organs of management of industry, they must eventually concentrate in their hands the entire management of the whole of national economy as a single economic unit. Establishing in this way indissoluble ties between the central state administration, national economy and the broad masses of the workers, the trade unions must draw the latter as much as possible into the immediate work of business management. The participation of the trade unions in business management, and their drawing the broad masses into this work, represent at the same time the principal means of struggle against the bureaucratisation of the economic apparatus of the Soviet government and render possible the establishment of genuine popular control over the results of production..” 
Tony Cliff, in his weak analysis of the former Soviet Union as a form of state capitalism as early as 1928, with the introduction of the first Five Year Program, nevertheless correctly pointed out in his book State Capitalism in Russia that:
“… the Party cells participated in the running of industry together with the workers’ plant committees. Together with these, and under their control, worked the technical manager: the combination of these three formed the Troika.” 
This structure of workers power in the factories was demolished by Stalin’s political counterrevolution. In 1936 Trotsky wrote:
“The present Soviet Union does not stand above the world level of economy, but is only trying to catch up to the capitalist countries. If Marx called that society which was to be formed upon the basis of a socialization of the productive forces of the most advanced capitalism of its epoch, the lowest stage of communism, then this designation obviously does not apply to the Soviet Union, which is still today considerably poorer in technique, culture and the good things of life than the capitalist countries. It would be truer, therefore, to name the present Soviet regime in all its contradictoriness, not a socialist regime, but a preparatory regime transitional from capitalism to socialism.” 
In 1938, Trotsky explained that the rule of the bureaucracy in the economy stands in contradiction to the needs of the revolutionary form of the expropriated properties:
“The incumbent ruling clique has replaced Soviet, party, trade-union and cooperative democracy by the domineering of functionaries. But a bureaucracy, even one composed entirely of geniuses, could not assure from its bureaus the necessary proportions between all branches of economy, that is, the necessary correspondence between production and consumption. What the lexicon of Stalin’s justice designates as “sabotage,” is in reality one of the evil consequences of bureaucratic methods of domineering.” 
For Trotsky it was clear that the only way to defend the Soviet State and open the road to socialism was the removal of the Stalinist bureaucracy by a political revolution, as capitalist restoration was then a danger but still not a reality.
“… The chief political task in the USSR still remains the overthrow of this same Thermidorian bureaucracy. (…) It is necessary to return to the soviets not only their free democratic form but also their class content. As once the bourgeoisie and kulaks were not permitted to enter the soviets, so now it is necessary to drive the bureaucracy and the new aristocracy out of the soviets. In the soviets there is room only for representatives of the workers, rank-and-file collective farmers, peasants and Red Army men.” 
Trotsky also called for the return of workers control of the economy:
“A revision of planned economy from top to bottom in the interests of producers and consumers! Factory committees should be returned the right to control production. A democratically organized consumers’ cooperative should control the quality and price of products.” 
As long as capitalism was not restored in the USSR it was necessary to defend the Soviet state against imperialism. When Stalin and Hitler signed the non-aggression treaty in August 1939 and the Soviet Union invaded Finland, a tendency around Max Shachtman was formed in the SWP, the US section of the Fourth International as the Trotskyist International was called after its foundation in 1938. This tendency denied that the Soviet Union was still a degenerated workers state. In this debate Trotsky wrote:
“The overthrow of the bureaucracy therefore presupposes the preservation of state property and of planned economy. Herein is the nub of the whole problem. Needless to say, the distribution of productive forces among the various branches of economy and generally the entire content of the plan will be drastically changed when this plan is determined by the interests not of the bureaucracy but of the producers themselves. But inasmuch as the question of overthrowing the parasitic oligarchy still remains linked with that of preserving the nationalized (state) property, we called the future revolution political.” 
Trotsky emphasized that the gains of the Soviet Union were result of:
“…the nationalization of the means of production and the planned beginnings, and by no means the fact that the bureaucracy usurped command over the economy. On the contrary, bureaucratism as a system became the worst brake on the technical and cultural development of the country.” 
Trotsky elaborated on how to defend the Soviet Union against the Nazis:
“We do not entrust the Kremlin with any historic mission. We were and remain against seizures of new territories by the Kremlin. We are for the independence of Soviet Ukraine, and if the Byelo-Russians themselves wish – of Soviet Byelo-Russia. At the same time in the sections of Poland occupied by the Red Army, partisans of the Fourth International must play the most decisive part in expropriating the landlords and capitalists, in dividing the land among the peasants, in creating Soviets and Workers’ Committees, etc. While so doing, they must preserve their political independence, they must fight during elections the Soviets and factory committees for the complete independence of the latter from the bureaucracy, and they must conduct revolutionary propaganda in the spirit of distrust towards the Kremlin and its local agencies.
But let us suppose that Hitler turns his weapons against the East and invades territories occupied by the Red Army. Under these conditions, partisans of the Fourth International, without changing in any way their attitude toward the Kremlin oligarchy, will advance to the forefront as the most urgent task of the hour, the military resistance against Hitler. The workers will say, “We cannot cede to Hitler the overthrowing of Stalin; that is our own task”. During the military struggle against Hitler, the revolutionary workers will strive to enter into the closest possible comradely relations with the rank and file fighters of the Red Army. While arms in hand they deal blows to Hitler, the Bolshevik-Leninists will at the same time conduct revolutionary propaganda against Stalin preparing his overthrow at the next and perhaps very near stage.
This kind of “defense of the USSR” will naturally differ, as heaven does from earth, from the official defense which is now being conducted under the slogan: “For the Fatherland! For Stalin!” Our defense of the USSR is carried on under the slogan: “For Socialism! For the world revolution! Against Stalin!” In order that these two varieties of “Defense of the USSR” do not become confused in the consciousness of the masses it is necessary to know clearly and precisely how to formulate slogans which correspond to the concrete situation. But above all it is necessary to establish clearly just what we are defending, just how we are defending it, against whom we are defending it. Our slogans will create confusion among the masses only if we ourselves do not have a clear conception of our tasks.” 
Trotsky believed that the USSR would not survive the war:
“Can we, however, expect that the Soviet Union will come out of the coming great war without defeat? To this frankly posed question we will answer as frankly; if the war should only remain a war, the defeat of the Soviet Union will be inevitable. In a technical, economic, and military sense, imperialism is incomparably more strong. If it is not paralyzed by revolution in the west; imperialism will sweep away the regime which issued from the October Revolution.” 
On this last point Trotsky was wrong as the Soviet Union not only survived but expanded first into Eastern Europe. To be sure, turning Eastern Europe into a bunch of deformed workers states was not the result of Stalin’s plans. Stalin wanted these states to remain capitalist states which at the same time function as buffer states. The needs of the nationalized economy that, at that time, was still expanding even under the Stalinist bureaucracy, the pressure of the working class and the threats of British and American imperialism pushed Stalin in the direction of transforming these states into types similar to the Soviet Union.
 Friedrich Engels: The Origin of the Family, Private Property and the State (1884), in: MECW 26, p. 269
 V. I. Lenin: The State and Revolution. The Marxist Teaching on the State and the Tasks of the Proletariat in the Revolution (1917), in: LCW Vol. 25, p. 393
 V. I. Lenin: The State and Revolution, p. 397
 V. I. Lenin: The State and Revolution, p. 407
 V. I. Lenin: The State and Revolution, p. 486
 V.I. Lenin, What Is Soviet Power? (1919), in: LCW Vol. 29, p. 248
 Program of the CPSU (Bolsheviks), adopted March 22, 1919 at the Eighth Congress of the Russian Communist Party, See http://www.marxists.org/history/ussr/government/1919/03/22.html or Robert McNeal (Editor): Resolutions and Decisions of the Communist Party of the Soviet Union, Toronto 1974, University of Toronto Press, p. 66
 Tony Cliff: Russia: A Marxist analysis, 1964, https://www.marxists.org/archive/cliff/works/1964/russia/ch01-s1.htm
 Leon Trotsky: The Revolution Betrayed (1936), Pathfinder Press, New York 1972, p. 47
 Leon Trotsky: Twenty Years of Stalinist Degeneration (1938), Fourth International [New York], Vol.6 No.3, March 1945, pp.87-89, https://www.marxists.org/archive/trotsky/1938/xx/stalinism.html
 Leon Trotsky: The Death Agony of Capitalism and the Tasks of the Fourth International. The Transitional Program (1938); in: Documents of the Fourth International, New York 1973, pp. 212-213
 Leon Trotsky: The USSR in War (1939), in: Leon Trotsky, In Defense of Marxism, Pathfinder Press, New York 1973, p. 4
 Leon Trotsky: The USSR in War, p. 6
 Leon Trotsky: The USSR in War, pp. 20-21
 Leon Trotsky: The Revolution Betrayed, p. 227.