Join
May 28, 2026
Login

How to Build Ethereum from Scratch – David Katz

How to Build Ethereum from Scratch – David Katz

How to Build Ethereum from Scratch – David Katz

A decentralized computer consists of multiple machines. Therefore, there has to be some way for those machines to communicate with each other. It needs a network.

The network implementation can be publish/subscribe, peer-to-peer server communication, or something else. As long as there’s a way for each node to share important information like an updated blockchain.

Here’s where Ethereum as a cryptocurrency comes in.

Every node in the network has an individual account. Each account consists of few fields. These include an address, a balance (in ether tokens, the Ethereum unit of currency), account storage, and more.

Then the system needs to support transactions. Transactions in ethereum exchange currency between two accounts. But that’s actually not their full purpose.

Truly, transactions in Ethereum describe changes in state. As in, they outline how the decentralized computer should transition from one state to another.

For example, say account Foo is initializing a transaction to send account Bar 10 ether. Well, the transaction would describe this change in state: decrease the balance of account Foo by 10. And increase the balance of account Bar by 10.

Another example of a transaction is the creation of an account. A transaction like this would describe a change in state like so: record a new account with some randomly generated address, zero balance, and empty storage.

This leads to how smart contracts work. Smart contracts are also accounts. They have an address, balance, and individual storage too. But what makes them different is that they also have code — built with the smart contract language.

Therefore, the interaction of smart contracts happens all through transactions. To register a smart contract in the decentralized computer, whip up a transaction that creates the smart contract account. To execute the smart contract, use its address within a transaction. After all, the smart contract has an address like any other account.

Each node needs to be equipped with a state management data structure (i.e. state manager). The state manager records the results of transactions.

Recall that every block consists of transactions. Well, when a node receives that new block, they will run each of its transactions. The results of those transactions get stored in the state manager.

The state manager has logic that understands the difference between transaction types. Those types being the “create account” transaction, or “standard” one that outlines a currency exchange. Every account is maintained in the state manager, along with its proper balance, storage, etc.

This is also why Ethereum can be described as a decentralized state machine. Every node is executing transactions that transition it from its current state to the next one.

This unified execution of every single transaction, in every single block, by every single machine in the network manifests the state of the entire decentralized computer’s world. Or, as it’s referred to within Ethereum documentation: world state.

Published at Sat, 31 Aug 2019 21:42:50 +0000

Bitcoin Pic Of The Moment
✅ This image from Marco Verch (trendingtopics) is available under Creative Commons 2.0. Please link to the original photo and the license. 📝 License for use outside of the Creative Commons is available by request.
By trendingtopics on 2019-04-07 14:00:20
tags

Previous Article

Bitcoin, Major Stablecoin Wallets Added to Samsung Galaxy S10

Next Article

Top 5 Smart Contract Platforms To Watch in 2020

You might be interested in …