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

LayerPackage(s)Who uses it
Foundation@bsv/sdkProtocol engineers — direct access to cryptographic primitives and script engine
Wallet InterfaceBRC-100 boundaryAll layers above communicate with wallets through this standard interface
Application wrapper@bsv/simpleApp developers — high-level payments, tokens, inscriptions, credentials
Wallet builder toolkit@bsv/wallet-toolboxWallet developers — assemble BRC-100-compliant wallets from modular pieces
Overlay network@bsv/overlay, @bsv/overlay-expressService operators — index and serve on-chain data
Messaging@bsv/authsocket, @bsv/message-box-clientApps needing encrypted P2P communication
Monetization@bsv/402-pay, @bsv/payment-express-middlewareAPIs requiring micropayment access control
Identity@bsv/auth-express-middleware, @bsv/authsocketApps requiring mutual authentication

Key Design Documents

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.