Blockchain By Example
上QQ阅读APP看书,第一时间看更新

Ethereum virtual machine and smart contracts

The Ethereum virtual machine and smart contracts are key elements of Ethereum, and constitute its main attraction. The smart contract is a concept that was introduced in the 1990s by Nick Szabo, as a set of commitments specified in digital form. In Ethereum, smart contracts represent a piece of code written in a high-level language (Solidity, LLL, Viper) and stored as bytecode in the blockchain, in order to run reliably in a stack-based virtual machine (Ethereum Virtual Machine), in each node, once invoked. The interactions with smart contract functions happen through transactions on the blockchain network, with their payloads being executed in the Ethereum virtual machine, and the shared blockchain state being updated accordingly. The following diagram provides a general overview of the smart contract execution environment and the interaction between the virtual machine and the blockchain ledger: