|3. December 2020||Published|
There are terms and processes which are deeply needed to know before discussing about or even staking on Ethereum 2.0. A growing number of people are interested in this subject and there is – to my knowledge – no somewhat easy read on this topic.
What is Ethereum 2.0?
Ethereum 2.0 is the evolution of Ethereum. Ethereum 2.0 is not a new coin. It is separated into 3 different phases (Phase 0-2) and begins with the beacon chain, proceeds to include sharding and later on we are going to see Ethereum 1 included as a shard and we can enjoy many thousands of transactions per second with cheap gas prices. At the moment the beacon chain launched already and the next step is to introduce shards to the mainnet of Ethereum 2.0.
The beacon chain is a complex blockchain with no use case – yet, but the deployment of the beacon chain is necessary to create a foundation on which all other features are built on. It consists of epochs, one epoch consist of slots. Every epoch has 32 slots ready to be filled with blocks. Every block has a parent and a child. There are no transactions, no smart contracts but the beacon chain introduces a new mechanism of consensus which is called Proof of Stake (or PoS). When Ethereum 1 becomes a shard of Ethereum 2.0 it will also give up it’s current consensus mechanism Proofe of Work (or PoW) to facilitate greater security and scalability.
When the 32nd slot of an epoch is due the epoch is finished. If two thirds of the verifiers (also known as validators) agree on two consecutive epochs then those two epochs are justified and the epoch before these two justified epochs is considere finalized.
Slots are the smallest parts of the chain, 32 of them form an epoch. Each slot can only be part of one epoch. A slot has different stages:
- Pending: The validator casting a block for a slot still didn’t broadcast it.
- Proposed: Everything went well and the validator created a block and boradcasted it to enough peers to make it well known.
- Missed: The validator didn’t broadcast the block fast enough or didn’t even create a block. The slot remains empty.
- Orphaned: The validator didn’t broadcast the block at all or fast enough for the next block proposer to see. The block after the orphaned block will reference the parent of the orphaned block.
Each slot must be attested by other validators to be part of the consensus of the chain.
For every slot there are random validators selected by an algorithm to attest (verify) the block in it. An attestation is a form of acknowledgement and can be included not only during the time the slot is the head of the chain, but also later on. This delay in time is measured in slots and called “inclusion distance“.
It’s possible more than a third of the validators are not in consensus with the other part of the network. In this case they won’t attest and propose blocks and the epochs can’t be justified and therefore not finalized. This can happen when a number of validators are offline. On such uncertain terms the network get’s unstable and forks are inevitable, however as soon as enough inactive or malicious validators exited (by force of the algorithm or by choice) the network will resume to produce first justified epochs and of course after a bit more time also finalized epochs.
Ethereum 2.0 will introduce 64 shards, each of them can be seen as a separate blockchain which reports back to the beacon chain for consensus on actions (e. g. transactions) that are spreading over or influence multiple shards.
In general there are two ways to stake on Ethereum 2.0:
- Create validator accounts, send 32 Ether for each of them to the deposit contract and run an Ethereum 2.0 beacon chain client capable of staking
- Use one of the staking services available, sometimes there are even less than 32 Ether needed to participate
A validator has multiple meanings although they are somehow linked together.
- Software: A software to run your validator accounts with
- Validator account: An account of a wallet/seed/passphrase used by a client to stake with
A wallet is a collection of (validator) accounts, most commonly used are hierarchical deterministic wallets which can be easily restored by knowing the seed/passphrase (list of words). After restoring the wallet with the seed it always produces the same accounts in the same order, making it possible to keep the seed safely and restore thousands of accounts with only a couple of words.
There are also non-hierarchical deterministic wallets, the accounts of those wallets are always random and can’t be restored once lost.
The validator software reads this account, which is only composed of a private key and a public key, and fulfills the duties of the validator account, such as:
- Proposing blocks (is rewarded)
- Attesting on blocks (is rewarded)
- Attestation aggregation: Aggregating attestation for a block (is not rewarded, implicit interest of validator to aggregate its own attestation for a block)
Before a validator can start on the network a deposit of 32 Ether must be executed on Ethereum 1 to the deposit contract. After the deposit is noted and verified by the Ethereum 2.0 beacon chain it enters an activation queue. Each day roughly 900 new validators can be activated on the beacon chain.
The gains of a validator account are payed to the validator account on each block for fulfilling its duties. It gains Ether by supporting the network and although it’s possible to deposit more Ether on one validator account there is only earning for 32 Ether, this is called effective balance. However, if the account balance decreases below 32 Ether so does the effective balance and therefore the rewards.
Loosing Ether balance on a validator account is a result of poor execution of duties. There are a number of reason this can happen, e. g. the validator software lost connection to the network or simply has a bug.
Rewards are very small for attestations, but since a validator account has to attest a lot it is a big part of an account’s earning. Proposing valid blocks gives a dump to the balance and is higher the more attestations are included. Also included in blocks are slashings, which are even more rare than blocks (at least should be) and increase the reward gained by proposing a block significantly. However, during a phase of non-finality the account’s don’t get any rewards at all.
https://launchpad.ethereum.org/ has a neat graph to find out easy what interest to expect for running a validator account.
There are a number of ways to exit the validator account and making it unable to participate actively on the network:
- Exit by choice: The owner of the validator account can choose to exit the validator. After it gracefully waited in the queue to be relieved of the duties it can’t start again.
- Exit by loosing too much Ether: After decreasing a validator account’s balance to 16 Ether the validator is exited too.
- Exit by slashing: To prevent attacks on the network malicious behaviour is punished strictly. This happens when a validator account proposes two different blocks for the same slot or attests two times for the same block. The exit is immediately included into the blockchain after discovery of the violation resulting in loss of Ether (up to 1) and sudden exit of the validator account.
After exiting either by choice or by force the balance of the validator account can be withdrawn when the feature will be added later on. At the moment there is no way to transfer the Ether locked on a validator account because there are simply no transactions on the beacon chain whatsoever.
Thank you for reading, I hope you learned something new and helped you understand Ethereum 2.0 a bit better. Drop feedback at firstname.lastname@example.org or on Discord, looking forward to read from you!