stake and weight
Why weight is deposited units rather than wallet balance, when a deposit starts counting, and when it can leave.
weight is custody
A miner's weight in a round is exactly the number of units of that token they have deposited into its stake vault and which are active. There is no starting weight, no bonus for being a new wallet and no credit for units sitting in your wallet. A miner with zero active stake cannot submit at all. §5.4
Two simpler-looking designs were tried and discarded. A positive base weight per wallet lets one holder multiply their weight by generating more wallets, which costs nothing. A snapshot of wallet balances counts transferable units, which can be walked through a series of prepared wallets and counted more than once. Custody is what makes a unit count once. §4.1
deposits activate next round
A deposit is credited to you the moment it lands, but it is pending until the following round begins. Only then does it become active stake that can weight a proof.
The delay is not a cooldown for its own sake. Without it, a single transaction could borrow units, deposit them, mine with them, withdraw them and repay the loan, which would let borrowed liquidity claim rounds it never held risk in. §4.2
- on deposit
- pending_stake += amount
- activation round
- current round + 1
- weight at submission
- active_stake only
when stake can leave
Stake is withdrawable whenever you are not carrying unsettled round weight. If you submitted a proof in a round that has not yet settled, the whole position is locked until it does, including the part that was not counted. §4.3
A partial rule would be more convenient and would also be a hole: principal could move to a second wallet while it is still sitting in the first wallet's numerator for a round that has not paid out. In practice the lock lasts until the next round begins and your share is settled, which is one round length.
Withdrawal returns principal from the stake vault. It is a different instruction from claim, which moves rewards from the emission vault. The two vaults are separate accounts, so claiming can never eat into anyone's deposited principal.
sending tokens directly does nothing
The stake vault is a normal token account and anyone can transfer into it. Doing so raises the vault balance and raises nobody's weight. Only the deposit instruction increases the recorded total or any miner's credited principal. §4.6
The invariant this protects is that the sum of everyone's credited stake equals the recorded total, which is never greater than what the vault actually holds. A donation moves the balance further above the liabilities, never below.
this page expands
- 4.1Weight is program-custodied stake, and base weight is zero
- 4.2A deposit activates in the following round
- 4.3Stake that weighted an unsettled round cannot be withdrawn
- 4.6Direct transfers into a stake vault are uncredited donations
The paper is the authority. Where this page and §4.1 disagree, the paper is right and this page is a bug.