Ethereum 1.0
Mainnet Statistics
Item |
Value |
Remarks |
Started At |
2015-06-30 |
> 51 Months |
Node Number |
~ 7,000 |
2019 |
Account Number |
> 77,000,000 |
2019/10/13 |
Block Number |
> 8,700,000 |
2019/10/15 |
Block Time |
~ 13 sec |
2019/10/15 |
Transaction Number |
> 560,000,000 |
2019/10/15 |
Throughput |
~ 9 TPS |
2019/10/15 |
Full Node Size |
~ 200 MB |
Current State + All Txs |
Archive Node Size |
~ 3.2 TB |
Current State + All Txs + Snapshots |
Hard Forks
EVM
- 256-bit Virtual Machine
- maximun 2256 ≈ 1077 addressess(accounts)
Account State
Property |
Description |
Remarks |
nonce |
# of tx. sent for EOA or # of contracts created by the account for contract account |
scalar value |
balance |
the # of Wei (10-18 Ether) |
scalar value |
storageRoot |
A 256-bit hash of the root node of a Merkle Patricia tree |
|
codeHash |
The hash of the EVM code of this account |
immutable |
Ethereum 2.0
<img src=”https://miro.medium.com/max/1744/0*ufBJ5S8YX0IGIqng” alt=”Ethereum 2.0 Architecture” width=1024 border=1 style=”border-width:1”/>
Key Concepts
Becon Chain
- Key function (from “State of Ethereum Protocol #2: The Beacon Chain”)
- Manage the PoS protocol for itself and all of the shard chains
- Managing validators and their stakes
- Nominating the chosen block proposer for each shard at each step
- Organising validators into committees to vote on the proposed blocks
- Applying the consensus rules
- Applying rewards and penalties to validators
- Functions (from “Ethereum 2.0: A Complete Guide. Scaling Ethereum — Part Two: Sharding.”)
- Manages the validator registry.
- Provides the randomness (through a RANDAO and later a VDF)
- RANDAO : provide unpredictability and unstoppability
- VDF : provide unbiasability
- Provides finality through casper FFG
- Keeps track of shard cross-links
- Stores execution environment contracts (In phase 2)
- Beacon Chain does not have data - it will not store the balances of accounts, locations of tokens, state of dapps, or any other information the current blockchain stores. Firstly, it stores the list of Validators. Secondly, it stores attestations.
- Attestations are confirmed and validator-signed hashes that reference the current state of a given shard.
Casper
- For each proposed block, validators stake a portion of their coins on a block which they think will be a valid addition to the chain.
- If that block gets appended, it will be added to the chain and any validator who bet on it will be granted an award proportional to their bet. Since there is no block award in a PoS system, validators are rewarded with transaction fees.
- A validator must not publish two distinct votes for the same target height.
- A validator must not vote within the span of its other votes.
- Any validator who violates either of these commandments is considered malignant, and their entire deposit (not just their stake) is slashed.
-
Validators who’s nodes go offline are also punished in order to increase availability and reduce censorship of transactions.
- For each block, an active validator is selected to propose a new block and the other active validators must all vote on its validity.
- Attestations can be votes for both a shard block as well as proof of stake votes for a block on the beacon chain.
-
Once enough attestations for each shard block are collected, the block is appended and a crosslink to the beacon chain is created to keep it up to date.
- A validator is an entity (person or company) who can propose new blocks for the blockchain, or someone who confirms another validator’s proposal.
- A validator who proposes is called a proposer, while a validator who validates the proposal is called an attester.
- When some validators are picked to be the committee, they are responsible for attesting to a state, i.e. building the next block.
- One slot means one proposal of a block and attestations from other validators that this block is A-OK.
- A set of slots during which all the randomly picked validators have had the opportunity to make an attestation is called a cycle.
Casper FFG (Casper the Friendly Finality Gadget)
Casper CBC (Casper the Friendly GHOST: Correct-by-Construction)
Validator
- Anyone who wishes to be a validator must make a deposit of exactly 32 Eth.
- The deposit will generate a receipt and will likely contain an ID that indicates the shard to which the validator is assigned
- The node will become a pending validator on the beacon chain.
- After a period of time, they will become an active validator who can participate in the PoS protocol.
- Active validators will take turns to propose new blocks and vote on their validity.
Slashing
Crosslink
- Periodically, the current state (the “combined data root”) of each shard gets recorded in a Beacon Chain block as a crosslink.
- When the Beacon Chain block has been finalised, the corresponding shard block is considered finalised
- A set of signatures from a committee attesting to a block in a shard chain, which can be included into the Beacon Chain.
- The main means by which the Beacon Chain “learns about” the updated state of shard chains.
Sharding
- User accounts will all be specific to a certain shard.
- Transactions within shards will be relatively simple and similar to Eth 1.0 transactions, while transactions between shards will require an added layer of complexity.
- In order to insure efficiency and security, interactions between individual shards need to follow a special protocol.
- Sharding would increase Ethereum’s throughput and network speed by a factor of over 1000. The addition of layer two solutions such as zk-rollups and plasma will increase this number still further.
Double Verification Process
- Validators are periodically and randomly assigned to a shard.
- Validators vote on the validity of each transaction package.
- A separate committee on the beacon chain must verify this vote using a sharding manager smart contract.
- If the second vote also passes, the transaction package will be appended to the mainchain and become part of the public ledger, establishing an immutable cross-link to the transaction group on that shard.
- After a certain period, the validators on each shard are relieved of their duty and return to a larger pool. They are replaced by new validators drawn from this same pool and randomly selected by the beacon chain.
Plasma Chains
- Plasma chains are semi-independent blockchains that can be registered to, and commit transactions on, the Ethereum mainchain.
- Plasma chains use a tool called MapReduce in conjunction with a merkle trie construction to facilitate quick and easy fraud verification in the event of a Byzantine component (bad actor)
- Plasma chains even include a “roll-back” feature that will be activated if a “bonded truth of spend” request fails due to a fraud attempt by a maleficent actor.
- Eth 2.0 will feature both solutions so users will be able to choose whether to use the sharded mainnet, a plasma chain, or both, depending on their unique individual needs and preferences.
Game Theory
- https://en.wikipedia.org/wiki/Game_theory
Solidity Secure Programming
My Schedule