2

I have a question regarding the following statement in the current Ethereum yellow paper. It states that a state and it's transition function is really powerful than any-other existing comparable system. Further explanation would be helpful to understand. Thanks in advance.

Yellow Paper

1 Answer 1

1

it states that is considerably more powerful than any existing comparable system in Ethereum. So this statement is only valid within Ethereum.

What do the parameters in the state transition function mean?

σ = The current state of the whole ethereum network

T = The transaction to execute, contains instructions (for example transfer x eth to address 0x... or execute function y of smart contract 0x...)

Υ = The state transition function, given the current state σ and the instructions to execution T, Y will create a new state by applying the result of all instruction to the current state.

Using only this function, one is able to make changes to the stateDB

How is the stateDB created?

The stateDB contains the current state of the whole ethereum network. The current state can be achieved by applying all instructions given to the Ethereum network in the correct order. More specific: You can get the current stateDB from scratch by iterating through every Block B of the Blockchain in the correct order and by applying Y on the current state σ given the instruction of every Transaction T (in the correct order) in the current Block B.

Why is the state transition function combined with sigma so powerful? Short answer: Because it is able to modify the ethereum state (accounts, code, data), even by executing (quasi) turing-complete code on every full node world wide.

Case 1: Simple transaction between two standard accounts

The StateDB has a subset called "world state", which contains a mapping between addresses and (nonce, balance, code root, storage root). If the Account is a basic user account (EOA), the nonce and the balance are relevant. If it is a smart contract (contract account) the balance, the nonce, the code root (where can the code for the smart contract be found?) and the storage root (where can the data for the smart contract be found?) are relevant. You want to transfer 1 ether to another user, so you create a Transaction T and spread it to the network. Using Y on σ and T, the stateDB, more specific the world state, is changed in the following way: Your nonce increases, your balances decreases by 1 ether, the balance of the other user increases by 1 ether. Every full node on the network is going to check this state transition, when they find your transaction in the next block. If the state transition is valid, they will apply it to their local state.

Case 2: Transaction invoking a function call within a smart contract

The StateDB also contains datasets for code and storage. When your Transaction T contains a function call to a smart contract, the relevant code containing the desired function can be found in the world state (address -> code root). If your function call leads to the creation or change of data in the ethereum network (for example, the function stores how many times you have called this function), the relevant storage location can be found in the world state as well (address -> storage root). How powerful can such functions be? Basically such function calls can be as powerful as a computer program can potentially be, since they are executed on the Ethereum Virtual Machine (EVM), which is (quasi) turing-complete. The only limiting factor is the gas, since you have to pay for every operation the evm executes (for example, a simple add operation costs 3 gas, see Appendix H in the yellow paper). When your Transaction T is processed by a miner, who wants to include it in his/her block and therefore has to check its validity, the EVM on the miners computer will be run by executing the state transition function Y. It executes everything the smart contract you invoked at the given function tells it to execute, as long as there is enough gas. The smart contract can change data (storage) in the stateDB as you already know, but it could also change balances or create new accounts (world state). It can even invoke other smart contracts which on their part can do all this changes as well. At this point, only the miner who wants to include your transaction in his/her block executes instruction in T, but after publishing a block, the whole ethereum network is going to run the function in their EVMs and consequently apply the changes to their stateDB.

So why is Y with σ given any valid T so powerful? Because Y is able to change account information, data, code, basically every information stored in the stateDB. Y is responsible for the appliance of any changes to the ethereum network and thus, it is the most powerful function in ethereum.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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