🛠️
Stacks Documentation
  • Start Here
  • 🧠Concepts
    • Stacks 101
      • What Is Stacks?
      • Bitcoin Connection
      • Proof of Transfer
      • Stacks Among Other Layers
      • Financial Incentive and Security Budget
    • Network Fundamentals
      • Network Basics
      • Mainnet and Testnets
      • Accounts
      • Authentication
      • Bitcoin Name System
      • SIPs
      • Technical Specifications
    • Block Production
      • Mining
      • Signing
      • Bitcoin Finality
      • Bitcoin Reorgs
      • Stacking
    • Transactions
      • How Transactions Work
      • Post Conditions
    • Clarity
      • Overview
      • Decidability
    • sBTC
      • Core Features
      • sBTC Operations
        • Deposit
        • Withdrawal
        • Deposit vs Withdrawal Times
      • Emily API
      • Peg Wallet UTXO
      • Clarity Contracts
        • sBTC Registry
        • sBTC Token
        • sBTC Deposit
        • sBTC Withdrawal
      • Auxiliary Features
        • Transaction Fee Sponsorship
        • Signer Wallet Rotation
      • Walkthroughs
        • Signer Process Walkthrough
        • sBTC Transaction Walkthrough
      • sBTC FAQ
    • Gaia
      • Configuration
      • Deploy Gaia Hub
      • Amazon EC2
      • Linux
      • Mac OS
  • 🛠️Guides & Tutorials
    • Developer Quickstart
    • Clarity Crash Course
    • Build a Borrowing & Lending Protocol
    • Bitcoin Integration
      • Sending Bitcoin with Leather Wallet
      • Verifying a Bitcoin Transaction
      • Parsing a Bitcoin Transaction
    • Create Tokens
      • Creating a NFT
      • Creating a Fungible Token
    • Build a Frontend
      • Post Conditions with Stacks.js
      • Authentication with Stacks.js
      • Sending Transactions with Stacks.js
    • Testing Smart Contracts
      • Fuzz Testing
    • Run a Node
      • Run a Node with Docker
      • Run a Node with Digital Ocean
      • Run a Node with a Hosted Provider
      • Run a Node with Quicknode
      • Run a Bitcoin Node
      • Run a Pruned Bitcoin Node
    • Run a Miner
      • Miner Prerequisites
      • Miner Costs and Fees
      • Mine Testnet Stacks Tokens
      • Mine Mainnet Stacks Tokens
      • Verify Miner
    • Run a Signer
      • Signer Quickstart
      • How to Read Signer Logs
      • How to Monitor a Signer
      • Best practices for running a Signer
      • OpSec Best Practices
    • sBTC
      • How to Run an sBTC Signer
      • Best practices for running an sBTC Signer
      • How to Use the sBTC Bridge
      • Earn sBTC Rewards
    • Stack STX
      • Solo Stack
      • Operate a Pool
      • Stack with a Pool
      • Increase Stacked Position
      • Stop Stacking
    • Oracles
    • Community Tutorials
  • 📚Reference
    • API
    • Clarity Types
    • Clarity Functions
    • Clarity Keywords
    • Stacks Node Configuration
    • Signer Configuration
    • Stacks Tooling
  • 🏗️Example Contracts
    • Audited Starter Contracts
    • Stacking
    • BNS
    • Multi Send
  • 🧡Press & Top Links
    • 🔶2024
      • 🔸January 2024
      • 🔸February 2024
      • 🔸March 2024
      • 🔸April 2024
      • 🔸May 2024
      • 🔸June 2024
      • 🔸July 2024
      • 🔸August 2024
      • 🔸September 2024
      • 🔸October 2024
      • 🔸November 2024
      • 🔸December 2024
    • 🔶2025
      • 🔸January 2025
      • 🔸February 2025
      • 🔸March 2025
      • 🔸April 2025
      • 🔸May 2025
  • 🧡Bitcoin Theses and Reports
    • 🟠Bitcoin Theses
    • 📙Bitcoin Reports
  • Contribute
Powered by GitBook
On this page
  • Introduction
  • Stacking vs Staking
  • Locking and Unlocking STX
  • Stacking flow
  • Stacking delegation flow
  • Token holder eligibility
  • Stacking in the PoX consensus algorithm
  • Stacking and Signing
  • Solo Stacking
  • Delegated Stacking
  • How and Where to Stack

Was this helpful?

  1. Concepts
  2. Block Production

Stacking

PreviousBitcoin ReorgsNextTransactions

Last updated 1 month ago

Was this helpful?

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 .

This document is presented as a conceptual overview of stacking and how it works. You can also view the to get a practical guide on the different ways you can stack and how to do it and a .

pox-4.clar is the stacking contract. If you are interested in experimenting with proof of transfer use cases including state changes, solo stacking, and pool stacking, all the functions you’ll need can be found at the deployed contract:

  • Testnet:

  • Mainnet:

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

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:

  1. Make API calls to get details about the upcoming reward cycle

  2. For a specific Stacks account, confirm eligibility

  3. Confirm the BTC reward address and the lockup duration

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

  5. The Stacking mechanism executes reward cycles and sends out rewards to the set BTC reward address

  6. During the lockup period, details about unlocking timing, rewards and more can be obtained

  7. Once the lockup period is passed, the tokens are released and accessible again

  8. Display reward history, including details like earnings for previous reward cycles

Stacking delegation flow

There are two main ways you can stack:

  1. Solo stacking

  2. Delegated stacking

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

  • Maintain their signer software (if they are operating a signer)

The following diagram describes how the minimum STX tokens per slot is determined.

Stacking in the PoX consensus algorithm

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.

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

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.

How and Where to Stack

There are several options for stacking including solo stacking, participating in a pool, using an exchange, and liquid stacking.

You can view all sorts of Stacking data and statistics using tools in the ecosystem such as:

Stacking functionality is implemented as a smart contract, using Clarity. Read more about .

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 of the bitcoin network.

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 in the min_threshold_ustx field.

Provide a to receive rewards

Token holders have a variety of providers and tools to support their participation in Stacking. The Stacks website contains a .

Stacking is a built-in capability of PoX and occurs through a set of actions on the Stacks blockchain. The 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 .

This process is handled by and then subsequently as that 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 guide.

If you are a pool operator, we have a specifically for you.

The Stacks website has a dedicated to all these different options.

For detailed instructions on how to stack, view the .

🧠
Stackers and Signing section
stacking guides
deep dive into the contract
https://explorer.hiro.so/txid/0xfba7f786fae1953fa56f4e56aeac053575fd48bf72360523366d739e96613da3?chain=testnet
https://explorer.hiro.so/txid/0xc6d6e6ec82cabb2d7a9f4b85fcc298778d01186cabaee01685537aca390cdb46?chain=mainnet
issuance rate is algorithmically determined
the contract
confirmation time variances
pox endpoint of the API
supported Bitcoin address
list of pools and stacking options
full proof-of-transfer implementation details
SIP-021
running a signer
conducting stacking operations
Stack STX
stacking guide
stacking page
Stack STX guides
Signal21
Stacking Tracker
StakingRewards.com
Stacking Calendar
Signal21
Stacking Tracker
StakingRewards.com
Stacking Calendar