sBTC Escrow
sBTC Escrow is a trustless, non-custodial escrow protocol built on the Stacks blockchain. It enables secure peer-to-peer payments using STX and sBTC (Bitcoin-backed) tokens, with on-chain dispute resolution, automatic expiry, and a 0.5% platform fee.
Quick Links
- Quickstart — Create your first escrow in under 5 minutes
- Smart Contract — Clarity contract reference and data structures
- TypeScript SDK — Integrate escrow into your application
- Frontend App — React + Stacks Connect application guide
What Is This?
sBTC Escrow is a complete escrow infrastructure for the Stacks ecosystem:
- Smart Contract — A Clarity v4 contract deployed on Stacks that holds funds in escrow until release, refund, or dispute resolution.
- TypeScript SDK — A developer-friendly client for interacting with the contract from any Node.js or browser environment.
- Frontend App — A production-ready React application with wallet integration, realtime updates, and admin controls.
- Indexer Backend — Supabase-powered event indexing via Chainhook webhooks for fast queries and realtime subscriptions.
Who Is This For?
| Audience | Use Case |
|---|---|
| Freelancers | Secure milestone-based payments for contract work |
| OTC Traders | Trustless peer-to-peer token trades |
| DAOs & Grants | Milestone-gated grant disbursements |
| Service Providers | Escrow deposits for services before delivery |
| Developers | Build escrow-powered dApps with the SDK |
Key Features
Dual-Token Support — Native support for both STX (Stacks native token) and sBTC (SIP-010 Bitcoin-backed token). Create escrows in either token with appropriate min/max limits.
Non-Custodial — Funds are held by the smart contract, not a third party. The contract enforces all rules on-chain — no one can move funds outside the defined flows.
Dispute Resolution — Either party can raise a dispute. The contract owner resolves it (full to buyer, full to seller, or a partial split). If no admin resolution lands within the dispute window, the buyer can self-recover. On v3+, a seller who already signaled delivery can self-rescue after 2× the timeout — prevents admin-griefing of legitimate work.
Beneficiary Delegation (v3+) — Optional third-party with the same release/refund/dispute rights as the buyer. Useful for marketplace platforms that need to act on behalf of buyers, or DAO-held escrows.
Automatic Expiry — Escrows have a deadline. After expiry, the buyer can claim a refund. Buyers can also extend the deadline before it passes.
Burn-Block-Anchored Timing (v3+) — All deadlines on v3+ contracts are anchored to Bitcoin block height, not Stacks block height. Bitcoin's ~10 min/block cadence is stable via difficulty retarget; Stacks block time post-Nakamoto varies (5s to 2min). A "30-day" v3 escrow expires in 30 days regardless of Stacks-side fluctuation.
Time-Bounded Admin Pause (v3+) — Emergency pause requires a duration. The contract auto-unpauses after that window and blocks re-pause for an equal cooldown — closes an indefinite-pause griefing vector.
Contract-Caller Authorization — All functions validate contract-caller == tx-sender, preventing phishing attacks through malicious intermediary contracts.
Realtime Indexing — Chainhook webhooks feed blockchain events into Supabase, enabling realtime frontend updates and fast querying without direct chain reads.
Protocol Numbers
| Parameter | Value |
|---|---|
| Platform Fee | 0.5% (50 BPS) |
| Max Fee | 5% (500 BPS) |
| STX Min/Max | 0.001 STX — 100M STX |
| sBTC Min/Max | 0.0001 BTC — 100 BTC |
| Max Duration (v3+) | ~365 days (52,560 burn blocks) |
| Max Duration (legacy v6/v7) | ~365 days (350,400 Stacks blocks) |
| Dispute Timeout | ~30 days (28,800 burn blocks on v3+) |
| Block Time (v3+ timing anchor) | Bitcoin ~10 min/block mainnet, ~4 min/block testnet |
| Block Time (Stacks side) | ~90 seconds post-Nakamoto (variable) |
Networks
| Network | Active Contract | Legacy (read-only) |
|---|---|---|
| Mainnet | SP1HK6H018TMMZ1BZPS1QMJZE9WPA7B93TA2BMTGA.escrow-mainnet-v3 | SP1HK6H018TMMZ1BZPS1QMJZE9WPA7B93TA2BMTGA.escrow-mainnet-v2 |
| Testnet | ST1HK6H018TMMZ1BZPS1QMJZE9WPA7B93T8ZHV94N.escrow-v8 | ST1HK6H018TMMZ1BZPS1QMJZE9WPA7B93T8ZHV94N.escrow-v7 |
Legacy contracts remain readable + actionable (release / refund / dispute / admin resolution) for existing escrows. New escrows target the active contract on each network.
Architecture at a Glance
React / Vite
Wallet TX
Clarity V4
Postgres
Indexer