Skip to main content

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.

NominationNomination

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.

  1. The amount of deposited SSC is added to the list of pending deposits within the operator's pool.

  2. At the end of an epoch (currently 100 blocks, ~ 10 minutes), the nominator's deposit is processed.

  3. 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.

  4. 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:

    1. Compute the operator’s pool end-of-epoch shares_per_ssc\text{shares\_per\_ssc} as the total number of shares divided by the sum of all stake in the pool and fees collected during the previous epoch

    shares_per_ssc=total_shares/(pool_total_stake+fees(1nomination_tax))\text{shares\_per\_ssc} = \text{total\_shares} / (\text{pool\_total\_stake} + \text{fees}*(1-\text{nomination\_tax})).

    1. Assign the shares\text{shares} to this nominator based on the shares_per_ssc\text{shares\_per\_ssc} of the pool

    shares=deposit_amountshares_per_ssc\text{shares} = \text{deposit\_amount} * \text{shares\_per\_ssc}.

    1. The deposit_amount\text{deposit\_amount} is added to pool_total_stake\text{pool\_total\_stake} of the operator's pool and domain’s total stake.
    2. The shares\text{shares} of this nominator are added to total_shares\text{total\_shares} 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.

Nomination_PoolNomination_Pool

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 OO has staked 100100 SSC and registered as an operator with minimum nominator stake of 1010 SSC and nomination tax of 5%5\%. The required storage fee reserve deposit is 20%20\%. Operator OO has 2 nominators N1N_1 and N2N_2 each staked 5050 SSC. Initially shares_per_ssc=1\text{shares\_per\_ssc} = 1, so OO gets 80 shares, and N1N_1 and N2N_2 each get 40 shares and total_shares=80+40+40=160\text{total\_shares}=80+40+40=160 in the stake.
Each deposit transfers 20%20\% towards a storage fee fund: OO reserves 2020 SSC, N1N_1 and N2N_2 reserve 10 each, with total of 4040 SSC reserved.

The staking summary will look like this:

NominatorOON1N_1N2N_2
Shares804040
Storage fee deposit201010
Total stakeTotal sharesTotal storage fee depositsStorage fee fund
160 SSC16040 SSC40 SSC

In the next epoch, the pool has earned 2020 SSC of compute fees and refunded an extra 44 SSC of storage fees. The operator took 5%5\% of compute fees as a commission (11 SSC) automatically restaked for 1 share and 0.050.05 SSC deposited to storage fee fund. The pool stake is now 160+20+1=181160+20 +1 =181 SSC and storage reserve is now 40+4=4440+4=44 SSC. The pool end-of-epoch shares_per_ssc\text{shares\_per\_ssc} is now 160/(160+20(10.05))=0.893855160/(160 + 20 * (1-0.05)) = 0.893855. Notice that 44 SSC of storage fees refunded do not count into shares_per_ssc\text{shares\_per\_ssc} calculation, which allows us to sustain stable stake distribution despite the fluctuating size of the storage fee fund.

If a new nominator N3N_3 stakes 33.6 SSC, 6.72 SSC will be transferred to the storage fee fund, and the shares\text{shares} N3N_3 will get is ((33.66.72)0.893855)=24((33.6-6.72) * 0.893855) = 24. The pool total stake becomes 181+26.88=207.88181+26.88=207.88 SSC, total shares 160+24+1=185160+24+1=185 and storage fee reserve 50.7250.72 SSC.

At the end of the epoch, the updated staking summary for the next epoch will look like this:

NominatorOON1N_1N2N_2N3N_3
Shares81404024
Storage fee deposit20.0510106.72
Total stakeTotal sharesTotal storage fee depositsStorage fee fund
207.88 SSC18546.72 SSC50.72 SSC

Suppose after some time shares_per_ssc\text{shares\_per\_ssc} value of this pool becomes 0.80.8 and the storage fee fund balance is 5252 SSC. Suppose N1N_1 wants to "sell" withdraw_shares=20\text{withdraw\_shares}=20 shares. At the end of the epoch, the 20 shares will be unstaked, and the corresponding amount of 20/0.8=2520/0.8=25 SSC will be deducted from the pool's total stake. The total amount of credits N1N_1 will get is withdraw_sharesshares_per_ssc+storage_fee_fund_balancestorage_fee_deposittotal_storage_fee_depositswithdraw_sharesshares=25+521046.722040=30.57\frac{\text{withdraw\_shares}}{\text{shares\_per\_ssc}}+\text{storage\_fee\_fund\_balance}*\frac{\text{storage\_fee\_deposit}}{\text{total\_storage\_fee\_deposits}}*\frac{\text{withdraw\_shares}}{\text{shares}}=25 + 52*\frac{10}{46.72}*\frac{20}{40}=30.57 SSC.

If N1N_1 wanted to withdraw all their stake and fees, that is sell all their withdraw_shares=40\text{withdraw\_shares}=40 shares, they would get 400.8+521046.724040=61.13\frac{40}{0.8}+52*\frac{10}{46.72}*\frac{40}{40}=61.13 SSC, earning 11.1311.13 SSC in fees. After waiting the locking period, the withdrawn amount can be unlocked in their account.

The example is intended for illustration, the actual calculation is performed with shannons (1 SSC=1018 shannons1\ \text{SSC} = 10^{18}\ \text{shannons}).

Staking Epochs

Staking epoch is a period of time during which staking distribution remains the same. This period is currently set to 100 blocks, or roughly 10 minutes. The end of each epoch triggers a series of events to transition to the next epoch. These events include:

  • allocation of fees earned for the blocks confirmed during the epoch,
  • deposits and withdrawals of stake,
  • operator registrations and deregistrations,
  • recalculation of stake distribution for the slot leader election.

Because of this, new operators must wait for the end of the current epoch to register as an operator, new nominators must wait for the end of the current epoch to nominate, and new stake deposits and withdrawals must wait for the end of the current epoch to be processed. As soon as the end of the epoch transition is finalized, the next epoch begins.

Power Balance

Token holders and farmers who have earned storage rewards can nominate operators to execute transactions. This system balances the power between nominating farmers (or holders) and operators, and both parties share the fees and the potential penalties (slashing). Nominated operators get a higher chance to produce blocks proportional to the amount of stake backing them, thus, higher revenues. Farmers and holders have the power to nominate operators they trust to execute transactions properly. On the other hand, operators compete to be nominated by providing good service, maintaining a good reputation within the community, and having reasonable commission. Nominators also retain the power to withdraw their nominations at any time, ensuring operators remain accountable.

This two-tiered structure provides robust security guarantees. By enabling the consolidation of vast quantities of stake — far exceeding the SSC holdings of any individual party — it creates significant barriers for malicious actors trying to elect dishonest operators. Gaining the necessary backing requires building a considerable reputation, making it challenging for adversaries. Additionally, attacking the system would be prohibitively expensive, leading to large amounts of stake slashed. We anticipate that a substantial portion of the SSC supply will be staked in the NPoS system at any time.