Specifications
This section documents the protocols and standards that the ts-stack implements. Each protocol solves a specific coordination problem on BSV: from wallet identity and authentication to peer payments, overlay service management, and transaction broadcast. These specs enable interoperable applications by defining precise request/response formats and protocol flows.
Quick Reference
| Spec | Format | Version | Implementations | Purpose |
|---|---|---|---|---|
| BRC-100 Wallet | JSON Schema | 1.0.0 | @bsv/wallet-toolbox, @bsv/sdk | Standard wallet interface for signing and key management |
| BRC-31 Auth | AsyncAPI 3.0 | 1.0.0 | @bsv/auth-express-middleware, @bsv/authsocket | Mutual authentication handshake (BRC-103 + BRC-104) |
| BRC-29 Peer Payment | AsyncAPI 3.0 | 1.0.0 | @bsv/paymail, @bsv/message-box-client | P2P payment derivation and transmission |
| BRC-121 / 402 | OpenAPI 3.1 | 1.0.0 | @bsv/402-pay, @bsv/payment-express-middleware | HTTP micropayment protocol |
| Overlay HTTP | OpenAPI 3.1 | 1.0.0 | @bsv/overlay, @bsv/overlay-express | Transaction routing and topic management |
| Message Box HTTP | OpenAPI 3.1 | 1.0.0 | @bsv/message-box-client | Store-and-forward messaging API |
| AuthSocket | AsyncAPI 3.0 | 1.0.0 | @bsv/authsocket | Authenticated WebSocket for live messaging |
| ARC Broadcast | OpenAPI 3.1 | 1.0.0 | @bsv/sdk | Miner-facing transaction broadcast |
| Merkle Service | OpenAPI 3.1 | 1.0.0 | @bsv/sdk | SPV proof delivery service |
| Storage Adapter | OpenAPI 3.1 | 1.0.0 | @bsv/wallet-toolbox | Remote wallet storage interface |
| GASP Sync | AsyncAPI 3.0 | 1.0.0 | @bsv/gasp | Transaction graph synchronization |
| UHRP | OpenAPI 3.1 | 1.0.0 | @bsv/overlay-topics | Content-addressed file storage |
About BRCs
BRC = BSV Request for Comments. BRCs are numbered sequentially (there is no categorical grouping by number range). Each BRC solves a specific interoperability problem. Implementations reference the spec by number so different teams build compatible systems without central coordination.
The authoritative BRC repository is at github.com/bitcoin-sv/BRCs. The machine-readable contracts for BRCs implemented in ts-stack live in the /specs directory as OpenAPI 3.1, AsyncAPI 3.0, and JSON Schema files.
By Use Case
I'm building a wallet
- Start with BRC-100 Wallet to understand the standard interface
- Implement cryptographic signing per BRC-100 and key derivation per BRC-42
- Reference implementation:
@bsv/wallet-toolbox
I'm implementing peer-to-peer payments
- Use BRC-29 Peer Payment for payment derivation and transmission
- Combine with BRC-31 Auth for mutual authentication
- Implementation:
@bsv/paymail,@bsv/message-box-client
I'm monetizing an API endpoint
- Implement BRC-121 / 402 using
@bsv/402-payor@bsv/payment-express-middleware - Gateway checks payment before serving content; wallet derives and submits satoshi transaction
I'm running an overlay service (topic manager)
- Deploy with Overlay HTTP endpoints using
@bsv/overlay-express - Implement topic managers per Overlay spec
- Reference implementations in
@bsv/overlay-topics
I'm building transaction broadcasting
- Use ARC Broadcast for miner-facing submission
- Implement via
@bsv/sdkARCclass
I need proof of transaction inclusion
- Use Merkle Service for SPV proof delivery
- Implement via
@bsv/sdkor external Merkle Service
Learning Path
- Foundations — Read Key Concepts for UTXO model, scripts, and transactions
- Identity & Auth — Study BRC-31 Auth to understand mutual authentication
- Wallets & Signing — Review BRC-100 Wallet for standard signing interface
- Payments — Learn BRC-29 Peer Payment for deriving payment addresses
- APIs & Services — Explore Overlay HTTP and Message Box HTTP for building services
- Infrastructure — Deploy with ARC Broadcast and Merkle Service
Related Documentation
- Implementations — See package-specific guides in
/packages/*/CLAUDE.md - Error Codes — Reference
specs/errors.mdfor standardized error responses - Network Services — Consult
/docs/network-services/for Merkle Service, ARC endpoints, and provider lists