Stacking
Introduction
Stacking rewards Stacks (STX) token holders with bitcoin for providing a valuable service to the network by locking up their tokens for a certain time and participating as consensus-critical signers. If you aren't familiar with the concept of signers in Stacks, be sure to check out the Stackers and Signing section.
This document is presented as a conceptual overview of stacking and how it works. You can also view the stacking guides to get a practical guide on the different ways you can stack and how to do it and a deep dive into the contract.
Stacking vs Staking
While stacking on the Stacks network can be conceptually similar to staking, Stacks is not a PoS network and there are a couple key differences.
There are two primary differences between stacking in Stacks and staking in PoS networks.
Yield generated in burnchain token
In staking, users lock one token and earn their yield in the same token. In stacking, users lock one token (STX) and earn a yield in the "burnchain" token (BTC), rather than the same token that was locked. In PoX, the yield comes from a finite, external source (Bitcoin deposits from Stacks miners). In PoS, the yield comes from the currency's issuance schedule itself, which means it is programmatically unlimited (but theoretically limited, we'll get into this a bit more below).
That's the first main difference. Staking involves a yield of the same token being generated by the issuance mechanism set by the core protocol, where stacking yield requires an input of an external, separate token.
How are these issuance rates set? In Ethereum, issuance rates are determined by network usage. Ethereum's goal is to create a deflationary money supply, so the issuance rate is determined depending on the usage of the network. In order for an Ethereum transaction to be considered valid, it must include a base fee that is burned during transaction execution. The issuance rate is algorithmically determined block-by-block depending on how much ETH is being burned by these base fees plus normal gas fees.
Stacking doesn't have any of this complex functionality, since it does not generate a yield of the same token (and therefore doesn't need to issue new tokens, but rather transfer existing tokens from the base network) and it does not need to maintain an issuance rate. We are speaking here of the yield specifically, Stacks does have an issuance rate and does generate new STX tokens, but this process is completely separate from stacking and the yield generated from it.
The Bitcoin yield that stackers earn is determined by a combination of the Bitcoin being committed by miners and the number of STX tokens that are locked up in the network.
No slashing
Although stackers do fulfill a consensus critical role in Stacks by serving as signers, there is no concept of slashing in PoX (Proof of Transfer).
Rather, if stackers do not perform their duties as signers, they simply cannot unlock their STX tokens and will not receive their BTC rewards.
Stacking is a built-in action, required by the "proof-of-transfer" (PoX) mechanism. The PoX mechanism is executed by every miner on the Stacks network.
Stacking functionality is implemented as a smart contract, using Clarity. Read more about the contract.
Locking and Unlocking STX
One important thing to keep in mind is that when we speak of STX tokens being "locked", no transfer of STX tokens is occuring. Locking STX tokens is non-custodial, and STX tokens remain in your wallet. When you initiate a stacking transaction (described below) those tokens are locked and unspendable at the protocol level, but they do not leave the stacker's wallet.
At the end of the lock period, they will be automatically unlocked (spendable at the protocol level) but this occurs implicitly, there is no direct transaction that unlocks them.
Stacking flow
The Stacking mechanism can be presented as a flow of actions:
Make API calls to get details about the upcoming reward cycle
For a specific Stacks account, confirm eligibility
Confirm the BTC reward address and the lockup duration
The transaction is broadcasted and the STX tokens are locked. This needs to happen before the prepare phase of the next reward cycle, the last 100 Bitcoin blocks of the ongoing reward phase
The Stacking mechanism executes reward cycles and sends out rewards to the set BTC reward address
During the lockup period, details about unlocking timing, rewards and more can be obtained
Once the lockup period is passed, the tokens are released and accessible again
Display reward history, including details like earnings for previous reward cycles
Keep in mind that the target duration for a reward cycles is ~2 weeks. This duration is based on the target block time of the Bitcoin network (10 minutes) and can be higher at times due to confirmation time variances of the bitcoin network.
Stacking delegation flow
There are two main ways you can stack:
Solo stacking
Delegated stacking
Solo stacking follows the flow outlined above, and is where stack your own STX tokens and run your own signer. In order to operate as a solo stacker, you need to have a minimum amount of STX tokens. This minimum is dynamic and can be found by viewing the pox endpoint of the API in the min_threshold_ustx
field.
The Stacking flow is different for delegation use cases:
Before Stacking can be initiated for a token holder, the delegator needs to be granted permission to Stack on behalf of the account owner. The permission is restricted to the maximum amount the delegator is allowed to Stack. The maximum amount is not limited by the available funds and can be set much higher. An account can only be associated with one single delegator
The account has to define the delegation relationship. They can optionally restrict the Bitcoin reward address that must be used for payouts, and the expiration burn block height for the permission, thus limiting the time a delegator has permission to Stack
Delegators have to lock Stacks from different accounts ("pooling phase") until they reach the minimum amount of Stacks required to participate in Stacking
Once a delegator locks enough STX tokens, they can finalize and commit their participation in the next reward cycle
Certain delegation relationships may allow the STX holder to receive the payout directly from the miner (step 5/6)
The termination of the delegation relationship can either happen automatically based on set expiration rules or by actively revoking delegation rights
Token holder eligibility
Stacks (STX) token holders don't automatically receive stacking rewards. Instead, they must:
Commit to participation before a reward cycle begins
Commit the minimum amount of STX tokens to secure a reward slot, or pool with others to reach the minimum
Lock up STX tokens for a specified period
Provide a supported Bitcoin address to receive rewards
Maintain their signer software (if they are operating a signer)
The following diagram describes how the minimum STX tokens per slot is determined.
Token holders have a variety of providers and tools to support their participation in Stacking. The Stacks website contains a list of pools and stacking options.
Stacking in the PoX consensus algorithm
Stacking is a built-in capability of PoX and occurs through a set of actions on the Stacks blockchain. The full proof-of-transfer implementation details are in SIP-007. Below is a summary of the most relevant actions of the algorithm.
Note that SIP-007 describes stacking before Nakamoto. While much of the functionality remains the same, stackers now have the additional responsibility of operating as signers as outlined in SIP-021.
Stacking happens in reward cycles of 2100 Bitcoin blocks (roughly two weeks. Reward cycles are split up into two phases: the prepare phase and the reward phase.
The prepare phase lasts 100 Bitcoin blocks and is where the new stackers for the upcoming reward phase are selected by the PoX anchor block (see SIP-007 for details).
Because Stacks does not fork after the Nakamoto upgrade, the PoX anchor block is always known 100 Bitcoin blocks before the start of the next reward cycle. It is the last tenure-start block that precedes prepare phase.
The PoX anchor block identifies the next Stackers. They have 100 Bitcoin blocks to prepare for signing Stacks blocks. Within this amount of time, the new Stackers would complete a Distributed Key Generation round for signing blocks. The PoX contract will require Stackers to register their block-signing keys when they stack or delegate-stack STX, so the entire network knows enough information to validate their signatures on blocks.
This process is handled by running a signer and then subsequently conducting stacking operations as that signer.
Stacking and Signing
Stacking and signing are two distinct actions, but they are both necessary in order to perform the other. Signers must stack their STX tokens, and you cannot stack STX without running a signer. However, there is some nuance here depending on whether you are solo stacking or delegating.
There are several possible scenarios that can take place. Let's go over them.
Solo Stacking
If you are solo stacking, you have two options for signing.
Run your own signer
First, you can run your own signer by following the How to Run a Signer guide. This does require some technical chops and some resources for running a machine. It's all covered in the guide if this is the route you want to go down.
Work with another signer
If you don't want to run your own signer, you can collaborate with another signer and pass their signature into your stacking transactions, Details on how to do this can be found in the Stack STX guide.
Delegated Stacking
If you are delegating your STX to a pool operator, you don't need to worry about running a signer. Since you are only delegating your STX, but the pool operator is conducting the actual stacking transaction, the pool operator is responsible for running the signer.
If you are a pool operator, we have a stacking guide specifically for you.
How and Where to Stack
There are several options for stacking including solo stacking, participating in a pool, using an exchange, and liquid stacking.
The Stacks website has a stacking page dedicated to all these different options.
For detailed instructions on how to stack, view the Stack STX guides.
Stacking statistics
You can view all sorts of Stacking data and statistics and create your own dashboards on Ortege.
Last updated