Excellent answers sir, well documented! Please keep them like that
Carlos Z.
Excellent answers sir, well documented! Please keep them like that
Carlos Z.
Function of EVM: It is a piece of code that all nodes in Ethereum network are running. Having access to all resources of the computer, EVM makes it possible to execute code on the entire network so that all are in consensus and have reached the same result. Apart from using CPU & other resources the node has, EVM reads, calculates, and executes smart contract (SC), and then gives instructions on what CPU should do. EVM ensures nothing malicious happens such as a SC breaking loose & taking over a computer, thereby providing a security layer for the network.
The format of the instructions that the EVM can read is bytecode from Solidity compiler.
The relationship between the programming language Solidity and Bytecode describes how EVM executes instructions: Smart Contracts have instructions in bytecode and programmers use a programming language, i.e. Solidity on Ethereum to get to this bytecode. It has a compiler that will take Solidity code, compile the logic & instructions given in Solidity, and compile it down to bytecode, which EVM can then read as instructions in the form of bytecode.
Bitcoin canât run the same type of complex programs that Ethereum does because it uses Script language, which is not Turing Complete, meaning it is: a) unable to solve all problems; b) limited to sequential and stack-based operations; and c) not suitable for complex operations.
A Turing Complete (TC) programming language (like Solidity in Ethereum) allows you to write any conceivable program. On a technical level, TC language has loop feature (not available within BTC blockchain network) that tells software to perform a set of functions (=instructions) several times. Without loops, you have to write all instructions by hand, which in some cases you canât do because some variables change.
The Ethereum Virtual Machine is a virtual network of computers responsible for executing code - called a smart contract - and reaching a consensus on that network about the outcome of the code. Each node in the network runs an EVM instance which isolates the smart contract from the network and the host machine. This protects the host and network from malicious code.
The EVM reads Bytecode although the contracts are written in other languages and compiled to Bytecode. Bytecode, sometimes termed portables code, is an efficient instruction set designed to be run by a software interpreter. A code designed to be run in an isolated environment within a computer.
Solidity is a human readable language which is compiled into Bytecode a code that the EVM client understands. It is currently the most common language for contracts on the Ethereum network although Viper is slowly becoming more widely adopted.
Bitcoin has a programming language called script but this language is Non Turing Complete. It is a simple language only designed to execute a discreet set of functions and does not have the ability to run complex programs like Ethereum.
A Turing Complete programming language has enough functionality to to solve any task that can be thought of by the programmer. The âsystem is able to recognise or decide other data manipulation rule setsâ - Wikipedia
An EMV is a application running on the nodes in the ETH network that reads and executes the smart contracts buy utilizing each nodes hardware,cpu. And while doing so maintaining a layer of security between the network and the private node.
The Emv reads Bytecode, meaning it doesnât read the programming language directly, first you will compile them in to Bytecode and that is the format of instruction for EVM software.
Solidity is a programming software, once the solidity code has been compiled it is in Bytecode, a simplistic binary machine language that computers processors use.
Bitcoin - blockchain 1.0 is an non turing complete which has a very limited options of coding on it, while Ethereum - blockchain 2.0 is turing complete with full programming abilities on the blockchain.
Turing complete programming language is a programming language with the ability to fully program including all the set of tools and no basic limitations.
Virtual machines are essentially creating a level of abstraction between the executing code and the executing machine.
This layer is needed to improve the portability of software, as well as to make sure applications are separated from each other,
and separated from their host.
2.
Bytecode
3.
Bytecode is the executing code, solidity is a programming language which will be compiled to Bytecode(executing code)
4.
because the protocol is not turing complete
5.
a system of data-manipulation rules (such as a computerâs instruction set, a programming language, or a cellular automaton) is said to
be Turing-complete or computationally universal if it can be used to simulate any Turing machine
What does the EVM do?
A. The EVM is a virtual machine that runs a special form of code called EVM bytecode , analogous to your computerâs CPU, which runs machine code such as x86_64. Since we as programmers cannot write cumbersome byte code, we need a language that we can easily code in. This code is converted into EVM bytecode and then processed by the EVM. EVMâs are used so that they remain encapsulated in itâs own context and cannot access the operating system of the node.
What is the format of the instructions that the EVM can read?
A. EVM can read Bytecode. This Bytecode is generated by the compiler. Languages like Solidity and Vyper are converted into Bytecode by the compiler so that EVM can read and execute those lines of code.
What is the relationship between the programming language Solidity and Bytecode?
A. Solidity is a high level programming language where programmers can easily write and read code. Bytecode is a low level code that can be understood by the EVM to perform actions. Solidity is converted into Bytecode when the compiler compiles the code.
Why canât Bitcoin run the same type of complex programs like Ethereum can?
A. The Bitcoin protocol requires you to write programs in Bitcoin script. Bitcoin Script is not a turning complete language and simple iterative tasks cannot be written with it. This makes Bitcoin script extremely limited in its functionality and thus complex programs cannot be written in it. Ethereum, on the other hand, provides a Turing complete language which helps in writing any sort of program possible.
What is a Turing Complete programming language?
A. A Turing complete language is one that can perform any computation.
The EVM is a virtual machine designed to read and execute smart contracts. It is a sandboxed piece of software which runs on all nodes.
Bytecode compiled from a programming language
Solidity is the programming language the programmer writed the code in. It is then compiled into bytecode which the EVM can read and execute.
It uses Script, a language which is not Turing complete.
It is a language which can be used to solve any problem given enough time and memory.
What does the EVM do?
Ethereum Virtual Machine (EVM) is an application run on all nodes on a Ethereum network. It verifies and executes smart contracts.
What is the format of the instructions that the EVM can read?
Instructions for EVM is written in Bytecode.
What is the relationship between the programming language Solidity and Bytecode?
Solidity is a high-level programming language by which developers create smart contracts. EVM does not interpret Solidity codes directly. A compiler is needed to convert Solidity codes into Bytecode for the EVM to read.
Why canât Bitcoin run the same type of complex programs like Ethereum can?
It is because Bitcoin does not support Turing-complete programming languages. That severely limits the complexity of programs that can be run in a Bitcoin network. On the contrary, Ethereum supports codes written in Turing-complete languages.
What is a Turing Complete programming language?
A Turing-complete programming language means that the language can be used to model all possible logic situations. One important feature of a Turing-complete language is the capability of implementing loops.
The Ethereum Virtual Machine is a program embedded in a node responsible for executing bytecode/commands contained in smart contracts. It also acts as a kind of buffer between the CPU and the smart contract to protect the computer from malicious activity embedded in a smart contract that might take control of it.
The EVM reads bytecode. Bytecode is code that is processed by an EVM rather than the CPU.
Solidity is a high level programming language, more understandable/readable by humans. Solidity is compiled to bytecode which is a low level language, more ârawâ or more directly related to mathematical commands the processor understands.
Script is the language used to attach simple functions to bitcoin, but they are not dynamic and able to make changes/decisions etc⊠like solidity.
A Turing Complete language is dynamic, able to make decisions, find answers, perform loops, etcâŠ
EVM or Ethereum Virtual Machine is basically a program which executes the Bytecode written in the Smart Contract. It also is kind of a link between smart contract and Nodes, thus preventing the malicious activities that might happen if code starts interacting with the Node.
EVM process the instruction written in Bytecode.
Solidity is a programming language written and understood by developers and they create smart contracts in solidity. But EVM does not understands solidity code directly thus, a compiler compiles the solidity code into Bytecode which EVM can read and further executes the command via CPU.
Bitcoin basically uses script for coding which is not Turing complete programming language.
A Turing complete programming language means that they can solve all logic problems, can implement loops.
1.- The EVM runs on all the ethereum nodes and it was created to create consensus in the code of the smart contracts. As all the nodes will run the code of the smart contract and if all the nodes agree and have the same output, consensus is reached.
2.- The EVM can read byte code.
3.- Solidiy is the language developers program the code of the smart contract, after the smart contract is developed it will go through an interpreter (code will be deployed) which will transform the code to bytecode so it can run on the EVM.
4.- Because the developers didnât want the bitcoin network be spammed with transactions and didnât want to increase the size of the blockchain.
5.- Turing complete language is a language that allows developers to create more complex code, i.e. loops. This way developers can think of more complex functions rather than typing all the code by hand and with limited capabilities.
A1. The EVM interacts between the smart contract and the cpu(s) via the nodes. Every single node on the network has an EVM in the same way they have a cpu. The EVM will read the smart contract code and communicate the info to the nodes cpu(s)
A2. The EVM application runs on top of the hardware on each node. It utilises all the resources it requires from the nodes. The EVM looks at the code in the smart contract(s), which has been compiled to EVM Byte code, calculates and executes the instructions and relays the instructions to the cpu(s). It will then achieve a result. All EVMs in every node must come to agreement with the same result in order to achieve consensus.
A3. Solidity is the language used to write the smart contract, but the instructions are then compiled into Bytecode and read by the EVM. The EVM is only interested in the Bytecode and not the programming language used.
A4. Bitcoin uses the Script programming language. It is not Turing complete meaning that it is limited in capability, therefore it is not able to perform all that may be required of it.
A5. It is a programming language where you can create anything you can imagine on. It also has loops which makes it more versatile.
EVM is a second layer protocol on the Ethereum blockchain. EVM reads the Bytecode compiled from Solidity to read and run smart contracts. Solidity is a Turing complete language, meaning it can execute complex functions because its allowance of loops in the program. Bitcoin runs on Script, a non-Turing language. Therefore it cannot perform the same type of complex programs that Ethereum can.
The EVM (Ethereum Virtual Machine) securing the Ethereum network. EVM store and execute smart contracts on ETH.
The format that ETV can read is byte code
In Solidity we program our smart contract and then compiled into byte code so the ETM can read the smart contract
In Bitcoin we have Script and it is not turing complete like the solidity from ethereum wich it is. so in bitcoin we can not solve any problem. And Bitcoin does not needed and it is better for Bitcoin, because of the spamm that can happen.
turing complete Itâs a programming language that can be used to solve any computational problem.
What does the EVM do?
A. The EVM reads the smart contract and give the instructions to the CPU.
What is the format of the instructions that the EVM can read?
A. The EVM reads byte code.
What is the relationship between the programming language Solidity and Bytecode?
A. A compiler takes the Solidity code and compiles it into bytecode.
Why canât Bitcoin run the same type of complex programs like Ethereum can?
A. Bitcoin is not turing complete, it canât solve all the problems you may have; it is limited.
What is a Turing Complete programming language?
A. A turing complete language has the abilty to use loops to make a more complex program.
PS
The homework on this link has two #5 as a #4.
The EVM is a program that runs on the CPU of Ethereum nodes. It reads the smart contracts and it tells the CPU what to do. It is important to use the EVM so there isnât any malicious smart contract attacking the nodes.
Bytecode
Solidity gets compiled into bytecode via a compiler, so that the EVM can read it.
Bitcoin uses script which is not a turing complete language. the bitcoin developers didnât want it to be able to do so either, because they do not want the blocks to get full. Having the ability to have all. that complex programming brings with it a lot of scaleability issues.
A language where there is no limit of what can be programmed on to it.