Architecture
The BSV TypeScript stack is organized as a foundation-to-application hierarchy. Each layer is a clean boundary that can be consumed independently.
Layers
| Layer | Package(s) | Who uses it |
|---|---|---|
| Foundation | @bsv/sdk | Protocol engineers — direct access to cryptographic primitives and script engine |
| Wallet Interface | BRC-100 boundary | All layers above communicate with wallets through this standard interface |
| Application wrapper | @bsv/simple | App developers — high-level payments, tokens, inscriptions, credentials |
| Wallet builder toolkit | @bsv/wallet-toolbox | Wallet developers — assemble BRC-100-compliant wallets from modular pieces |
| Overlay network | @bsv/overlay, @bsv/overlay-express | Service operators — index and serve on-chain data |
| Messaging | @bsv/authsocket, @bsv/message-box-client | Apps needing encrypted P2P communication |
| Monetization | @bsv/402-pay, @bsv/payment-express-middleware | APIs requiring micropayment access control |
| Identity | @bsv/auth-express-middleware, @bsv/authsocket | Apps requiring mutual authentication |
Key Design Documents
- Stack Layers — Detailed layer diagram and component map
- BEEF (BRC-62) — Binary transaction exchange format, wire format, SPV validation
- BRC-100 Wallet Interface — Vendor-neutral wallet boundary, method surface, advanced workflows
- Identity & Auth — BRC-103/104, BRC-31, identity keys
- Conformance Pipeline — How TS generates vectors; Go/Python/Rust runners
Cross-Cutting Concerns
Zero-dependency SDK — @bsv/sdk has no npm dependencies. This eliminates supply-chain risk in the cryptographic foundation and makes it suitable for embedding in constrained environments.
Audited cryptography — The @bsv/sdk primitives and transaction validation logic have undergone third-party security auditing by Trail of Bits.
BRC-100 as the seam — The wallet interface is the most important architectural boundary. Applications above it are wallet-agnostic; implementations below it are application-agnostic. This is what makes the ecosystem composable.