Homework on EVM

2. What is the format of the instructions that the EVM can read?

hello sir, thats not the correct answer, could you please redesing your answer?

If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

1. What does the EVM do?

Hello sir, yes but could you please describe it a little bit in detail ?

If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

  • EVM runs on all the nodes in ethereum network, reads and executes smart contracts before giving instructions to CPU

  • Bytecode

  • EVM reads compiled Solidity into Bytecode before passing it on CPU

  • Bitcoin uses scrypt language which is not-Turing complete. It is also programmable but very primitive compared to Turing complete languages such as solidity.

  • It’s is a language that can program pretty much everything and solve complicated tasks.

1 Like

Homework on EVM:
1.The Etherium virtual machine is an application that reads instructions and instructs the CPU on how to execute.
2. EVM can read Bytecode.
3. Solitity is an Ethereum programming language compiler that translates instructions into Bytecode.
4. Bitcoin runs a program called Script that is only designed to process digital money and can only execute limited programming, it is not Turing complete.
5. Turing complete means you can program anything you want.

1 Like
  1. EVM = Etherum Virtual Machine, it is the environment where smart contracts are executed.

  2. Byte code

  3. Solidity is used by the programmer to define the smart contract, it is then compiled into Bytecode which the EVM can use to execute the contract.

  4. Because it’s programming language, Script, is not a Turing Complete language and therefore is too primitive to execute smart contracts. This is by design so the BItcoin network isn’t bogged down interpreting smart contracts. Whereas Ethereum uses Solidity which is a Turing Complete language which enables it to use looping and other necessary features of smart contracts.

  5. A Language that can solve any equation thrown at it, it may incorporate loops, goto and if statements.

1 Like
  1. The Ethereum Virtual Machine (EVM) reads and executes the smart contracts on a nodes computer.
  2. The smart contracts are written in the ‘Solidity’ language which is then compiled into byte code and executed by the EVM.
  3. Solidity is the programing language where as byte code is the machine executable instructions.
  4. The Bitcoin ‘script’ language is purposefully simple and does not allow functions such as loops. This was done to prevent spam from clogging up the network. Perhaps security is also increased as it is easier to build something simple without catastrophic faults.
  5. Turing complete means that the language is able to recognize or decide other data manipulation rule sets. A turning complete language can solve any algorithm you can logically express like: loops/if/then/goto/branches. Ethereum Solidity is Turing Complete, Bitcoin Script is not.
1 Like
  1. EVM translates the byte code version of instructions contained in a smart contract. It then will utilize the CPU of the host computer to carry out the instructions to return a ‘result’ to the blockchain, essentially executing the contract.

  2. EVM can read byte code.

  3. Solidity is the programming language used by Etherium to write smart contracts. Bytecode is the compiled language that is held in the blockchain to be interpreted by the EVM.

  4. Bitcoin can’t run the same complex programs because the size of smart contracts (or other complex program codes) will take up too much space in the block. Also, Bitcoin benefits from increased security by limiting it’s program ability so as to not get spammed by malicious code

  5. Turing Complete programming language is a fully functional programming language capable of creating programs of any type as required by the programmer.

1 Like
  1. What does the EVM do?

The EVM (Ethereum Virtual Machine) makes it possible to execute code on the computers that make up the Ethereum network such that a consensus can be achieved across it as to the result of any value transfer. It shields smart contracts (small programs pieces of code) from direct CPU interference from nodes on the network such that they must first interface with the EVM before the nodes/CPUs themselves (which each have a copy of the EVM on them), thus preventing individual network participants from executing smart contracts or instructions that do not serve all network participants, or are dishonest. It relays the instructions of any smart contract platform directly to the CPU nodes themselves, so that they each execute it by consensus, enabling transparency, trustlessness and immutability.

  1. What is the format of the instructions that the EVM can read?

The EVM can read transactions in a format referred to as Bytecode.

  1. What is the relationship between the programming language Solidity and Bytecode?

Solidity is the language that programs whatever the developer wishes to create (in the way of a smart contract program or function) and, by way of a Composer, this is translated to Bytecode. The EVM then reads the Bytecode and relays the instructions to CPU nodes on the network.

  1. Why can’t Bitcoin run the same type of complex programs like Ethereum can?

Bitcoin uses a very simple coding language called Script, which is very limited in terms of what instructions or functions it can impose and these relate only to transactions. (An example of a simple additional function to relaying transactions and storing them on the blockchain would be Multisig i.e. a function whereby you can program that more than one wallet owner must approve (or digitally sign) a transaction before it is sent). Script is not Turing complete as Bitcoin was only intended for transactions (i.e. digital money or “digital gold”) and when Vitalik presented his ideas for a fully programmable language overlaid on Bitcoin to the Bitcoin developer community, they had legitimate concerns that this (a) was unnecessary for the purposes of transactions, (b) would slow down the network by adding too much data to individual blocks and ( c) could cause some security issues e.g. the potential to program repetitive transfer of value.

  1. What is a Turing Complete programming language?

A Turing Complete language is one in which a developer can program anything they can conceive of (at least in theory) and this opens up the plethora of all possible and programmable applications, and the ability to program money and rules for the transfer of value that can be very diverse to reach specific outcomes and resolve different problems in various scenarios. (The reference to “in theory” above is that in practical terms, scalability can be an issue and this the problem that has been a focus for Vitalik and Ethereum developers and stakeholders to resolve in recent years). One example of an important feature of a Turing Complete language is “Loops” which enables that an instruction can be programmed to repeat multiple times (e.g. execute instruction A x1000), instead of having to repeat the code to the nth degree and potentially corrupt the data through reiteration, or unnecessarily enlarge the volume of coded data.

1 Like

Answers:

  1. The EVM which is also known as Ethereum Virtual Machine, as the name state is an abstract layer running virtually between the nodes and the smart contract. It improves the portability of the software and ensures applications are separate from each other thus protecting the code.

  2. The EVM can read bytecode which is compiled from a smart contract programming language such as Solidity.

  3. Solidity is a smart contract programming language that cannot be executed by the EVM directly. However, it compiled into bytecode which enables EVM to read and execute.

  4. In a simple analogy, Bitcoin is like Internet 1.0 and what it really does is to record transactions and it is deemed as not Turing Complete. Ethereum on another hand is Internet 2.0, which is considered Turing Complete. It brings a whole new level of endless possibilities on what it can do an execute while still adhering to the principle of Blockchain.

  5. A Turing Complete programming language is a limitless capability language that allows a developer to program anything they want and anything they can think of. Two examples would be Javascript for the Internet and Solidity for the Ethereum Network.

1 Like
  1. What does the EVM do?

It executes the Smart Contract in the CPU of the Etherium node.

  1. What is the format of the instructions that the EVM can read?

The format is called Byte.

  1. What is the relationship between the programming language Solidity and Bytecode?

We as humans can not read nor write in Bytecode, we need to use a language intellectually friendly to us, like Solidity. However, once we have finished writing our code, we need to make the EVM be able to read it and there is when we use a translator called “compiler” which will translate our solidity code into Bytecode, that’s how the EVM can execute our Solidity written code.

  1. Why can’t Bitcoin run the same type of complex programs like Ethereum can?

To avoid spam and to avoid storage of applications in the Bitcoin Block.

  1. What is a Turing Complete programming language?

It’s a language able to solve any problem that encounters on its process of application.

1 Like
  1. What does the EVM do?
    It interacts between the network CPU’s (Eth blockhain) and the smart contracts.

  2. What is the format of the instructions that the EVM can read?
    Byte code

  3. What is the relationship between the programming language Solidity and Bytecode?
    You write the code in solidity then compile it into byte code. EVM’s can interact with byte code but not with Solidity

  4. Why can’t Bitcoin run the same type of complex programs like Ethereum can?
    Because it is not Turing complete

  5. What is a Turing Complete programming language?
    it can solve complex problems and is not limited to only specific programming.

1 Like
  1. Ethereum virtual machine (EVM) executes instructions in the smart contracts.

  2. Bytecode.

  3. An application is used to compile Solidity code instructions into Bytecode.

  4. BTC is not turing complete.

  5. A programming language that is Turing complete has loops that allow programmers to instruct software to do one thing several times and can theoretically solve any computational problem given enough time and memory along with the necessary instructions.

1 Like

1- EVM is a piece of code that all computers on the Ethereum network are running. It has the same consensus algorithm as Bitcoin. It reads and executes smart contracts. After reading all of the instructions, it reaches a result, which must be reached by all of the EVMs on the network. It also acts as a security barrier against instructions being directly given to the CPUs in the network.

But I do have a question: HOW does it decide that certain instructions are malicious and therefore should not be passed to the CPUs?

2- The Ethereum Virtual Machine can read EVM byte code.

3- Well, solidity is the turing complete programming language used to write smart contracts. This language is then compiled into EVM byte code in order for the EVM to read and then execute its instructions.

4- Bitcoin’s programming language (Script) isn’t turing complete. Therefore, it can only perform minimal commands such as multi-sigs. This was done purposefully by the Bitcoin developers because Bitcon’s main purpose is to serve as digital gold, not to have its system overloaded by the possibility of repetitive commands due to Loops that a turing complete program has.

5- A turing complete programming language is a language that enables a computer to perform a variety of instructions. Using LOOPS, it can tell software to do one thing several times. From my understanding, this is important as when someone wants to make a slight change to the instructions, they can easily do it and it’ll be changed once in the loop programming instead of MANUALLY having to make a change to each piece of instruction.

1 Like
  1. What does the EVM do?
    The EVM is a code that is running on all Ethereum nodes. The EVM executes the smart contracts directly and then tells the CPU what to do, allowing the CPUs to execute smart contracts indirectly. It also allows for security against certain smart contracts that might otherwise be a security vulnerability to a node’s CPU or computer, or even the entire network.

  2. What is the format of the instructions that the EVM can read?
    It’s written in Solidity (or Vyper??) but compiled into EVM bytecode.

  3. What is the relationship between the programming language Solidity and Bytecode?
    A smart contract is first written in Solidity (or Vyper??) but then compiled down to bytecode for the EVM to read and execute.

  4. Why can’t Bitcoin run the same type of complex programs like Ethereum can?
    Script, the programming language for Bitcoin, is not Turing complete, whereas for Solidity it is. Since it’s not Turing complete, it is limited in its functionality for some applications, for example loops - something in programming software that tells a program to repeat a function.

  5. What is a Turing Complete programming language?
    It’s a less-limited or even non-limited programming language that allows anyone to program anything that they can think of. Non-Turing complete programming languages are limited in their programming capabilities such as the example in the answer above regarding loops.

1 Like
  • What does the EVM do?
    The EVM (Ethereum Virtual Machine) runs on all the computer nodes of the network.
    It reads Smart contracts instructions and tells the CPU what to do
    The reason to use an EVM in between Smart contracts and CPU is for security.
    A smart contract might contain dangerous instructions that might compromise a computer.
    The EVM encapsulates a smart contract in a segregated container so that it cannot access the resources of the computer it is running on. That way, it is the EVM that tells the computer’s CPU what to do, instead of the smart contract directly telling the CPU.
    EVM runs on all the computers of the network (nodes).
    All the nodes need to run the smart contract and reach the same conclusion for it to be valid. This is how consensus on the whole network is achieved.

I have a question: what if just 1 node doesn’t reach the same conclusion as all the other nodes?

  • What is the format of the instructions that the EVM can read?
    The EVM can only read Bytecode

  • What is the relationship between the programming language Solidity and Bytecode?
    Smart contract are written in Solidity than compiled into Bytecode so that the EVM can read it

  • Why can’t Bitcoin run the same type of complex programs like Ethereum can?
    Bitcoin’s programming language is not Turing complete.
    Bitcoin’s developpers did not want to implement a Turing complete language and Smart contracts because they think it would allow the network to be spammed (loop function) and that the blockchain would be bloated by all the smart contracts stored on it.

  • What is a Turing Complete programming language?
    A Turing Complete programming language allows you to program anything you can think of

1 Like
  1. It affords a level of security by not using the cpu of the node (local) to execute code for the smart contact.
  2. bitcode.
  3. Solidity (kinda like JavaScript) will generate Bytecode on the compile.
  4. The code on Bitcoin (ByteCode) is not as robust as Solidity, Things like loops and other code are not available.
  5. Full programming language. You can do anything on it.
1 Like

Sorry. Bitcoin isn’t running Bytecode. My mistake.

  1. What does the EVM do?

The Ethereum Virtual Machine is an application that the Ethereum network nodes run to tell the CPU how to execute smart contracts.

  1. What is the format of the instructions that the EVM can read?

The EVM reads these contracts in a bytecode version.

  1. What is the relationship between the programming language Solidity and Bytecode?

The relationship between Solidity and Bytecode are bridged by the fact one is compiled and converted to the other. Ethereum code is written using Solidity, when smart contracts are deployed they are in Solidity format. A compiler is used to change this format into bytecode. The EVM then is able to read the bytecode version of the smart contact, relay the instructions to the CPU and execute it.

  1. Why can’t Bitcoin run the same type of complex programs like Ethereum can?

Bitcoin cannot run the same type of programs as Eth because it uses a different language and is not Turing Complete.

  1. What is a Turing Complete programming language?

A Turing Complete language will feature ‘loops’ which allow you to command the software to do something several times.

1 Like
  1. EVM, the Ethereum’s decentralized virtual machine, processes and executes smart contracts and secures the Ethereum network. It operates on each node, seamlessly ‘on top’ of the node’s CPU.

  2. EVM bytecode, after the instructions are compiled by Solidity.

  3. A Smart Contract is written/programmed in Solidity. Its instructions are then compiled into Bytecode for the EVM to read/run them.

  4. Because Bitcoin’s programming Language, Script, is not a Touring Complete programming language; thus, limiting complex programming.

  5. A programming language is Turing Complete if it can solve any (in theory) mathematical problem, i.e. you can program any instruction you want. Solidity is a Turing Complete programming language.

1 Like
  1. What does the EVM do? EVM controls the smart contracts and interprets the bytecode to the CPU’s to performs executions on the Ethereum network.
  2. What is the format of the instructions that the EVM can read? Bytecode
  3. What is the relationship between the programming language Solidity and Bytecode? Solidity is the programming language for Ethereum and a compiler converts Solidity into Bytecode on the smart contract.
  4. Why can’t Bitcoin run the same type of complex programs like Ethereum can? Bitcoin contracts are limited because the programming language is not true and complete whereas Solidity is highly programmable because solidity is a true and complete programming language.
  5. What is a Turing Complete programming language? True and complete programming allows for high levels of programming problem solving such as loop commands.
1 Like