BCH Intents Developer Docs
BlazeHack
Judge guide, proof of work, XO, demos and the pitch.
- Repositories and evidence: Source links and the pre-existing versus new-work trail for judges.
- Blaze launch infrastructure: CashToken issuance, bonding curves, and liquidity graduation for Bitcoin Cash launchpads and Mesh Protocol.
- Mesh pools and strategies: The BCH liquidity system at the center of the submission.
- BCH Blaze 2026 submission: A judge's starting point for Mesh, BCH Intents, XO, and the evidence separating new work from earlier work.
- Pitch and media: Present the BCH Blaze pitch, download the deck, and add demos from Sanity Studio.
- XO roadmap — what we're building next: Intents, Mesh pools, and Blaze launchpad infrastructure are all moving to XO templates.
- XO implementation and feedback: Mesh limit orders on XO, Cham wallet signing, Bitcoin Cash covenants, and verification evidence.
Get Started
What BCH Intents is, how the pieces fit together, and where to point your code.
- Architecture: How applications, the Mesh Server, liquidity venues and Bitcoin Cash covenants fit together, and where the trust boundary sits.
- Choose your path: Pick the integration that matches what you're building, from a no-code swap link to a full solver.
- Glossary: The terms used across the protocol, the API and these docs.
- How a swap works: Follow one limit order from the swap screen to an on-chain fill, and see which component is responsible at each step.
- Introduction: BCH Intents is an intent-based swap protocol that settles on Bitcoin Cash. Users say what they want; solvers compete to deliver it; covenants enforce the result.
- Networks & endpoints: Which networks each part of the protocol runs on, default service ports and the environment variables the app reads.
- 5-minute quickstart: Quote a swap, create a limit order, fund it from a chipnet wallet and watch it fill, using nothing but HTTP.
- Status & roadmap: What is live, what is in beta, and what is being built next.
Intents
Swap orders locked in BCH covenants and filled atomically by solvers.
- Cross-chain overview: How BCH Intents settles swaps with Solana and EVM chains, and why proofs are replacing hash locks.
- ZK-STARK settlement: Solvers claim cross-chain escrows with a STARK proof of their delivery transaction instead of revealing a secret.
- Intent lifecycle: The states an intent moves through, what triggers each transition, and which WebSocket event announces it.
- Dutch auctions: The minimum starts high and decays linearly with chain time. The order fills at the first moment any route clears it.
- Limit orders: A fixed minimum that any route must clear before the expiry. The maker can exit early with a signature.
- Market orders: Swap now at the quoted price, protected by a slippage floor.
- TWAP orders: Split a large order into N Dutch-auction slices that open at fixed chain-time intervals, funded in a single transaction.
- What is an intent: An intent is a covenant-locked order that anyone may fill, but only in a way that pays the maker what they asked for.
- Chain time (MTP): Why every covenant decision uses median-time-past, and what that means for deadlines and Dutch decay.
- The atomic fill: Every fill, whatever the liquidity source, is one transaction with a fixed input/output layout that the covenants enforce by index.
- Refunds & cancellation: How unfilled intents return to the maker, who can trigger it, and why the maker never has to be online.
- Surplus & frontend fees: When a route pays more than the covenant minimum, the difference is split between the protocol, the user and the frontend that created the order.
- Status reference: Every value of the intent status field, what it means and what a client should show.
Mesh
Isolated, non-custodial LP pools that solvers route intents through.
- Mesh overview: Mesh is the protocol's liquidity layer. Each LP position is its own covenant UTXO at a fixed price, owned and exited by a single key.
- Bulk reconfiguration: Close N positions and open M new ones in a single transaction, paid by the byte.
- Pool lifecycle: Configure, fund, register, trade and dock a Mesh strategy pool, with the API call and on-chain check at each step.
- Oracle strategies: Pools that follow a signed market price instead of a fixed one. Not available yet. This page explains the status, the oracle payload, and the design in progress.
- Pricing math: The exact integer inequality a pool enforces, how the server quotes it, and worked examples.
- Recycling: MeshPoolV3 mirror mode keeps liquidity in Mesh. What a pool receives opens its reverse pool, which trades it back, with no withdrawal and no new deposit.
- Strategy pools: StrategyCovenantV2 is a fixed-rate BCH ↔ token pool in one UTXO. Amounts are derived from the pool's own input and output, so it is paid by construction.
- Route controls: Pause and resume each liquidity route at runtime. Fills stop; refunds never do.
- Tri-route engine: For every intent, the matcher tries Mesh pools, then Cauldron, then solver inventory, and fills with the first route that clears the covenant minimum.
- Security model: What the covenants guarantee to makers and LPs, what they deliberately don't, and how the guarantees are tested.
- Accumulate ladder: Buy a token in steps at falling prices. Each step is its own bid; the tokens go to your wallet.
- Strategy configuration guide: Comprehensive beginner-to-advanced operational manual for Mesh Finance — understanding UTXO covenants, deploying automated recycling strategies, liquidity math, and on-chain execution.
- Fixed price: One pool at one price. A bid holds BCH and buys a token; an ask holds the token and sells it for BCH. Proceeds go to your wallet.
- Grid: Two to ten recycling pairs on a geometric price ladder. Each rung buys at its level and sells one level up, so small moves anywhere in the range earn.
- Multi-pair quote: One BCH deposit bids for two or three tokens at once, each at its own price. Shared liquidity in a single pool.
- How strategies work: A strategy is a set of MeshPoolV3 pools built from a template, funded in one transaction and managed as one position. Eight templates cover limit orders, market making, ranges, ladders and stable pairs.
- Range: Bins on a shared price grid around the market. BCH bids below it, token asks above it, every one a recycling pool, with the deposit spread by a shape you choose.
- Recycling pair: Buy low, sell high, repeatedly. One pool in mirror mode; each fill opens the reverse pool, which trades the proceeds back. Liquidity stays in Mesh.
- Spread market: A bid below the market and an ask above it for one token. You earn the gap plus the fee when both sides trade. Proceeds go to your wallet.
- Stable pair: Token↔token pools around a peg, with no BCH leg. Give B for A, A for B, or both, a little off the peg.
- Take-profit ladder: Sell a token in steps at rising prices. Each step is its own ask; the BCH goes to your wallet.
- MeshPoolV3 pools: One covenant for every V3 pool. It keeps only its reserve, sends what it receives to a proceeds output, and can quote up to three assets.
- V4 positions: Mesh V4 liquidity positions are NFTs that own in-place bins on a price grid. What they are, how to create, trade, transfer and withdraw them, and what to watch out for.
- Mesh vs pooled AMMs: How isolated strategy covenants compare with pooled AMMs like Cauldron and shared-liquidity designs on EVM.
Contracts
CashScript covenants: constructor arguments, spend paths and invariants.
- DutchAuctionSwapV2: Decaying-price intent covenant. The minimum falls linearly with tx.locktime across a fixed window; refundable after the window closes.
- LimitOrderSwapV2: Fixed-price intent covenant. Permissionless fill that must pay the maker at its own output index; permissionless refund after expiry; maker-signed early exit.
- Contracts overview: The CashScript covenants that enforce intents and liquidity, what each guarantees, and which are routed to today.
- StrategyCovenantV2: Fixed-rate Mesh pool covenant. Payment-enforced fills with amounts derived from the pool's own input and output; owner-only dock.
SDKs
TypeScript packages for creating intents, running pools and building solvers.
- Embed swaps in a wallet: Give wallet users best-execution swaps without running liquidity: quote, create, fund with the user's key, track.
- Earn with frontend fees: Frontends that create intents can take a share of every fill's surplus, paid on-chain in the fill transaction itself.
- Installation: Install the SDK, pick a wallet adapter and configure your bundler for browser builds.
- IntentBuilder: Fluent, validated builders for limit-order and Dutch-auction parameters.
- Overview & packages: The Intents SDK is a set of TypeScript packages for building intents, compiling covenants, signing with any wallet and talking to the intent pool.
- Wallet adapter: Implement four methods and any BCH wallet can create and fund intents through the SDK.
APIs
REST and WebSocket interfaces for quotes, intents, pools and solvers.
- Admin & route controls: Operator endpoints for stats, swaps, liquidity, route circuit breakers and refund sweeps. Writes require x-admin-key.
- Authentication: Public endpoints need no auth. Admin writes require the x-admin-key header, and are disabled entirely when no key is configured.
- Errors: HTTP status codes the Mesh Server returns and how to handle each.
- Cancel an intent: Report a maker's on-chain cancellation. The server re-reads the covenant and never cancels on request.
- Create an intent: Compute a V2 intent covenant for a limit or Dutch order and get the funding instructions.
- Get an intent: Fetch one intent with its derived status, deadlines and settlement transactions.
- List intents: Query intents by maker, status and type, or fetch the open and completed sets.
- Request a refund: Trigger the refund engine for one expired intent. Safe to expose publicly.
- Connect a client: Point Claude, Claude Code, Cursor, VS Code, Windsurf, ChatGPT or any stdio client at the MCP server.
- Funding prepared orders: An order prepared by an agent is a covenant address waiting for funds. How the maker funds it from the app or by hand, and what the funding page checks.
- MCP server: A Model Context Protocol server that lets AI agents quote swaps, prepare orders and read Mesh pools. It holds no keys; the user's wallet funds every order.
- Self-hosting the MCP server: Run the MCP server yourself, over stdio from npm or as an HTTP service, and point it at any Mesh Server.
- Tool reference: Every tool of the MCP server with its parameters, the shape of results and errors, and the resources and prompts it offers.
- Oracle prices: Reference prices and signed oracle payloads (BCH Schnorr) for oracle-priced pools.
- Orderbook: Aggregated Mesh depth for a pair, grouped into price levels.
- API overview: The Mesh Server exposes a JSON REST API under /api/v1 and a WebSocket stream at /ws for quotes, intents, pools and market data.
- Pools: Preview, register and read StrategyCovenantV2 pools by covenant address, with chain-derived activity, stats and LP aggregates.
- Positions: List, register and reconcile Mesh strategy pools, and read their fill history.
- Get a quote: Price a swap across Mesh pools and Cauldron, with the route and the Mesh / Cauldron split.
- Rebalance quote: Plan a bulk reconfiguration that docks several positions and opens new ones in one transaction.
- Recycle: Find idle liquidity for an owner and plan a one-transaction recycle into recycling pairs around the market price.
- Strategies: Templates with a field schema, market-based suggestions, preview against the market, one-transaction deploy and rebalance plans for MeshPoolV3 strategies.
- Tokens & BCMR: Token lists with market data and BCMR metadata (symbol, name, decimals, icon).
- TWAP orders: Quote, submit and track TWAP orders made of Dutch-auction slices.
- V4 positions: Plan, register, read, transfer and withdraw Mesh V4 positions, held as NFTs and made of in-place bins.
- WebSocket stream: One socket for intent lifecycle events, pool fills and orderbook changes.
Solvers
Fill intents, capture surplus and keep the network liquid.
- Matching & route selection: What the matcher computes for each intent, how it picks a route, and how to dry-run it.
- Why solvers: Solvers turn resting intents into settled trades. They choose the route, pay the miner fee and keep what the fill rules allow.