1. Introduction

Proof of Stake (PoS) is a way to protect a blockchain network where nodes lock up a specific amount of cryptocurrency for a certain period of time.

A network participant temporarily gives up their coins as a commitment to truthfully participate in securing the network. Their participation is incentivized by rewarding them with new tokens.

In this tutorial, we’ll see how staking takes place in blockchain networks.

2. How to Stake a Cryptocurrency?

We can stake crypto in two possible ways: by becoming a validator or by delegation.

As validators, we can run a node. This usually comes with some constraints, such as being able to stake a minimum acceptable amount, meeting the availability requirements for the host machine, and also maintaining it. Most retail users aren’t able to meet these financial or technical requirements and hence opt to instead delegate their stake to a given validator.

As delegators, we can stake any amount from a wallet to a pool without worrying about technical or financial constraints. This method of participating in network security is also known as Delegated PoS.

Note that the processes described above are decentralized and governed by a smart contract. However, different centralized exchanges also offer staking services. These exchanges have their own policies for staking, and we can individually check their websites for more information about this.

3. How Does Staking Work?

In this section, we’ll explore the technology behind staking. To try out these concepts, we can begin by doing so from a centralized crypto exchange. The process is rather straightforward for most of these exchanges. We buy some coins for a given cryptocurrency and then choose the lock duration for the asset.

We could also decide to use to delegate our coins to a decentralized pool. However, this requires some research on our part on which pool to choose. For Ethereum staking, we can begin with this documentation from their page.  

Now, let’s look at the building blocks of staking.

3.1. Lock Duration

This is the key since it directly affects the rewards we can get. We can divide this into two: flexible and fixed. Flexible Staking allows us to unstake the crypto at any time. On the other hand, with a fixed duration, we can only withdraw the coins after a particular number of days, weeks, or months.

We lock the coins in a smart contract until a certain block is mined. During this period, we can not use the staked asset.

When the lock duration ends, we can claim the reward for our participation. If we staked a fixed amount, we’d get higher rewards than the flexible method.

3.2. Staking Mechanism

As mentioned earlier, we can either stake our coins as individuals or by delegating them. When we delegate our tokens, we are essentially adding them to a pool of other coins.

A pool is owned by a node operator. A user who assigns funds to the pool is called an owner. It is important to note that only the owner can unlock the funds, extend the staking period or even choose another validator. Hence, the smart contract always securely protects a delegator’s funds.

3.3. Penalties

If a network participant behaves in a malicious manner, they can have part of their staking rewards reduced by the contract. This is known as “slashing.”  However, some staking protocols directly slash the staked amount. The network’s protocol normally burns the slashed amount.

Malicious behavior ideally means verifying fraudulent transactions. However, breaking other protocol rules can be a  cause for slashing. For example, using the same address twice to propose a new block can be perceived as an attack on the security of the network.

On top of slashing, the network can also punish the bad actors by locking the time for which the wallet address can withdraw.

Validators who report violations of protocol rules that are considered a security threat to the network are rewarded. This incentive is automatic in the smart contract, as is the type of security incidents that can be reported.

3.4. How Is a Validator Chosen?

The smart contract randomly chooses a set of validators to verify transactions within a given period, known as an epoch. The probability of being chosen is directly proportional to the amount staked.

Participant nodes can not add or remove their staked assets during an epoch. After an epoch, the participant nodes are still unable to unlock their coins for a given time. This is to allow for slashing just in case some nodes violated protocol rules.

The staking rewards are proportional to the percentage in the network.

4. Uses of Staking

4.1. Voting

Staking is not only useful for validating transactions on the network. The project community can also use it to vote on various proposals, ranging from protocol updates to how treasury funds are distributed.

The amount a participant stakes during the voting period is proportional to their voting power.

4.2. Managing a DAO

A Decentralized Autonomous Organization (DAO), as the name suggests, is an organization that is managed by a decentralized group of individuals who get to choose which direction the entity takes. Anyone can participate in this process.

There are different models of DAO governance. However, they all have in common that members have their say by staking coins.

5. Benefits of Proof of Stake

First, we’ll give a brief description of another consensus mechanism called Proof of Work. In PoW, validator nodes secure the network by repeatedly checking for a hash that is less than a target value. The node which gets it first earns the right to add the block record to the blockchain and also to receive the associated reward.

It is not possible to talk about the benefits of PoS without talking about Proof of Work since it was introduced to solve the problems with PoW.

5.1. Faster Consensus

Proof of Stake was primarily introduced to fix the issue of slow consensus that was associated with Proof of Work algorithms. Since only a selection of nodes is allowed to validate transactions during a given epoch, this creates less competition and hence less network congestion. This, therefore, increases the time for a consensus.

Before Ethereum 2.0 (which used PoW), the network used to process about 15 transactions per second (TPS). At the time of this writing, with Ethereum 2.0 ( which uses PoS), the network can process up to 100,000 TPS.

This shows how significant the processing speed is with PoS compared to PoW.

5.2. Less Gas

Due to less congestion in the network and faster processing times, network users can pay minimum transaction costs (gas).

Before Ethereum 2.0, average transaction costs could sometimes soar even past $100. For a retail user, this is in no way practical. As of this writing, the cost average is below $5.

These high costs are actually what prompted the emergence of blockchains like Solana and Polygon. These blockchains offer gas costs that are just a few cents.

5.3. Less Energy Wasted

With a PoW network like Bitcoin, nodes compete to earn the right to add a block to the blockchain. They compete using their computing power, and the probability of mining a new block is directly proportional to the mining power.

However, with PoS, only the selected nodes get to participate in securing the network in a given epoch. This prevents the waste of energy.

This process of PoW requires significantly more energy than using PoS. One study showed that Ethereum’s PoS consumes less than 1% of the energy that PoW used to consume.

5.4. Setup Costs

Mining equipment is very costly. Most PoW algorithms, such as those used by Bitcoin, need specialized hardware (ASIC miners) that come at a hefty cost.

As of this writing, the cost of a quality Bitcoin miner ranges from  $2,000 to $3,500. However, if we’re using PoS, a VPS that costs about $25 a month should be sufficient (depending on the blockchain network).

6. Conclusion

In this tutorial, we learned how staking is used in blockchain networks. In order to try out some of the concepts here, we can start with a test network for our chosen blockchain.


« 上一篇: 事件驱动架构