<>ts-stack
Get StartedArchitecturePackagesSpecsGuides
⌘K
Reference
Home
Get StartedOverviewInstallChoose your stackKey concepts
ArchitectureOverviewStack layersBEEF (BRC-62)BRC-100 Wallet InterfaceIdentity & AuthConformance pipeline
PackagesOverviewSDKWalletNetwork
@bsv/teranode-listener
OverlaysMessagingMiddlewareHelpers
InfrastructureOverviewmessage-box-serveroverlay-serveruhrp-server-basicuhrp-server-cloud-bucketwabwallet-infrachaintracks-server
SpecsOverviewBRC-100 Wallet InterfaceOverlay HTTPMessage-box HTTPAuthsocket (WebSocket)BRC-31 Auth HandshakeBRC-29 Peer PaymentBRC-121 / HTTP 402ARC BroadcastMerkle ServiceStorage AdapterGASP SyncUHRPAir-Gap Optical (BRC-141)
ConformanceOverviewVector catalogTS runnerContributing vectors
GuidesOverviewIdentity, DIDs and credentialsIdentity migrationBuild a wallet-aware appRun an overlay nodePeer-to-peer messagingHTTP 402 payments
ReferenceOverviewBRC indexRepository health
AboutVersioningContributingDoc agentDocumentation sources
Loading…
Edit this page on GitHub
© 2026 BSV Blockchain. ts-stack is open-source.
GitHubContributingVersioning

Network

Publish and resolve large verified UHRP content with CHIRP, or connect to Teranode's P2P network and subscribe to real-time blockchain events.

Packages in this Domain

PackagePurpose
@bsv/chirpProgressively publish and resiliently resolve BRC-167 chunked Merkle content over UHRP
@bsv/teranode-listenerSubscribe to Teranode P2P topics via libp2p DHT with gossipsub pub/sub messaging

What You Can Do

  • Listen for new blocks — Real-time block solution events from Teranode
  • Monitor subtree updates — Track subtree creation and validation
  • Track mining status — Subscribe to mining enabled/disabled events
  • Monitor peer connections — Handshake messages from connecting peers
  • Detect rejected transactions — Receive txid of transactions rejected by network
  • Custom topic subscription — Dynamic add/remove of topic callbacks at runtime
  • PNET-compatible DHT participation — Join mainnet with its public compatibility value or configure a private network PSK

Key Concepts

  • PNET DHT — Uses a 32-byte PNET value for network compatibility; the published mainnet value is not authentication
  • Gossipsub — Efficient pub/sub messaging layer for blockchain event distribution
  • Topic-based subscriptions — Subscribe to specific events (bitcoin/mainnet-block, bitcoin/mainnet-subtree, etc.)
  • Bootstrap peers — Known entry points for discovering other peers in the network
  • Static peers — Explicitly configured peers maintained for reliable connectivity
  • Peer discovery — libp2p Kademlia DHT discovers peers dynamically
  • Callbacks — Each topic has own async message handler for processing events
  • Message format — Events arrive as raw Uint8Array; caller deserializes (typically BSV transactions/blocks)
  • Trust boundary — Topic messages, sender names, and propagation peers are untrusted until application claims are independently verified

When to Use

Use network packages when you need to:

  • Monitor real-time blockchain events
  • React to new blocks as they arrive
  • Track peer connectivity and network health
  • Run an overlay service that listens for transactions
  • Build applications that need live blockchain state updates

When NOT to Use

  • For transaction broadcasting — use transaction submission endpoints
  • For historical queries — use indexers or explorer APIs
  • For UTXO lookups — use full-node RPC or @bsv/overlay lookup services
  • Without requirement for real-time updates — use batch query APIs

Architecture Overview

Network flow: your application subscribes to TeranodeListener which routes through libp2p (PNET-compatible DHT plus gossipsub with Noise encryption, Kademlia discovery, bootstrap and static peers) over TCP/Noise to Teranode peers in the P2P network; received claims remain untrusted until independently verified

Topics Available

TopicEvent
bitcoin/mainnet-bestblockBest block message
bitcoin/mainnet-blockBlock solution found
bitcoin/mainnet-subtreeSubtree created
bitcoin/mainnet-mining_onMining enabled
bitcoin/mainnet-handshakePeer connects
bitcoin/mainnet-rejected_txTransaction rejected
bitcoin/testnet-*Testnet equivalents

Next Steps

  • @bsv/teranode-listener — Real-time blockchain event subscription
  • @bsv/overlay — Indexing service integration
  • @bsv/sdk — Transaction/block deserialization