0

Can anybody explain this, please?

0

2 Answers 2

1

From the definition of Blockchain it is a distributed ledger. So smart contracts are also a part of the distributed ledger (in Ethereum context) and hence stored in every node of the network. Every time you change the state of the contract (if a state variable changed via a contract's function call), such instructions get executed in every node and new state stored in every node.

2
  • So every transaction runs in every node at same time Correct? Commented Dec 18, 2017 at 13:30
  • Not at the same time as nodes are distributed, but eventually all transactions get executed in every full node.
    – Chim
    Commented Dec 18, 2017 at 13:33
4

On Ethereum, whenever a smart contract is executed, the network comprising thousands of mining computers will process it.

Smart contracts written in a specific programming language, like Solidity, are compiled into 'bytecode' that will be executed by the 'Ethereum Virtual Machine' or EVM. This EVM can read and execute the smart contracts.

All nodes execute contracts using their own EVMs.

Image by Maria Kuznetsov Image by Maria Kuznetsov.

The EVM will execute a smart contract with whatever rules that you or the developers have programmed. The computation on the EVM is achieved through a stack-based 'bytecode' language.

3

Not the answer you're looking for? Browse other questions tagged or ask your own question.