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.

Specs to packages map: each BSV protocol specification on the left is implemented by one or more ts-stack packages on the right, with curved links showing the BRC-100 to wallet-toolbox/sdk, BRC-31 to authsocket/middleware, Overlay HTTP to overlay/overlay-express, and other relationships

Quick Reference

SpecFormatVersionImplementationsPurpose
BRC-100 WalletJSON Schema1.0.0@bsv/wallet-toolbox, @bsv/sdkStandard wallet interface for signing and key management
BRC-31 AuthAsyncAPI 3.01.0.0@bsv/auth-express-middleware, @bsv/authsocketMutual authentication handshake (BRC-103 + BRC-104)
BRC-29 Peer PaymentAsyncAPI 3.01.0.0@bsv/paymail, @bsv/message-box-clientP2P payment derivation and transmission
BRC-121 / 402OpenAPI 3.11.0.0@bsv/402-pay, @bsv/payment-express-middlewareHTTP micropayment protocol
Overlay HTTPOpenAPI 3.11.0.0@bsv/overlay, @bsv/overlay-expressTransaction routing and topic management
Message Box HTTPOpenAPI 3.11.0.0@bsv/message-box-clientStore-and-forward messaging API
AuthSocketAsyncAPI 3.01.0.0@bsv/authsocketAuthenticated WebSocket for live messaging
ARC BroadcastOpenAPI 3.11.0.0@bsv/sdkMiner-facing transaction broadcast
Merkle ServiceOpenAPI 3.11.0.0@bsv/sdkSPV proof delivery service
Storage AdapterOpenAPI 3.11.0.0@bsv/wallet-toolboxRemote wallet storage interface
GASP SyncAsyncAPI 3.01.0.0@bsv/gaspTransaction graph synchronization
UHRPOpenAPI 3.11.0.0@bsv/overlay-topicsContent-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-pay or @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/sdk ARC class

I need proof of transaction inclusion

  • Use Merkle Service for SPV proof delivery
  • Implement via @bsv/sdk or external Merkle Service

Learning Path

  1. Foundations — Read Key Concepts for UTXO model, scripts, and transactions
  2. Identity & Auth — Study BRC-31 Auth to understand mutual authentication
  3. Wallets & Signing — Review BRC-100 Wallet for standard signing interface
  4. Payments — Learn BRC-29 Peer Payment for deriving payment addresses
  5. APIs & Services — Explore Overlay HTTP and Message Box HTTP for building services
  6. Infrastructure — Deploy with ARC Broadcast and Merkle Service
  • Implementations — See package-specific guides in /packages/*/CLAUDE.md
  • Error Codes — Reference specs/errors.md for standardized error responses
  • Network Services — Consult /docs/network-services/ for Merkle Service, ARC endpoints, and provider lists