Beacon Chain: Heart of Ethereum 2.0
Ethereum 1.0 went live in the year 2015. At the time of writing this article, it uses the classic Proof-of-Work (Same as Bitcoin). Ethreum introduced turning complete smart contracts to blockchains.
What are Smart Contracts?
Smart Contracts are programs on Blockchain that can be triggered from outside of the blockchain and capable of storing data (Limited) and change the state of the EVM.
These smart contracts enable Dapps like CryptoKitties, LocalEthereum, and many more.
However, all these Dapps face scalability problems because of Blockchain limitations. PoW made it really hard to scale the Dapps to a larger audience.
The best example is the popularity of CryptoKitties. In 2017, as more and more people flocked to the platform to get the cryptokitties, it congested the whole Ethereum network and the transaction fees went to the $20.
This highlighted the shortcoming of the current network. Therefore, in the year 2016, Vitalik proposed the idea of shifting from Proof-of-Work to Proof-of-Stake.
This initiated the Ethereum 2.0 phase christened as Serenity. Serenity is all set to be released in different phases.
Before going further, let us try to get a generalized idea of Proof-of-Stake (PoS).
What is Proof of Stake?
In Proof of Stake, a user will stake his/her asset as a security deposit to take part in the consensus protocol.
These people are called validators responsible for forming the blocks ( In PoW, miners were responsible for forming the blocks).
A validator is selected randomly to propose the next block. The block is then verified (through voting) by the rest of the validators. After the block is verified, it will be broadcasted in the network.
Examples of some of the well known PoS protocols include Delegated Proof-of-Stake, Byzantine Fault Tolerance Type Proof-of-Stake, and many more.
Ethereum proof of stake is called Casper.
Advantages of PoS
- Elimination of energy-consuming hardware
- Reduce chances of 51% attack
- Increase the scalability of the network
Beacon Chain is the heart of Ethereum 2.0. It is the base upon which the rest components like Shard, eWasm, and cross-link will be built.
It (PoS based chain) will run parallelly with the Mainnet (PoW based chain). Beacon chain is mainly made for the validators.
How to become Ethereum Validator?
To become a validator, a node has to deposit (stake) 32 Ether to a smart contract in the Ethereum Mainnet.
The amount is locked, and the contract will produce a log entry (a Merkle hash), which is proof to your stake.
It is like a gate pass to the Beacon chain. After that, you are made as an “active” validator and have earned the right to take part in the validation processes.
The node will be allowed to become the part of the validator committee, who will vote for the validity of blocks. A committee consists of 120 randomly selected validators.
Each committee will be responsible for a Shard (Think of it as a segment of Ethereum Network).
Read Now: Sharding in Ethereum
Block Production In Beacon Chain
Just like hearts have heartbeats, Beacon has slots. Each slot is around 16 seconds.
In this time-frame, a validator (called proposer) is selected randomly. The rest of the validators in the committee becomes attestors.
The role of the proposer is to collect a group of transactions to form a block. The attestors will attest(vote/vouch) for the validity of the block.
After the block validation, it will be added to the shard. 32 slots collectively form one epoch.
One should keep note that the number of transactions that can be included in a block is proportional to the stake deposited by the validator.
For example, Alice has staked 38 ETH and if she is selected as the proposer, she will be allowed only a limited amount of transactions to include in the block.
Now, Bob has staked 200 ETH. If he is selected as a proposer, he will be allowed to include a lot more transactions than Alice.
After the block is validated and broadcasted, the proposer receives an incentive along with the transaction fees. According to Vitalik, the return in staking can vary from 2.2% to 6%.
Slashing in Beacon Chain
What if a Validator selects an invalid transaction? In that case, the attesters will find it invalid and won’t vouch for it.
As a result, the proposer will lose a portion of the stake for malicious practice, this is called Slashing.
When slashed, a Validator may also lose a portion of his stake (called quadratic leak) if he/she is offline for a very long time.
If the staking amount falls below 16ETH, the validator will be removed from the Beacon Chain.
Any person in a sound mind won’t try to trick the network as it will result in his own monetary loss. So to make the best out of the staking, a validator has to be actively involved in the righteous practices.
At the initial stage, the Beacon chain won’t have smart contracts and EVM. There is nothing much one can do with just the heart. But this is the best for the formation and functioning of other body parts.
To interact with the beacon chain, you will need a Beacon Chain Client. You can use Geth, Parity, or Pantheon to run Beacon Chain Client on your machine.