What are the Proof-of-Stake[PoS] algorithms available which can be configured on substrate-node-template
2 Answers
Just follow this tutorial to add this staking pallet to your runtime template.
For more detail, here you go: npos-elections

- 2,543
- 2
- 17
- 25
-
1The tutorial link is broken – Kofi Nov 07 '22 at 09:27
I think before I can answer concretely, it is important to understand how consensus works in substrate. Let's start by asking:
- Who gets to participate in consensus? --> election algorithms, PoA, PoS, anyone (PoW)
- Who gets to propose a block? --> Aura, BABE, PoW
- Which set of changes are final? --> GRANDPA, longest chain
Here is an overview of the pallets included in substrate you can compose into your node, and here are the pallets you can compose for consensus.
The node template comes packaged with Aura consensus pallet - a Proof of Authority (PoA) block production mechanism with the GRANDPA finality gadget. The template uses the Aura module pallet and the GRANDPA pallet that you see in runtime/src/lib.rs
.
So if you wanted to convert the template from PoA to nPoS, you would need to swap Aura (and possibly GRANDPA) for your use case. As an example, Polkadot uses Nominated Proof of Stake (NPoS) (read more here), with BABE as the block production mechanism and the GRANDPA finality gadget. In addition there are pallets related to staking Polkadot also uses that you may want to use as a reference.
Here is also an example walking through configuring a hybrid Pow/PoS consensus node.

- 1,032
- 7
- 13
-
could you make a tutorial about converting substrate node/parachain template to nPoS ? – Russo Mar 11 '22 at 10:12