Genesis Contract: Staking Contract

Apr 09, 2020

By: Mels Dees

Our previous demos featured the Transfer Contract and Fee Contract. This time we demonstrate the Staking Contract. Together with the Blind-Bid Contract, this contract manages the security deposits of the consensus participants, also referred to as staking.

As for its place in our simplified technical framework, we can see that the Staking Contract resides in the blockchain layer, as a crucial part of our consensus mechanism.

This Technical Framework shows the different layers and components of the Dusk Network. Read more about how it all ties together.

It starts with consensus
In Dusk Network we utilize a novel Proof-of-Stake-based consensus protocol called Segregated Byzantine Agreement (SBA). SBA is a permission-less protocol which is made up of three distinct phases: proposal, ordering and finalization. During the proposal phase Block Generators compete for the right to propose a candidate block, which will be agreed upon and finalized by Provisioners in the subsequent steps.

Block Generators compete for a slot to produce a candidate block through a novel mechanism called Proof-of-Blind Bid (PoBB). Proof-of-Blind Bid is a Private Proof-of-Stake leader extraction mechanism which leverages the power of the state-of-the-art zero-knowledge proof system to allow the participants to compete for the block producer rights without revealing their respective identities or the amounts being staked. This is important to prevent collusion and to further strengthen the security of the network.

Provisioners, on the other hand, compete to participate in committees responsible for selecting a uniform candidate block and finalizing it. In an optimistic scenario, the block is finalized after three committee steps, with a committee size of 64 for each step and an honesty ratio of >3/4. Each DUSK staked is treated as a separate node, meaning that a single consensus participant can be elected more than once during the same step.

Staking Contract functionality
The Staking Contract enables prospective provisioners to lock-up a certain amount of DUSK within predefined bounds to be able to participate in the consensus. The contract is responsible for managing the locked stakes. This includes defining the lock-up time and allowing for the withdrawal of stakes after their expiration. Those stakes are no longer eligible to participate in the consensus, until they are locked up for staking again.

Another contract functionality is the punishment of misbehaving Provisioners. The punishment occurs through a process called slashing, where the stakes of the offenders are confiscated. Slashing is vital for the security of SBA, as it mitigates the possibility of a “nothing-at-stake” attack. In such an attack, the attacker hedges its chances of obtaining a reward by voting for two unique values during the same voting round.

Tech demo
In the demo we see both Provisioner interactions. First we show the staking function, and validate its effect on the token amount in the Provisioner’s wallet. After, we demonstrate the slashing functionality, which comes into effect in case of malicious behaviour.

Tech Demo of the Staking Contract

As for the next iteration of the Staking Contract, a more sophisticated slashing procedure is under construction. Currently, the slashed funds are locked up on the contract, without the possibility to ever retrieve them. The upcoming iteration of the contract will include the mechanism for rewarding the "whistleblower" who had reported the misbehaviour as well as the logic dealing with the slashed funds. The slashed funds can either be burned or made available through block rewards.

Up Next: Bind Bid Contract and PLONK
The Blind Bid Contract is the last one in this series, and will also be starting the showcase of our PLONK implementation. Through the Blind Bid contract we obfuscate the stakes of our Block Generators and make it impossible to predict the identities of the Block Generators, adding to the security of the Dusk Network protocol.

A heads up for our upcoming PLONK demos, they will be a bit more challenging in terms of content because we need to dive into mathematical equations when we show the zero-knowledge proof system.

Share this post

Subscribe to our newsletter

Dusk on GitHub Download Whitepaper