Homework on EVM

Hello sir, I will explain you how the EVM works, but you have to answers the other questions please.

The EVM (Ethereum Virtual Machine) Its an application that run in top of an ethereum node that execute the bytecode of an smart contract within a safe environment (smart contracts cannot harm nodes since they run in a virtual machine).

Think of an EVM like a safe virtual sandbox that handle the bytecode instructions of an smart contract in order to verify if all the instructions are valid and will not harm either the node or the network before those instructions pass through the node and then the network itself.

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

Carlos Z.

1 Like

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

Hello sir, indeed, but what is the format of those instructions?

5.What is a Turing Complete programming language?

Yes sir, solidity is a turing complete language, but would be great if you could please describe a little more what is a turing complete language in general. (also, it can not solve all problems, if it could, i will try to used it to force/solve one of my ex-girlfriends to love me again for example :rofl:, just trying to be funny :wink:).

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

Carlos Z.

1.It is an application that run across all the nodes on the Etherium network by consensus. It is executing the instructions programmed in the smart contracts, which it then instructs to the connected CPU.
2. The programming format of instructions is called Bytecode, the EVM reads such instruction by instruction, starting from the top.
3. The programming language Solidity is used by the DEVELOPERS, by running it through a program called Compiler, the information is then converted into Bytecode and inserted in a smart contract.
4. Bitcoin has a limited programmability called Script. This is not Turing Complete. This means that it cannot solve all problems. Etherium uses Solidity which is Turing complete. One important difference is that Etherium can run programmed loops while bitcoin cant perform this to the same extent.
5. Turing Complete programming language in short allow you limitless program capabilities. It gives the developer the possibility to create any application on top of the Etherium platform.

1 Like

Almost right sir, but Solidity is not used by the miners, Solidity programming language is used by developers to design/create smart contracts and then Solidity will compile all the code of the smart contract into bytecode to be executed by the EVM.

Hope this gives you a clear view of the subject, keep learning! :slight_smile:

If you have any doubt, please let us know so we can help you!

Carlos Z.

  1. It is responsible for executing smart contract on solidity.

  2. bytecode

  3. bytecode is a format that EVM compiled written in solidity.

  4. Bitcoin will lose its value as digital asset, that’s why the developers of bitcoin rejected vitalik’s proposal about programmable features on bitcoin and created his own called ethereum

  5. is a programming language that can solve any problems that you can think about. also can do data manipulation.

1 Like
  1. What does the EVM do?

Is the program which can read smart contract on your computer.

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

The format of the instructions that EVM can read is called called bytecode. This bytecode code (a series of single-byte opcodes and optional arguments) is then processed by the EVM via a last-in-first-out stack arrangement.

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

Smart contracts on Ethereum are written in Solidity code. The code gets executed command by command and interpreted by Bytecode.

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

Bitcoin is not turing complete.

  1. What is a Turing Complete programming language?

Is an programming language that you can build on top off. You can use loops and be more flexible.

1 Like

Great thank you, So the EVM is receiving the tx data (smart contract execution, or any other Ethereum operation) verifying it and then passing it to the node. Then the node pass it to the meme-pool. Then the miners build blocks from there.

1 Like
  1. What does the EVM do?
    An Etherum Virtual Machine is another layer on top of the Proof of Work consensus algorithm that got initially created within Bitcoin. It acts as a CPU does on a computer in that it distributes the power to execute the tasks programmed in a smart contract. Like bitcoin it does that in a decentralized way via peer to peer.

  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?
    The EVM can only read Bytecode but Solidity is one of the languages that can get compiled to it.

  4. Why can’t Bitcoin run the same type of complex programs like Ethereum can?
    Because as a programming language it’s simply not Turing Complete and thus unable to do so.

  5. What is a Turing Complete programming language?
    A language which can execute all calculations we can possibly think of. This requires also the necessity to perform loop functions for reiterations.

1 Like

[after getting help]

  1. It is made to enforce protocol rules and security like; verify all conditions in the contract, eliminate infinite loop ,etc.
  2. It reads Ethereum Bytecode, provided by the Solidity Compiler.
  3. (Uncertain) The bytecode is the smart-contract converted by the Solidity compiler in bits.
  4. It is Turing Incomplete. Only perform a small set of operations.
  5. It is a language that has ā€œall the elementsā€ or tool inside it to create a complete program, regardless of its performance and speed.

[edit]
Here’s some contant that helped me understand the content in this section of the course

1 Like
  1. What does the EVM do?
    EVM stands between the smart contract and the CPU of the computer(s) of the network. It encapsulates the smart contract to make sure the smart contract cannot start a malicious attack on the CPU.

  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?
    The SC is written in Solidity and then compiled into Bytecode for the EVM to read it.

  4. Why can’t Bitcoin run the same type of complex programs like Ethereum can?
    Because Bitcoin uses the Programming Language Script instead of Solidity. Script isn’t a Touring Complete programming language, so it’s limited in the complexity of programs you can create with it.

  5. What is a Turing Complete programming language?
    With a Touring Complete prog. language you can in theory code whatever program you want, without restrictions.

1 Like
  1. Every node in the Ethereum network runs an EVM instance which allows them to agree on executing the same instructions. The EVM is Turing complete, which refers to a system capable of performing any logical step of a computational function. JavaScript, the programming language which powers the worldwide web, widely uses Turing completeness.
1 Like

1.What does the EVM do?

Quite close sir, but the EVM does not execute the smart contracts in solidity, it execute the bytecode that solidity has compile.

3.What is the relationship between the programming language Solidity and Bytecode

Solidity compile the smart contract into bytecode and then the EVM read/execute the bytecode.

Hope this gives you a clear view of the subject, keep learning! :slight_smile:

If you have any doubt, please let us know so we can help you!

Carlos Z.

1 Like

Thank you for taking your time to clarify this for me Carlos!

Take care!

BR
Filip

1 Like
  1. The EVM is an application that runs on all the nodes in the network and it reads and then executes the smart contracts and gives the instructions to the CPU and then the cpu will reach an end result.
  2. Byte Code
  3. When you compile the solidity code using the compiler, it will translate the code into byte code.
  4. Bitcoin is Not Turing complete.
  5. A turing complete programming language is Solidity.

Thanks for the clarification! :slight_smile:

  1. EVM operates as a runtime environment for compiling and deploying smart contracts. Basically, EVM is the engine that understands the language of smart contracts, which are written in the Solidity language for Ethereum.
    2and 3. Any programming language in the smart contract, for example Solidity or Viper, is compiled into the bytecode, which the EVM understands. This bytecode can be read and executed using the EVM. Once you write your smart contract in Solidity, that contract gets converted into the bytecode and gets deployed on the EVM. And thereby EVM guarantees security from cyberattacks.
  2. Bitcoin is more primitive because it is NOT ā€œTuring Completeā€ while Etherium IS Turing Complete.
  3. Turing complete is a system of data-manipulation rules such as a computer’s instruction set, or a programming language is said to be ā€œTuring-completeā€ or ā€œcomputationally universalā€ if it can be used to simulate any Turing machine. This means that this system is able to recognize or decide other data-manipulation rule sets.
1 Like
  1. Etheruem vittual machine
  2. byte code
  3. solidity is used to create bytecode
  4. bitcoin in not turing
  5. Solidity
  1. It checks the instructions in a smart contract and then forwards them to CPU which executes them.
  2. The format is bytecode.
  3. In Solidity you write the instructions in english language and then are these instructions through compiler written in Bytecode.
  4. Bitcoin does’t have a turing complete programming language. Also it has a very limited block size which is used just for transactions.
  5. It is a language in which you can program anything you want. It has a feature of loops which means that it can execute the code several times.
1 Like
  1. The EVM runs on top of the nodes in theETH network allowing for smart contracts to be executed
    2.EVM is seperate from the nodes and local computer. running in a virtaul sandbox environment to protect the network from malicious code.
  2. The relations between Solidity and Bytecode. the code used to write on ETH network is solidity, solidity users a complier to turn the code into BYTECODE fullof transactions to be read by EVM
    4 BTC cannot run the same smooth as Ethereum because, BTC uses a code called script & script cannot slove all problems given to it.
  3. Turing complete program is a program that is able to solve any equation. EVM uses this to execute smart contracts. When all nodes are in agreeance about the same outcome it creates a consensus of whats the right way to move forward. The Turing program allows for this to happen since they can solve complex equations.
1 Like

What does the EVM do?
EVM stands for Ethereum Virtual Machine and it is a powerful, sandboxed virtual stack embedded within each full Ethereum node.

What is the format of the instructions that the EVM can read?
The format is Bytecode and the language is made up of multiple opcodes. Each opcode performs a certain action on the Ethereum blockchain.

What is the relationship between the programming language Solidity and Bytecode?
Solidity is the programming language used to write smart contracts on the Ethereuem blockchain and then complied into Bytecode which is directly executed on a virtual machine.

Why can’t Bitcoin run the same type of complex programs like Ethereum can?
Bitcoin uses a programming language called Script and it’s just not turing complete, it’s not computationally universal like Ethereum.

What is a Turing Complete programming language?
A Turing Complete system means it could be used to solve any computation problem. Most of the languages today are Turing complete or Type 0 languages like C++, Java, JavaScript, Solidty, Pascal etc.

1 Like