Bitcoin's scripting language is intentionally limited, so you can't deploy a lending market or a DAO on it directly. Stacks is a separate chain that runs smart contracts and anchors itself to Bitcoin: its blocks are tied to Bitcoin blocks, its contracts can read Bitcoin state, and its consensus pays out in BTC. sBTC adds the missing piece, a way to move BTC itself into those contracts.
Proof of Transfer
Stacks uses Proof of Transfer (PoX). Instead of burning energy (proof of work) or only staking the native token, Stacks miners spend BTC to compete for the right to produce Stacks blocks. Each miner commits BTC in a Bitcoin transaction, and a winner is chosen with probability proportional to its commitment.
That BTC isn't burned. It's paid to stackers: STX holders who lock their tokens for one or more reward cycles and give a Bitcoin address to receive rewards.
| Role | Puts in | Gets |
|---|---|---|
| Miner | BTC, on Bitcoin | Newly minted STX and transaction fees |
| Stacker | Locked STX | BTC from miners' commitments |
| Signer | Runs signing software, backed by stacked STX | A role in validating blocks (see Nakamoto below) |
Stacking
A reward cycle lasts 2,100 Bitcoin blocks, about two weeks. To stack solo you need at least the current minimum, which changes with how much STX is participating, and you must run or work with a signer. Most holders instead delegate to a pool, which combines smaller amounts and passes on BTC rewards, or use liquid stacking tokens that stay transferable while the underlying STX is locked.
Rewards depend on how much BTC miners commit, which follows the STX price and competition between miners. Stacking yield isn't a fixed rate.
Nakamoto: faster blocks, Bitcoin finality
Before the Nakamoto upgrade (activated on mainnet in late 2024), Stacks produced roughly one block per Bitcoin block, about every ten minutes, and Stacks could fork independently of Bitcoin.
Nakamoto changed both:
- Tenures, not single blocks. The miner that wins a Bitcoin block's sortition gets a tenure and produces many fast Stacks blocks until the next Bitcoin block. Blocks now arrive every few seconds.
- Signers. Each block must be approved by stackers' signers holding at least 70% of the stacked weight. A miner can't secretly fork or censor the chain on its own.
- Bitcoin finality. Tenures are anchored to Bitcoin blocks, and Stacks no longer forks on its own. Once a transaction's tenure is anchored and that Bitcoin block has confirmations, reversing it means reorganising Bitcoin.
For confirmation logic: a transaction in a signed Stacks block is very unlikely to be dropped within seconds. For large values, wait for the anchoring Bitcoin block to get the same confirmations you would require on Bitcoin.
Clarity
Stacks contracts are written in Clarity, a Lisp-like language designed around safety:
- Interpreted, not compiled. The source code is what's stored on-chain and executed, so what you read in an explorer is exactly what runs.
- Decidable. No unbounded loops or recursion. You can determine what a contract can do and how much it costs before running it.
- No reentrancy. A contract can't be re-entered while one of its own calls is in progress, which removes the classic Solidity callback attack.
- Explicit errors. Public functions return a
response(okorerr), and anerrrolls back all the changes made by that call.
Clarity can also read Bitcoin. burn-block-height gives the current Bitcoin height, and get-burn-block-info? returns a Bitcoin block's header hash. This contract records the Bitcoin block each caller checked in at:
(define-constant ERR-ALREADY-CHECKED-IN (err u100))
(define-constant ERR-NO-BURN-BLOCK (err u101))
(define-map check-ins
principal
{ burn-height: uint, burn-hash: (buff 32) })
(define-public (check-in)
(let (
;; use the last complete Bitcoin block
(height (- burn-block-height u1))
(hash (unwrap! (get-burn-block-info? header-hash height) ERR-NO-BURN-BLOCK))
)
(asserts! (is-none (map-get? check-ins tx-sender)) ERR-ALREADY-CHECKED-IN)
(ok (map-set check-ins tx-sender { burn-height: height, burn-hash: hash }))))
(define-read-only (get-check-in (who principal))
(map-get? check-ins who))
Going further, libraries such as clarity-bitcoin verify that a specific Bitcoin transaction was mined, by checking a Merkle proof against a block header hash that Clarity already knows. That lets a contract react to a native BTC payment, for example releasing an NFT once a buyer's Bitcoin transaction confirms, without any oracle.
Post-conditions
Post-conditions are Stacks' answer to "what will this transaction do to my assets?" They are attached to the transaction by the wallet or app, not written in the contract, and the node checks them after execution. If any fails, the whole transaction aborts.
import { Pc, PostConditionMode } from "@stacks/transactions";
const postConditions = [
// the sender may transfer at most 1 STX (1,000,000 micro-STX)
Pc.principal(senderAddress).willSendLte(1_000_000n).ustx(),
];
// pass to makeContractCall({ ..., postConditions, postConditionMode: PostConditionMode.Deny })
In deny mode, any asset transfer not covered by a post-condition also aborts the transaction. A malicious or buggy contract can't take more than the user agreed to, however it's written. Apps should use deny mode with precise conditions; a wallet prompt showing allow mode deserves suspicion.
What sBTC is
sBTC is a SIP-010 fungible token on Stacks backed 1:1 by BTC. It lets Clarity contracts hold, lend and trade something redeemable for real bitcoin.
- Deposit: you send BTC in a Bitcoin transaction to an address controlled by the sBTC signer set. Once it confirms, signers approve minting the same amount of sBTC to your Stacks address. The deposit script includes a reclaim path, so if it isn't processed you can recover your BTC after a timeout.
- Withdraw: you request a withdrawal and your sBTC is locked and then burned; signers co-sign a Bitcoin transaction sending BTC to your address.
- The BTC sits in a threshold-controlled Bitcoin address. A supermajority of signers must cooperate, using threshold Schnorr signatures, to move it.
Deposits opened on mainnet in late 2024, with an initial cap, and withdrawals followed in 2025.
sBTC's trust assumptions
sBTC is not trustless, and it isn't just "BTC on Stacks":
- You trust a threshold of signers. If enough of them collude or their keys are compromised, they can move the BTC backing sBTC. If enough go offline, deposits and withdrawals stall.
- The signer set is permissioned, a group of known organisations, rather than an open set. Plans to widen it toward stackers are part of the roadmap; check the current status before relying on it.
- Bitcoin can't enforce the peg. Bitcoin script can't verify Stacks state, so nothing on Bitcoin forces signers to honour a withdrawal. The guarantees come from the signers' incentives and reputations, plus the reclaim path for deposits in flight.
- Contract risk still applies. Holding sBTC in a DeFi protocol adds that protocol's risk on top.
That is a stronger model than a single custodian and weaker than native BTC. Size positions accordingly.
Summary
| Concept | Key point |
|---|---|
| Proof of Transfer | Miners spend BTC, stackers receive it |
| Stacking | Lock STX per ~2-week cycle, earn variable BTC rewards |
| Nakamoto | Blocks every few seconds, 70% signer approval, Bitcoin finality |
| Clarity | Interpreted, decidable, no reentrancy, reads Bitcoin state |
| Post-conditions | Transaction-level limits on asset movements |
| sBTC | 1:1 BTC-backed token held by a threshold signer set |
Get the weekly commit
New blockchain deep dives every week.