MGStaking
Published in

MGStaking

An Overview of Elrond’s Consensus, PoS Economy and Frequent Staking Questions

The Staking Concept, as it suggests, comes from the idea of putting something at stake in order to get the right to participate in the transaction validation and consensus process. In essence, the staking process implies a minimum number of tokens to be locked in order to be allowed to participate in the Network’s Security Process, a service that is rewarded.

In this article we will explain the way Elrond’s Secure Proof of Stake mechanism works, its economics and also the whole process the user has to go through when Staking on Elrond Network. In order to explain all these in a clear way, we need to start from explaining the whole process of a transaction from the moment when it is signed until it is included in the blockchain.

What happens when I send a transaction?

A transaction means sending tokens between wallets. A blockchain wallet is identified through the asymmetrical pair of keys public — private that are used to preserve the privacy and the security of the transactions. When we wish to send a token on blockchain we sign a transaction that includes the sender, the receiver and the amount. The signature is basically an encryption by our private key. Anybody from blockchain space can validate/verify this transaction by decrypting it (verifying the signature) with the public key. In this way one can see who sent it, to whom and how much.

Every round (6 seconds), a consensus leader and other 63 validators are chosen to be part of the consensus group in each execution shard (Shard 0, Shard 1, Shard 2). Validators selections are based on a random seed that is strong, unpredictable and impossible to be altered. The consensus leader gathers all the waiting transactions, both intra-shard and cross-shard, it verifies each one of them, it groups them in miniblocks, it signs the block and sends it further to the other validators from the consensus group. These ones check every transaction and when ⅔ +1 of the consensus group signs the block, the block becomes valid and is sent to Metachain.

Because the easiest way to assimilate new information is by associating it with something that is familiar, we could create a parallel with the way the Bitcoin system works, where all the miners try to solve a mathematical equation that validates the transactions of a block. The first node that solves the equation has the right to add the block in the blockchain and sends it further. At that moment all the other nodes stop their equation solving process, they verify the solution that was found by the first node, they confirm it and move on to the next block to be processed. After seeing how both mechanisms work we can state that Proof of Stake is based on algorithms that allow nodes to work together to validate the transactions and attaining the consensus while the Proof of Work creates a race between the nodes.

Proof of Stake Economics

If you manage to reach this chapter that means you are passionate about blockchain technology and that you think in the following years and decades it is going to be part of our lives on a daily basis and it is going to bring value to our society. We think you asked yourself at least once why we need these cryptocurrencies and if the technology could work without them. Well, the cryptocurrency have well established roles inside a public blockchain. The network won’t be able to work without it.

Firstly, the cryptocurrency has the role of encouraging and rewarding the participation in the Network’s Security and the transaction validation process. Elrond has a well developed incentives system that stops inflation from harming the holders and at the same time it covers the maintenance cost of the nodes run by validators. Due to these the Network Security is increased and a virtuous circle is born. As more users are attracted to use the network due to its Security, more fees are generated as a result of their activity on the network and the validators get even more rewards, a fact that attracts even more users to become validators and secure the network.

Another important use case of a cryptocurrency inside a blockchain is being used as transaction fees payment or as we usually call it in the crypto space, gas fee. Having this system that requires every user to pay a fee for each transaction, spam is discouraged and the scenario in which the network could be willingly congested becomes improbable.

Now that we explained the relationship between cryptocurrency and blockchain we can move further to staking rewards and the ways they are generated.

EGLD Economics has almost the same principles as Bitcoin’s model and it is probably the first one having a max supply built on a Proof of Stake system that is built using an architecture capable at the moment of speaking of 16200 transactions per second and that comprises 3 execution shards but the network can scale linearly (if more throughput is needed more shards can be added to meet the new requirements).

The economic model implemented with the launch of the network a minimum reward per year guaranteed through new coins issuing. 11 415 927 EGLD will be issued as staking rewards to reach the maximum total supply. The issuing will be made on a 10 years plan after which the total supply will theoretically be 31 415 927 EGLD. The mentioned total supply is theoretical and will actually not be reached because of the mechanism that was implemented to use 90% of the transaction fees to diminish the inflation. The other 10% are sent by the same mechanism to Elrond protocol treasury for the protocol’s further development. All the above considered, the maximum total supply is reduced with every transaction on the network.

We can notice in the above schedule that every year (if we assume no transaction is done on the network) a fixed number of EGLD is issued. This is not very suggestive though so we will explain how APR is calculated.

During the first year 2 169 025 EGLD are issued. These are distributed among the 3200 nodes.

As a result of the distribution each node is to get 677 EGLD minus 10% for protocol sustainability meaning 610 EGLD for each node. After distributing the 610 EGLD to the base stake (2500) we get a 24.4% APR.

The APR is 24.4% in the 3200 nodes scenario when the nodes have no top-up, which means 8 millions EGLD are staked. However, this is not the case now because there was a great staking demand and 11 millions were staked resulting in a lower APR.

Note: APR can vary from one provider to another as a result of the differences between the service fees the providers have and because of the nodes top-up loading.

Is there any risk in Staking?

The safety of the delegated funds is one of the most frequent questions delegators ask. The delegated funds are inside a Smart Contract at the protocol level and just delegators have access to the Unstake dedicated API. In other words, staking on Elrond Network is non-custodial and the staking provider does not have direct access to delegated funds.

The Proof of Stake systems as Elrond reward the validators for their services as we explained but at the same time it punishes their undesirable behavior (false transactions, forks that are willingly forced through double signing etc.) through a mechanism called Slashing and that is not active yet. Slashing will probably be activated in Phase 4 of bootstrapping (we are currently in Phase 3.5). The Slashing details are not public yet and it is not known how it will impact the delegators in such situations but the best thing one delegator could do is to prevent them by choosing the right providers that have staking and blockchain experience and that have contributed to the Elrond ecosystem.

Note: Slashing will punish just the intentional network attacks.

Why do rewards vary from one day to another?

Seeing many EGLD delegators asking themselves why they did not get rewards daily or why some days they got less than the shown APR we decided to elucidate it. As you know, there are currently 3200 active nodes out of which just 50% participate in consensus during an epoch so just half of them get rewards. In order to increase the Network’s Security, the nodes migrate from one shard to another periodically but in a totally random manner. This mechanism makes the network attack attempts become harder and the chances of an attacker to get a shard’s control are considerably reduced.

The 3200 nodes are distributed equally between the 3 execution shards and Metachain, each shard having 800 nodes. Each epoch, every shard has 400 eligible nodes (validate blocks and produce rewards) and 400 waiting nodes. At the beginning of a new epoch, 80 eligible nodes are picked randomly from a shard and moved on the waiting list of another shard. The waiting time for a node is 400/80 = 5 epochs. This is the reason why APR should be seen as an average on a longer timeframe because the number of eligible nodes can’t be anticipated in advance. The APR shown in the wallet is calculated in ideal conditions as if the pool had 50% eligible nodes constantly and the network 100% hit-rate. In reality, one pool can have more than 50% eligible nodes (the rewards being higher than the APR/365) and the other day less than 50% (rewards being less than the APR/365). Even if rewards vary from one day to another the one year length rewards should correspond to the shown APR.

In order to get an idea of the state of the nodes of one provider/pool in the current epoch you can use the Validators section of the Elrond Explorer. With this method you can calculate the rewards you are to get at the end of the epoch by using the ratio between eligible nodes and the total staked nodes of the pool.

  1. Node → queued 📓

This is a node that is registered with a BLS key and the 2500 required EGLD. This node is waiting in the queue to be staked at protocol level and then received in consensus. In this state neither does this node get rewards nor does it require a Linux physical machine to run something.

2. Node→ waiting 🕔

This node has just become staked (it is a new node coming from the queue) or it is a former eligible node that has been moved on a new shard. Such a node will not take rewards as long as it is waiting, but in maximum 5 epochs it will become eligible again and it will participate in consensus getting rewards (of course if it behaves well — proposes valid blocks, signs in time, etc).

3. Node → eligible ✅

In this state the node is eligible to be chosen as block proposer or as a member of the consensus group. It gets rewards if it behaves well.

4. Node → jailed 🔒

The nodes’ activity is continuously kept under observation by a rating system. If a node does its job well, in time, its rating is increased, otherwise it is decreased and the node is chosen more rarely to be part of the consensus group generating less rewards. When the rating of a node drops under 10 the node becomes jailed and it is no longer eligible for consensus selection (it does not generate rewards anymore). To get out of jail, a node has to do an unjail transaction. If it is jailed for the first time, the node gets on the waiting list (it becomes queued) on the first position and if another slot in among the 3200 becomes available it becomes active again having a chance to be eligible. If the node gets jailed for the second time, after the unjail transaction the node is moved to the last position of the waiting list/queue.

How to stake on Elrond Network?

Staking on Elrond can be done through Maiar, Web Wallet and each Providers’ Delegation Manager.

If you are not accustomed to the steps you need to go through in order to stake on Elrond you can check this article: Elrond: How to stake through DM, Web Wallet and Maiar.

Frequently met terms

  • Validators

The main actors in the Staking mechanism are the Validators. These ones are actually nodes (servers) that run the Elrond software and that together form the Elrond Network. In order to be able to run a node on Elrond blockchain it is necessary to stake 2500 EGLD.

Note: The 2500 EGLD represents the base stake at the time the article was written. Later, in Phase 4 a soft auction system will be implemented. This will allow minimum stake per node to be voted through governance.

  • Staking pool/ Staking Agency/ Staking Provider

For the users that want to become validators but don’t own 2500 EGLD or don’t want to lock that amount of coins there is the alternative option of starting a staking pool. In this case 1250 EGLD is required to create a Delegation Smart Contract (DSC), and the rest until 2500 can be filled by external delegations from other users of the network.

  • Delegators

For those that want to participate in the Network Security process, but don’t have the required amount of EGLD or don’t want to take care of a node’s maintenance, there is an alternative: delegating the coins into a Staking Pool. The delegated coins reach in the pool’s smart contract and are used indirectly by the pool to get the right of “veto” in consensus. The protocol sends back to delegators the rewards proportionally to their delegated amount at the end of each epoch. (~14:30 UTC). The minimum amount that can be delegated is 1 EGLD for Staking Pools and 10 EGLD for Legacy Delegation.

  • Service Fee

Delegators have to pay a fee for the services offered by the providers. The fee is already applied to the shown APR.

Formula: NODE APR — (NODE APR x SERVICE FEE)/100 = DELEGATOR’S APR

Example: 36 — (36–19.45):100=29%

In other words, the provider keeps a percentage of the rewards that are generated by the pool. The Service Fee is one of the parameters that can be changed anytime in the Delegation Smart Contract, each change becoming active in the following epoch (24h).

  • Unbonding

After you Unstake your coins get into an unbonding period which is a 10 days waiting period during which your coins are locked and don’t produce rewards. After the 10 days you can click the Finalize Withdrawal button and your coins will become available again.

  • Delegate Legacy

Legacy Delegation is the delegation on Elrond Foundation’s nodes. It is similar to the delegation on the Staking Pools’ nodes but it has few differences. In order to reach into the Legacy Delegation Pool or as the community calls it, active delegation, one has to go through a waiting list which works on a first come, first served basis. The minimum amount that can be delegated is 10 EGLD. Another difference is that Legacy Delegation Pool does not allow rewards restanking.

  • Top-up

One of the factors that influence the Provider’s APR is nodes’ loading. Elrond allows nodes to have an unlimited amount of EGLD staked over the 2500 EGLD base stake, but the rewards for the base stake are higher than the top-up’s reward in a way that makes running 2 nodes with 2500 EGLD more profitable than 1 node with 5000 EGLD. The smart contracts of the pools make the rewards to be distributed evenly to all the delegators from a pool by using the average.

Note: Starting with Phase 3.5 → Topup Rewards = 14% and Base Rewards = 20%

  • Rewards

As a recompense for staking, both validators and delegators get rewards at the end of each epoch. The rewards are saved in the Smart Contract and the user has two ways of interacting with them: Claim Rewards (the rewards become available) and Restake (the rewards are added back in the staking pool over the current stake) whenever he wishes.

Resources: Elrond, Explorer, Web Wallet, Maiar, Economics Elrond, Whitepaper Elrond, Elrond Warriors

Connect with us

--

--

--

We are a highly motivated, technology focused team with more than 11 years experience in the IT Industry, focusing right now on the growth of the Elrond Network ecosystem and to provide staking services for the most advanced blockchain protocol in the world.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
MGStaking

MGStaking

mgstaking.com - Secure staking for a blockchain world!

More from Medium

A Guide to Decentralized Autonomous Organizations

Tokenized Bitcoins on Ethereum: Part 1

Livepeer’s Pioneering Layer 2 Migration — Confluence — Proceeds to Community Vote

Erica DAO: The Simp Revolution