This is a read note of Mastering Ethereum Ch01: What is Ethereum.

1 What Is Ethereum?

From a computer science perspective, Ethereum is a deterministic but practically unbounded state machine, consisting of a globally accessible singleton state and a virtual machine that applies changes to that state.

From a more practical perspective, Ethereum is an open source, globally decentralized computing infrastructure that executes programs called smart contracts. It uses a blockchain to synchronize and store the system’s state changes, along with a cryptocurrency called ether to meter and constrain execution resource costs.

Ethereum shares many common elements with other open blockchains: a peer-to-peer network connecting participants, a Byzantine fault–tolerant consensus algorithm for synchronization of state updates (a proof-of-work blockchain), the use of cryptographic primitives such as digital signatures and hashes, and a digital currency (ether).

Unlike Bitcoin, Ethereum’s purpose is not primarily to be a digital currency payment network. While the digital currency ether is both integral to and necessary for the operation of Ethereum, ether is intended as a utility currency to pay for use of the Ethereum platform as the world computer. Ethereum is designed to be a general-purpose programmable blockchain that runs a virtual machine capable of executing code of arbitrary and unbounded complexity. Ethereum’s language is Turing complete.

2 Components of Ethereum

The components of Ethereum are:

  • P2P network: P2P A peer-to-peer (P2P) network connecting participants and propagating transactions and blocks of verified transactions, based on a standardized “gossip” protocol.
  • Transacttions: Messages, in the form of transactions, representing state transitions including (among other things) a sender, recipient, value, and data payload.
  • Consensus rules: A set of consensus rules, governing what constitutes a transaction and what makes for a valid state transition
  • State machine: Ethereum Virtual Machine (EVM) processes transactions according to the consensus rules. EVM programs, called “smart contracts,” are written in high-level languages (e.g., Solidity) and compiled to bytecode for execution on the EVM.
  • Data structure: A chain of cryptographically secured blocks that acts as a journal of all the verified and accepted state transitions. Ethereum’s state is stored locally on each node as a database (usually Google’s LevelDB), which contains the transactions and system state in a serialized hashed data structure called a Merkle Patricia Tree.
  • Consensus algorithm: it decentralizes control over the blockchain, by forcing participants to cooperate in the enforcement of the consensus rules. Ethereum uses Bitcoin’s consensus model, Nakamoto Consensus, which uses sequential single-signature blocks, weighted in importance by PoW to determine the longest chain and therefore the current state. However, there are plans to move to a PoS weighted voting system, codenamed Casper, in the near future.
  • Incentivization: A game-theoretically sound incentivization scheme (e.g., proof-of-work costs plus block rewards) to economically secure the state machine in an open environment.
  • Clients: One or more open source software implementations of the above (“clients”). The most prominent of which are Go-Ethereum (Geth) using Go and Parity using Rust.

Ethereum has a reference specification, a mathematical description of the system in the Yellow Paper. There are a number of clients built according to the reference specification. Ethereum is open, public, global, decentralized, neutral, and censorship-resistant.

In December 2013, Vitalik started sharing a whitepaper that outlined the idea behind Ethereum: a Turing-complete, general-purpose blockchain. The idea was developed and evolved. By using a general-purpose blockchain like Ethereum, a developer could program their particular application without having to implement the underlying mechanisms of peer-to-peer networks, blockchains, consensus algorithms, etc. The Ethereum platform was designed to abstract these details and provide a deterministic and secure programming environment for decentralized blockchain applications. on July 30, 2015, the first Ethereum block was mined.

Unlike Bitcoin that tracks only the state of currency ownership, Ethereum tracks the state transitions of a general-purpose data store, i.e., a store that can hold any data expressible as a key–value tuple. Two of the critical differences from most general-purpose computers are that Ethereum state changes are governed by the rules of consensus and the state is distributed globally. Ethereum answers the question: “What if we could track any arbitrary state and program the state machine to create a world-wide computer operating under consensus?”

3 Ethereum Virtual Machine (EVM)

Ethereum’s ability to execute a stored program, in a state machine called the Ethereum Virtual Machine (EVM), while reading and writing data to memory makes it a Turing-complete system and therefore a Universal Turing machine (UTM). Ethereum can compute any algorithm that can be computed by any Turing machine, given the limitations of finite memory.Ethereum’s groundbreaking innovation is to combine the general-purpose computing architecture of a stored-program computer with a decentralized blockchain, thereby creating a distributed single-state (singleton) world computer. Ethereum programs run “everywhere,” yet produce a common state that is secured by the rules of consensus.

Ethereum introduces a metering mechanism called gas to prevent never-ending loops and DoS attack. As the EVM executes a smart contract, it carefully accounts for every instruction (computation, data access, etc.). Each instruction has a predetermined cost in units of gas. When a transaction triggers the execution of a smart contract, it must include an amount of gas that sets the upper limit of what can be consumed running the smart contract. The EVM will terminate execution if the amount of gas consumed by computation exceeds the gas available in the transaction. Gas is the mechanism Ethereum uses to allow Turing-complete computation while limiting the resources that any program can consume.

4 Decentralized Applications (DApps)

Ethereum started as a way to make a general-purpose blockchain that could be programmed for a variety of uses. But very quickly, Ethereum’s vision expanded to become a platform for programming DApps. DApps represent a broader perspective than smart contracts. A DApp is, at the very least, a smart contract and a web user interface. More broadly, a DApp is a web application that is built on top of open, decentralized, peer-to-peer infrastructure services.

A DApp is composed of at least:

  • Smart contracts on a blockchain
  • A web frontend user interface

In addition, many DApps include other decentralized components, such as:

  • A decentralized (P2P) storage protocol and platform
  • A decentralized (P2P) messaging protocol and platform

You may see DApps spelled as ÐApps. The Ð character is the Latin character called “ETH,” alluding to Ethereum. To display this character, use the Unicode codepoint 0xD0, or if necessary the HTML character entity eth (or decimal entity #208).

5 Web 3.0

In 2004 the term “Web 2.0” came to prominence, describing an evolution of the web toward user-generated content, responsive interfaces, and interactivity. Web 2.0 is not a technical specification, but rather a term describing the new focus of web applications.

First proposed by Dr. Gavin Wood, web3 represents a new vision and focus for web applications: from centrally owned and managed applications, to applications built on decentralized protocols.

Ethereum web3.js is JavaScript library, which bridges JavaScript applications that run in your browser with the Ethereum blockchain. The web3.js library also includes an interface to a P2P storage network called Swarm and a P2P messaging service called Whisper. With these three components (Ethereum, Swarm, and Whisper) included in a JavaScript library running in your web browser, developers have a full application development suite that allows them to build web3 DApps.