- What does the EVM do?
An EVM allows it to be possible to have a process of having a smart contract running in a decentralized way on the blockchain enabling consensus to be reached.
The EVM is there mainly for security reasons by ensuring nothing malicious happens when executing a smart contract, by being in the middle of the smart contract and the Ethereum nodes CPU.
This is done because anybody can deploy any smart contract on the Ethereum network and it might have some malicious instructions in order to take advantage of the Ethereum computer node by using the CPU directly. If a smart contract could break free from the EVM and start giving commands directly to the CPU it would be very bad resulting in the entire network being vulnerable.
An EVM is also there to execute all instructions within a smart contract and get to a final result at the end of the instructions within the contract which all EVMs on each computer node has to do the same executing each instruction to reach the same result in order to achieve consensus.
- What is the format of the instructions that the EVM can read?
The Smart contract will be programmed using solidity or viper which will then be compiled into Byte-code which is the format needed by the EVM to be able to read and execute all instructions within the smart contract. The EVM doesn’t care about which programming language was used, its only concerned for the byte-code it receives which allows it to execute the smart contract instruction by instruction.
- What is the relationship between the programming language Solidity and Bytecode?
Solidity is a programing language like java script which is used to program smart contracts into byte-code by using a compiler that takes the solidity code that looks like English, compiling all of the logic and instructions into byte-code allowing the EVM working in conjunction with the CPU to be able to execute the smart contracts instructions.
- Why can’t Bitcoin run the same type of complex programs like Ethereum can?
Bitcoin is not Turing complete so it cannot solve all of the problems that it might have to solve and if you wanted to program some sort of application it would be very limited due to the programing language bitcoin uses which is called scripts, which is a simple version of smart contracts but not really a smart contract due to being very primitive. You could program a multi sig wallet as an example using bitcoin scripts unlike the complex smart contracts’ solidity can create by being a Turing complete program.
- What is a Turing Complete programming language?
Solidity in Ethereum is a Turing complete programing language allowing you to program anything you want or could think of in theory at the same time being a little hindered on practicality though due to Ethereum still having scalability issues. On a technical level a Turing complete language will have something called loops which is a feature of a programming language that allows you to tell software to do one thing several times which is very important in some cases because without loops you would have to physically write all instructions by hand which in some instances cannot be done because a variable might change and you need to be able to adapt the looping to a changed state in your smart contract which means that many features cannot be done without loops which can only be found in a Turing complete language.