Staking
The Subspace Network relies on staking from both domain operators and farmers to secure the network and provide resources. Subspace implements a Nominated Proof-of-Stake algorithm where farmers endorse operators who execute transactions and produce blocks.
Our staking model consists of two tiers:
- Operators stake to gain the right to execute transactions within a domain and produce blocks. They are responsible for validating and executing transactions, producing execution receipts, applying state transitions and earn rewards for their work. The operator's chances to be elected as a slot leader are weighted by stake. Operators can be nominated by farmers and currently each operator can have up to 256 nominators.
- Farmers earn rewards proportional to their pledged storage. Farmers can nominate operators and back them with their tokens, increasing their stake and chance of being elected as slot leaders.
Generally speaking, any SSC token holder can stake their tokens by nominating a domain operator, without having to become an operator or farmer themselves.
NPoS allows for virtually all SSC holders to participate, thus maintaining high levels of security by putting more value at stake and allowing more people to earn a yield based on their holdings.
Nomination Pools
Operators must stake an amount higher than this domain's minimum stake for a right to participate in the execution and earn execution fees. An operator's chances to become a slot leader are directly proportional to the percentage of their stake against the total amount staked by all operators of this domain. As such, operators are incentivized to recruit nominators to increase their stake. This means that each domain operator stake acts essentially as a pool for nominators. When registering as an operator, each operator specifies their minimum nominator stake and nomination tax of their pool. The nomination tax is a percentage that the operator collects on all fees earned by executing blocks, before they are shared with nominators, a commission for the operator's work. The tax amount is automatically restaked as part of the operator's stake.
Any SSC token holder who has more than the minimum nominator stake (currently 1 SSC) may choose to join this operator’s pool by submitting the nomination extrinsic with the deposit amount of SSC they wish to stake.
-
The amount of deposited SSC is added to the list of pending deposits within the operator's pool.
-
At the end of an epoch (currently 100 blocks, ~ 10 minutes), the nominator's deposit is processed.
-
A part of the deposit is taken as a reserve towards a storage fee fund. This reserve is calculated as a percentage of the deposit (currently, 20%), and is used to pay for the storage fees of bundles created by the operator of the pool and does not affect the stake distribution. The reserved amount is transferred to the operator's storage fee fund, while the rest of the deposit remains locked in the nominator's account. This amount is partially refunded with each withdrawal.
-
The nominator is awarded their shares in the pool. The stake shares are the percentage of the total stake that is allocated to each nominator. The stake shares are used to calculate the share of the operator's fees that the nominator is entitled to based on the amount they have staked and for how long. The stake shares are calculated as follows:
- Compute the operator’s pool end-of-epoch as the total number of shares divided by the sum of all stake in the pool and fees collected during the previous epoch
.
- Assign the to this nominator based on the of the pool
.
- The is added to of the operator's pool and domain’s total stake.
- The of this nominator are added to of the operator's pool.
The nomination pools in Subspace are "lazy": any fees earned by the operator are assigned to the pool and are not deposited to the nominators wallet unless they ask for a withdrawal. Unless withdrawn, the fees are "auto-staked" - they count towards the total stake of the pool, increasing its chance of being elected to produce bundles.
When the nominator decides to withdraw their stake or fees, they submit a withdraw extrinsic. The withdraw extrinsic is processed at the end of the epoch and the stake is removed from the operator's pool and the domain's total stake. The nominator is then entitled to the fees percentage based on the stake shares and the amount of time they have staked.
Operators can also withdraw their stake and fees at any time by submitting a withdraw_stake
extrinsic. Operators who wish to withdraw all of their stake and earned fees have to submit a deregistration extrinsic, as it is forbidden to withdraw below the domain's minimum stake requirements. The deregistered operator will be removed from the domain and their stake and the stakes of all nominators will be returned to their accounts.
Unlocking Funds
Withdrawals have a lock period of 2 days (currently 28 800 blocks, ~ 48 hours). After the locking period, the withdrawn amount can be unlocked in the user's account with the unlock_funds
extrinsic. All withdrawals requested in the same stake epoch are aggregated together and the total amount is unlocked at once. This locking period is necessary to ensure that the domain block executing the withdrawal is confirmed and not challenged by a fraud proof in order to increase the economic stability of domains.
Example
Operator has staked SSC and registered as an operator with minimum nominator stake of SSC and nomination tax of . The required storage fee reserve deposit is . Operator has 2 nominators and each staked SSC. Initially , so gets 80 shares, and and each get 40 shares and in the stake.
Each deposit transfers towards a storage fee fund: reserves SSC, and reserve 10 each, with total of SSC reserved.
The staking summary will look like this:
Nominator | |||
---|---|---|---|
Shares | 80 | 40 | 40 |
Storage fee deposit | 20 | 10 | 10 |
Total stake | Total shares | Total storage fee deposits | Storage fee fund |
---|---|---|---|
160 SSC | 160 | 40 SSC | 40 SSC |
In the next epoch, the pool has earned SSC of compute fees and refunded an extra SSC of storage fees. The operator took of compute fees as a commission ( SSC) automatically restaked for 1 share and SSC deposited to storage fee fund. The pool stake is now SSC and storage reserve is now SSC. The pool end-of-epoch is now . Notice that SSC of storage fees refunded do not count into calculation, which allows us to sustain stable stake distribution despite the fluctuating size of the storage fee fund.
If a new nominator stakes 33.6 SSC, 6.72 SSC will be transferred to the storage fee fund, and the will get is . The pool total stake becomes SSC, total shares and storage fee reserve SSC.
At the end of the epoch, the updated staking summary for the next epoch will look like this:
Nominator |
---|