> For the complete documentation index, see [llms.txt](https://docs.stacks.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stacks.co/pox-5/development.md).

# Development

This section walks through PoX-5 from the SDK's perspective. Pages are grouped by the interaction shape they cover rather than by actor — most users hit more than one cluster (a partner onboards, reads their position, enrolls in a paired bond, claims rewards, then renews).

All examples use [`@stacks/bitcoin-staking`](https://github.com/hirosystems/stacks.js/tree/feat/bitcoin-staking/packages/bitcoin-staking) for the PoX-5 surface and `@stacks/transactions` for signing and broadcast. The actor-oriented overview lives at [Actors](/pox-5/actors.md); these pages assume you already know which path you're building for.

### How the flow unfolds

A typical integration moves through five stages. The third one forks based on which path your user takes — most apps support more than one.

1. **Read current state** — [Read-Only Queries](/pox-5/development/read-only.md) Before any transaction, fetch the current bond index, your user's allowlist row, and any positions they already hold. Pure on-chain reads through the SDK's `fetch*` helpers. This answers "where are we in the cycle and what is this user permitted to do right now?" Every later step branches off what you learn here.
2. **One-time onboarding** — [Onboarding](/pox-5/development/onboarding.md) Bootstrapping transactions that configure *who is allowed to do what*: the allowlist and parameters the Endowment submits before a bond is published. No yield-bearing capital moves at this stage, and a returning user may have most of it already in place. If you operate signer infrastructure, [Advanced › Signers](/pox-5/development/advanced/signers.md) covers the signer-key grants and revocations stakers route through.
3. **Open a position** — your user commits assets through one of three paths:

   <table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Paired BTC</strong></td><td>L1 BTC timelock + L2 STX lock. Institutional, T1 paired yield, self-custodial.</td><td><a href="/pages/U6gxImXtZ0dSFwwVAk0B">/pages/U6gxImXtZ0dSFwwVAk0B</a></td></tr><tr><td><strong>Solo STX</strong></td><td>STX-only stack, no BTC commitment. Earns T3 residual after T1 and reserve.</td><td><a href="/pages/lCavuvTDytxSKEZtp9N7">/pages/lCavuvTDytxSKEZtp9N7</a></td></tr><tr><td><strong>Pool</strong></td><td>sBTC + STX through a whitelisted pool operator. Lower friction, shared envelope.</td><td><a href="/pages/ql2wRHr900vD7tEIxrIJ">/pages/ql2wRHr900vD7tEIxrIJ</a></td></tr></tbody></table>

   Each path has its own transaction shape, but they share the same prerequisites you established in steps 1–2.
4. **Receive rewards** — [Rewards](/pox-5/development/rewards.md) Distributions are pulled, not pushed — `calculate-rewards` and `claim-rewards` are open entrypoints anyone can call to settle a cycle. Your job is to read accumulated reward balances, surface them to the user, and offer a claim path. Payout is in sBTC; a staker who elected a BTC reward address receives an L1 withdrawal handled in the signer-manager layer, not in pox-5.
5. **Renew or exit** — re-lock window (D172 → D182) In the last \~10 days of a bond, the L1 timelock has expired but STX is still locked. Your user either constructs the next L1 timelock to roll into the next bonding period without losing continuity, or exits and lets STX unlock at D182. This UX is covered inline on the [Paired BTC](/pox-5/development/paired-btc.md) and [Rewards](/pox-5/development/rewards.md) pages.

### Pages

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Onboarding</strong></td><td><a href="/pages/NbLzhnfOdERknt0H3U9T">/pages/NbLzhnfOdERknt0H3U9T</a></td></tr><tr><td><strong>Read-Only Queries</strong></td><td><a href="/pages/krBkDMuZwVsPLJGNCo1f">/pages/krBkDMuZwVsPLJGNCo1f</a></td></tr><tr><td><strong>Paired BTC</strong></td><td><a href="/pages/U6gxImXtZ0dSFwwVAk0B">/pages/U6gxImXtZ0dSFwwVAk0B</a></td></tr><tr><td><strong>Solo STX</strong></td><td><a href="/pages/lCavuvTDytxSKEZtp9N7">/pages/lCavuvTDytxSKEZtp9N7</a></td></tr><tr><td><strong>Pools</strong></td><td><a href="/pages/ql2wRHr900vD7tEIxrIJ">/pages/ql2wRHr900vD7tEIxrIJ</a></td></tr><tr><td><strong>Rewards</strong></td><td><a href="/pages/SPWvEO5Cpp9cxTPA3uA9">/pages/SPWvEO5Cpp9cxTPA3uA9</a></td></tr><tr><td><strong>Questionnaire Flow</strong></td><td><a href="/pages/jKTM0VCdfi4mFSVGKqNk">/pages/jKTM0VCdfi4mFSVGKqNk</a></td></tr><tr><td><strong>Advanced</strong></td><td><a href="/pages/1gsO1ARg9pjoGrrk8MbB">/pages/1gsO1ARg9pjoGrrk8MbB</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.stacks.co/pox-5/development.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
