A beginner guide to the Ethereum 1.0 architecture
By: Jasmy League
Tags: Cryptocurrency, Jasmy League, Smart Contracts, Evm, Ethereum

Photo by Clifford Photography on Unsplash

Summary. This article aims to help beginners better understand the Ethereum 1.0 blockchain network from its architecture. The technology will be explained in plain English. This article will be the basis to further introduction to the recently launched Ethereum 2.0 network, that has both similarities and differences.

If you find this article helpful, please don’t forget to click the “claps” on the bottom. If this article has raised your interest in the blockchain technology, please subscribe our channel for more information in the future.

As one of the world’s leading blockchain platforms, the emergence of Ethereum marked a turning point in the blockchain industry. The biggest difference between Ethereum and Bitcoin is that Bitcoin provides a worldwide decentralized ledger whereas Ethereum aims to build a global decentralized supercomputer.

There are thousands of articles on the internet introducing Ethereum. If you still have no idea what the structure of a blockchain platform is, after reading all these buzzwords such as “tamper-proof”, “decentralized” and “encrypted”, we hope the following explanation will help you.

Let’s start from the closest part to the users, then gradually move backwards to the backend.

Dapp — Decentralized Application

A dapp or decentralized application is an application built on a decentralized network that combines a smart contract and a frontend user interface. Dapps look no different from any other applications on your smartphone but are run by smart contracts. Compare to a centralized application, a dapp will continue to execute even if the developing company does not exist anymore, because they are decentralized, which means: no one has single control over them. Dapps also have the following important characteristics:

- Deterministic: they perform the same function irrespective of the environment they are executed

- Turing compatible: Given the required resources, the dapps can perform any action

- Isolated: The dapps are executed in the Ethereum Virtual Machines so that if the smart contracts happen to have a bug, it won’t affect the whole blockchain network.

What are Smart Contracts?

Smart Contract

A smart contract is simply a program that runs on the Ethereum blockchain. It’s a collection of code and data that resides at a specific address on the Ethereum blockchain. Smart contracts are a type of Ethereum accounts, not real contracts. Like a vending machine, anyone can buy drinks through putting the required amount of money into the machine instead of purchasing from a person. Smart contracts contain predefines inputs. Once a smart contract is triggered, it will always produce the same output under any circumstances.

Furthermore, anyone can write a smart contract and deploy it to the network. You can also call other smart contracts in your own smart contract. The frequently used languages to write smart contracts on Ethereum are called Solidity and Vyper.

Accounts

Ethereum has two types of accounts: external-owned and contract accounts.

An external-owned account (EOA) is similar to your bank account, which includes an address (account no.) and a balance of ETH. It costs nothing to create such an account. You can control it with your private key (password). You can initiate transaction and receive ETH from other external-owned accounts, just like using your bank account.

A contract account includes two more content than external-owned account, codes and storage. It is controlled by codes. To create a contract account has cost because you’re using the Ethereum network storage. A contract account can only send transactions in response to receiving a transaction, but when a transaction from an external-owned account to a contract account can trigger code which can execute many different actions. What is a transaction in Ethereum?

Transactions

The official definition of transaction is cryptographically signed instructions from accounts. A simple transaction is similar to a bank transaction, sending ETH from one account to another. However, a bank transaction means the currency physically transferred from one account to another, but an Ethereum transaction simply means the state-changing action of debtor and creditor’s balance.

Besides sending ETH from one account to another, a transaction can also create smart contract and call other smart contracts. As we all know, there’s no such thing as a free lunch. The idiom applies in the blockchain network. All transactions require a fee and must be mined to become valid. The fee is called Gas, a reference to the computation required to validate the transaction by a node, which is usually paid in ETH. Complicated transactions will require higher fees than simple ones. Other reasons will cause difference in fee prices as well.

However, all computers in the world have different processing power. Since anyone can join the Ethereum blockchain network, how can Ethereum assure that an arbitrary transaction will cost a fair price regardless the computing differences? Here we need to take a look at the Ethereum Virtual Machine.

Ethereum Virtual Machine (EVM)

What is a virtual machine? A virtual machine is a virtual operating system but behaves like a physical computer. A good introduction on virtual machines can be found here, if you feel difficulty to understand the concept. The original purpose of virtual machine was to narrow the gap among computers so that the developers can run their software in different operating systems without changing hosting computer. It also provides a safe and sandbox environment for testing. Due to the complexity of the EVM, we are not going not dive deeper in this article. But if you are interested to know more, please let us know.

Why does Ethereum use a virtual machine? The Bitcoin blockchain does not contain a virtual machine, because it is a ledger in essence, a system that shows the transition of ownership. The Bitcoin blockchain has script engine to process simple transaction. But Ethereum aims to build a blockchain network allowing anyone to write smart contracts and decentralized application where they can create their own arbitrary rules for ownership, transaction formats and state transition functions. Namely, the Ethereum blockchain needs to process complicated logic. Hence, it requires a virtual machine to support various code under various circumstances.

Why EVM?

The EVM was designed to meet the following requirements.

- Small code size. The EVM is running inside an Ethereum node. Small code size will save space so that users can store more smart contracts in one node.

- Determinism. Given an input, then it has to produce a deterministic output. Thus, the nodes are able to reach agreement (consensus), and the gas consumed at each step will also be calculated exactly the same.

Simple and secure. A blockchain virtual machine should be isolated without the capacity to communicate with the external environment.

(*simplified architecture of Ethereum 1.0 referred from the Ethereum Stack)

We hope this explanation will help you better understand the Ethereum blockchain network.