Subscribe to gusse228
Share Dialog
Surely some of you know what the Ethereum blockchain (from English Ethereum) is, others, on the contrary, do not even have the slightest idea about it. One way or another, both the first and second heard something about this platform. Recently, many articles have been devoted to this topic in various major magazines, but for those people who have heard little about Ethereum, all articles on this topic seem to be something mystical and completely incomprehensible. Then what is this platform? In short: Ethereum is a public database with the ability to store digital transactions for an unlimited time. It is also important to note that no key management systems are required to maintain and protect such a database. Instead, the platform operates as a "secure" transactional system - a framework in which individuals can make peer-to-peer transactions, while neither party has any obligations to the other or third parties.
I wouldn't be surprised if you didn't understand much. Actually, the purpose of this article is to explain how the Ethereum blockchain functions at a technical level, without resorting to complex mathematical calculations or terrifying formulas for this. Even if you are not a programmer, I have full confidence that this article will help you understand the principles of Ethereum technology. And even if some parts of this article will be stuffed with technical definitions that may seem too difficult for you to understand, you should not despair, because its goal is to convey to you an understanding of this platform as a whole, without going into technical and mathematical subtleties.
Many of the topics covered in this article are chewing on those basic concepts that you have probably come across more than once when reading yellow paper (from the English “yellow paper” - the official specification for Ethereum). I have added my own explanations and diagrams so that you can understand this technology as quickly as possible. Well, for the most brave and tech-savvy, I can recommend reading the Ethereum yellow paper.
Let's get started already!
What is blockchain
Blockchain is a cryptographically secure transactional singleton system with shared state. Far from the simplest definition, is it? Let's break each component of this definition into separate parts.
“Cryptographically secure” means that the security of a cryptocurrency is ensured by complex mathematical algorithms that are almost impossible to bypass. The protection built using these algorithms is similar to a firewall: thanks to the algorithms used, bypassing the security system is practically impossible (for example, it is impossible to create fake transactions, destroy transactions, etc.). "Transactional singleton system" means that there is only one given system state, due to which all transactions created in this system occur. In other words, for this system there is only one state, which is the only true one. "Shared state" means that the state set in the system is shared and open to everyone.
Thus, the above blockchain paradigm is implemented in the Ethereum platform.
The blockchain paradigm of the Ethereum platform
The Ethereum blockchain is essentially a transaction state system. In computer science, such a concept as a “state system” or “state machine” is a system that processes input information and, based on the latter, is converted into a new state.
In the Ethereum state machine, all processes start from an “initial state”. This state is analogous to the zero state, in which the machine is located until the moment when any actions associated with transactions begin to occur in its network. When such actions begin to occur, the initial state is replaced by the final state, while at any time the final state reflects the current state of Ethereum.

The state of Ethereum has millions of transactions. These transactions are grouped into "blocks". A block contains a series of transactions, with each subsequent block connected to the previous one, which provides a kind of block chain.

A transaction must be valid in order to cause it to transition from one state to another. A transaction is considered correct only when it has passed the verification process - the so-called "mining". Mining is when a group of nodes (computers) spend their computing resources to create a block of correct transactions.
Any node on the network that claims to be a miner can attempt to create and validate a block of transactions. A common experience is that many miners try to create and validate a block of transactions at the same time. Each miner provides his own mathematical “proof” when sending a block to the blockchain, and this proof acts as a kind of guarantee: if the proof exists, the transactions in the block are considered correct.
A miner must provide their mathematical proof faster than any other competitor in order for their block to be added to the main blockchain. The process of verifying each block, which consists of the miner providing their mathematical proof, is called "proof of work".
The miner who justifies a new block receives a certain reward for doing this work. What reward are you talking about? The Ethereum blockchain uses an embedded digital token, which is called "ether" (from the English ether - "ether"). Every time a miner validates his block of transactions, a new token or new ether is created, and the miner is rewarded for creating it.
Then, you may have a completely logical question: where is the guarantee that each miner will adhere to only one block chain? How do I make sure that another team of miners doesn't decide to create their own block chain?
At the very beginning of this article, we already cited such a concept as a “transactional singleton system with a shared state”. Based on this definition, we can conclude that there are no two or more correct current states - it is the only one of its kind. Thus, everyone who takes part in the process of substantiating new blocks must accept this statement as true. Having multiple states (or chains) would break the whole system because it would be impossible to agree on which of the states is correct. For example, imagine that there were multiple blockchains. Then, in theory, you could collect 10 coins on one chain, 20 coins on another, 40 coins on a third, and so on. In such a case, it would be impossible to determine which circuit is the most "correct".
Whenever multiple paths are generated, a "fork" occurs. Often times, forks are highly undesirable because they break the integrity of the system and force users to choose one of the possible chains.

To determine which of the possible paths is the correct one and prevent multiple chains from being formed, Ethereum uses a technique called the “GHOST protocol”.
GHOST - Greedy Heaviest Observed Subtree
I'll try to explain in simple terms: the GHOST protocol declares that we should choose only the path on which the largest number of calculations were performed. To determine such a path, you can use the number of the block that was defined last ("leaf block"). Thanks to this approach, it is possible to determine the total number of blocks that are in the current path (excluding the initial state block). The higher the block is, the longer the path and the more justification miners have to provide. Based on such considerations, the only correct version for the current state is accepted.
Now that you already have an idea of what a blockchain is, I propose to understand the main components that make up the Ethereum system:
Accounts state fuel about reward transactions blocks transaction execution mining justification
A little digression before we start: when we mention the X hash, we are referring to the KECCAK-256 hash used in Ethereum.
Accounts
The global common state of the Ethereum platform consists of many small objects - accounts that interact with each other through the messaging paradigm. Each account has a specific state and a 20-byte address. An Ethereum address is a 160-bit identifier used to identify any of the accounts.
There are two types of accounts in total:
External accounts are controlled using private keys. However, such records do not have any code associated with them. Contract accounts are controlled by a special code specified in the terms of the contract and have a code associated with them.

External and contract accounts
Let's understand the main differences between external and contract accounts. An external account has the ability to send messages to other external accounts as well as other contracted accounts. For this purpose, it is necessary to create and register a new transaction using the private key. The message between two external accounts is just a value to pass. On the other hand, a message sent from an external account to a contract one implies the activation of the code of the contract account, while it becomes possible to perform certain actions (for example, using such a message, you can transfer tokens, write values to the internal memory, create tokens, perform some calculations, create new contracts, etc.).
With the help of contract accounts, unlike external accounts, it is impossible to independently initiate new transactions. Instead, contract accounts can only start transactions in response to other received transactions (for example, received from an external account or from another contract account). For more information about calls between contract accounts, we will dwell in the "Transactions and Messages" section.
Account Status
The status of each of the accounts, regardless of their type, can take one of four values:
nonce: If the real account matches an external account, then the resulting number is the number of transactions that were sent from the account's address. If the account is a contract account, then the nonce element is the number of contracts created in that account. balance: The total amount of wei purchased by this account. For example, each ether, which is the exchange unit of Ethereum, contains 10^18 wei - fractional parts of the ether. storageRoot: hash of the root node of the prefix Merkle tree (we'll look at what a Merkle tree is in a bit). The Merkle tree encodes the hash of the contents of this account, and by default it is empty. codeHash: hash of the EVM code (from the English Ethereum Virtual Machine; I'll tell you what it is a little later) of the account. For contract accounts, this field is a code that is hashed and stored as a codeHash.

General system status
So, we figured out that the global state of Ethereum is a mapping of account states to account addresses. This mapping is stored in a data structure, a Merkle prefix tree.
A Merkle tree (or "Merkle trie") is a type of binary file consisting of a set of nodes that include:
a certain number of leaf nodes, which are located at the bottom of the tree containing the base data; a set of intermediate nodes, with each node being a hash of its two child nodes one root node, also formed from a hash of two child nodes, which represents the top of the tree

The data at the bottom of the tree is created by dividing the data we want to store into separate chunks. Further, such fragments are placed in data storage baskets, after which they are hashed and a similar process is repeated until the total number of hashes is equal to one or the root hash.

For each value stored within this tree, you will need to enter a specific key. To get the corresponding value stored in leaf nodes, you must get the key command: the chain of which child node to follow. As far as Ethereum is concerned, the key/value mapping required for the state tree is between addresses and their associated accounts, including balance, nonce, codeHash, and storageRoot for each of the accounts, with storageRoot being the tree.

A similar prefix tree structure can also be used to store both transactions and the payment acceptance page. In more detail, each block has a so-called "header" or header file that stores a hash of the root node of three different merkle tree structures, including:
Prefix tree state Prefix tree transactions Payment acceptance pages for the prefix tree


<100 subscribers