Staking
An overview of staking on the Autonomys Network
Last updated
Was this helpful?
An overview of staking on the Autonomys Network
Last updated
Was this helpful?
The Autonomys Network relies on staking from both domain operators and nominators (who are mostly farmers) to secure the network. Under Autonomys' Nominated Proof-of-Stake (NPoS) algorithm, nominators endorse operators who execute transactions and produce blocks, with operator stakes acting as nomination pools. NPoS allows all $AI3 token holders with the required minimum stake (MinStake) to participate in staking and earn a yield on their holdings, maintaining high levels of network security by increasing total value locked (TVL). A significant portion of the total $AI3 supply is likely to be staked in the NPoS system at any one time.
Autonomys uses a two-tier staking model:
Operators stake an $AI3 MinStake to join a domain (set by the domain creator), earning the right to produce blocks and $AI3 rewards (execution fees) in exchange for validating and executing transactions, producing execution receipts, and applying state transitions. Operators set a nominator MinStake and nomination tax for their pool when they register. The nomination tax is the operator's share of the execution fees, and is automatically re-staked. Operator slot leader elections to determine block production are stake-weighted for each domain.
Nominators stake an $AI3 MinStake to operators (increasing their stake and chance of success in slot leader elections) and earn a share of their fees. An unlimited number of nominators can stake to an operator's nomination pool. Nominators are often farmers earning $AI3 rewards for pledging storage, but any $AI3 token holder can nominate.
This system balances power between nominators/farmers and operators, with both parties sharing the operator fees and potential penalties (via slashing). As nominators can easily stake and un-stake at any time, operators are incentivized to recruit and compete for nominators by cultivating a trusted community reputation, providing good service, and offering a reasonable nomination tax, ensuring they remain accountable.
Autonomys' two-tier staking structure also provides robust security guarantees by consolidating quantities of stake far exceeding the size of any one $AI3 holding, creating significant barriers for bad actors attempting to elect dishonest operators. Attacking the system would be both prohibitively expensive (as large amounts of stake would be slashed) and require considerable community trust (to attain the necessary stake), making it highly challenging for adversaries.
A staking epoch is a period of time during which staking distribution remains the same. This period is currently set to 100 blocks (~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 de-registrations
recalculation of stake distribution for the slot leader election
New operators must therefore wait for the end of the current epoch to register; new nominators must wait to nominate; and new stake deposits and withdrawals must wait to be processed. As soon as the end of the epoch transition is finalized, the next epoch begins.
Any $AI3 token holder with the required nominator MinStake can join an operator's nomination pool by submitting a nomination transaction with their desired $AI3 stake deposit. The workflow is then as follows:
The nominator's $AI3 deposit is added to the list of pending deposits in the nomination pool.
At the end of the epoch, the nominator's deposit is processed.
20% of each nominator's deposit is reserved in the operator's storage fee fund to pay for bundles the operator creates. This does not affect the stake distribution and is proportionally refunded with each withdrawal. The remaining 80% is locked in the nominator's wallet.
The nominator's share of the total pool is calculated based on their deposit as a percentage of the total stake and their length of time staked. This is used to calculate the nominator's share of the operator's execution fees as follows:
Compute the nomination 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 the nominator based on the of the pool:
Add the to the of the nomination pool and the domain’s total stake
Add the of the nominator to the of the nomination pool
Autonomys nomination pools are 'lazy'—any execution fees earned by operators are automatically re-staked to the pool, and not deposited to nominator wallets until a withdrawal request is submitted. This increases the pool's total stake and the operator's chance of producing blocks. Nominator withdrawal requests are processed at the end of the epoch, at which point the nominator's stake is removed from the pool and the domain's total stake, and they receive their share of the fees.
Operators can also withdraw their stake and fees at any time by submitting a withdraw_stake
extrinsic. To withdraw their entire stake and earned fees, an operator must deregister (as they would no longer satisfy the domain's MinStake requirements). Deregistered operators are removed from the domain, and their stake, as well as the stakes of all their nominators, are returned to their wallets.
Withdrawals currently have a locking period of 14,400 domain blocks (~1 day), after which withdrawn tokens are unlocked in users' wallets. 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, increasing the economic stability of domains.
Operator has registered an operator with a nominator MinStake of 10 $AI3 and nomination tax of 5%, and staked 100 $AI3. Operator has 2 nominators and , each staking 50 $AI3. Initially, , so receives 80 shares, and each receive 40 shares, and in the stake. 20% of each deposit is reserved in a storage fee fund: reserves 20 $AI3, and and reserve 10 $AI3 each, for a total fund of 40 $AI3:
Shares
80
40
40
Storage fee deposit
20 $AI3
10 $AI3
10 $AI3
160 $AI3
160
40 $AI3
40 $AI3
In the next epoch, the pool earns 20 $AI3 in execution fees and is refunded an extra 4 $AI3 in storage fees. The operator takes a 5% nomination tax (1 $AI3) on the execution fees, which is automatically re-staked for 1 share, and of which 0.05 $AI3 is deposited to the storage fee fund. The pool stake is now $AI3; the storage reserve is now $AI3; and the pool end-of-epoch is now . The refunded 4 $AI3 in storage fees is not calculated as part of , maintaining a stable stake distribution despite the fluctuating size of the storage fee fund.
A new nominator stakes 33.6 $AI3. 6.72 $AI3 is transferred to the storage fee fund, and receives shares. The total pool stake becomes $AI3; the storage fee reserve becomes 50.72 $AI3; and the total shares becomes .
The updated staking summary at the end of the epoch:
Shares
81
40
40
24
Storage fee deposit
20.05 $AI3
10 $AI3
10 $AI3
6.72 $AI3
207.88 $AI3
185
46.72 $AI3
50.72 $AI3
Suppose that after some time, wants to withdraw 20 shares; in the pool is 0.8; and the storage fee fund balance is 52 $AI3. At the end of the epoch, the 20 shares are un-staked, and the corresponding amount of $AI3 () is deducted from the pool's total stake. The total amount of $AI3 receives is:
If wanted to withdraw all their stake and fees (40 shares), they would receive: , earning 11.13 $AI3 in fees. After waiting the locking period, the withdrawn amount is unlocked in their wallet.
Note: This example is intended for illustration. The actual calculations are performed with shannons shannons).