Proof of Transfer (PoX)
By @stacks-core
The deployed contract is SP000000000000000000002Q6VF78.pox-5. The line links below point at the source pinned at release tag 4.0.4.
Contract summary
pox-5 runs Bitcoin Staking:
STX-only staking. A staker locks STX to a signer-manager contract for 1 to 96 reward cycles.
Protocol bonds. A 12-cycle position pairing locked STX with either a Bitcoin L1 timelock, proven to the contract with a Merkle proof, or sBTC held by the contract.
Signer registration. A signer-manager contract registers itself with a signer key whose holder has granted it that key.
Rewards. The contract calculates sBTC rewards once per distribution and pays them to signer-managers, which settle with their stakers.
Where a staker's rewards go is set by their signer-manager, passed as signer-calldata.
Public functions
Staking
stake-update
Staker
Changes signer-manager, extends the lock, increases the amount, or any combination.
Protocol bonds
register-for-bond
Allowlisted staker
Joins a bond with STX plus either L1 lockup proofs or sBTC. Must land before the bond starts.
update-bond-registration
Bond participant
Moves an active bond to a different signer-manager.
announce-l1-early-exit
The staker, directly
Ends an L1 bond's reward share early. The STX stays locked until the bond ends.
Rewards
calculate-rewards
Anyone
Computes the latest distribution across active bonds and STX-only staking. Every active bond must be listed.
claim-rewards
Signer-manager
Transfers the signer's accumulated sBTC for a reward cycle and the listed bonds.
claim-staker-rewards-for-signer
Signer-manager
Settles one staker's rewards in the manager's accounting. Transfers nothing.
Signers
grant-signer-key
Signer-manager
Records a one-time grant, signed by the key holder, letting the manager use a signer key.
revoke-signer-grant
The signer key's principal
Revokes a grant. The manager can take no new stake, and existing positions wind down.
Administration
setup-bond, set-bond-admin, set-pause-admin and pause-rewards are called by the bond and pause admins, and set-burnchain-parameters runs once at boot. Integrators do not call them.
Where to go next
Bitcoin Staking for the concepts.
Stake to an Existing Signer-Manager and Ending or Changing a Bond Position for the flows.
Deploy a Signer Manager Contract for the other side of the
signer-managertrait.
Coming from PoX-4
This table maps each PoX-4 call to its PoX-5 equivalent, for apps and contracts written against .pox-4.
stack-stx
stake, to a signer-manager. Solo staking means staking to one you run.
delegate-stx, delegate-stack-stx
stake, to the pool's signer-manager. There is no delegation step.
stack-extend, stack-increase, delegate-stack-extend, delegate-stack-increase
stake-update, in one call.
revoke-delegate-stx
unstake, the closest equivalent.
stack-aggregation-commit, stack-aggregation-commit-indexed, stack-aggregation-increase
None. The signer-manager calls register-signer once.
set-signer-key-authorization
grant-signer-key, the closest equivalent.
allow-contract-caller, disallow-contract-caller
None. See below.
get-stacker-info
get-staker-info, or get-bond-membership for a bond.
No contract-caller allowance. PoX-4 let a contract stack for a user only after the user called allow-contract-caller (pox-4.clar L587-L588). PoX-5 has no such check. stake, stake-update, unstake, register-for-bond, update-bond-registration and unstake-sbtc act on tx-sender, so any contract a user calls can change that user's position. Guard those calls with staking and PoX post-conditions.
These functions do restrict the caller:
announce-l1-early-exitmust be called by the staker directly (L1219-L1222).
Last updated
Was this helpful?