A Field Reference
Reading Teranode's Gossip Layer
By HBGnostic · First published May 2, 2026
A reference for interpreting messages observed on Teranode's mainnet libp2p gossipsub layer. Useful alongside any tool that subscribes to the public gossip topics — mainnet-block, mainnet-subtree, mainnet-rejected_tx, mainnet-node_status.
01 — Foundation
Network Layer
libp2p — A modular peer-to-peer networking library, originally built for IPFS, now used by Ethereum, Filecoin, and Teranode. Handles peer discovery, encrypted connections (Noise), stream multiplexing (Yamux), and pub/sub messaging.
gossipsub — The pub/sub protocol layered on libp2p. Peers subscribe to topics; messages published to a topic are forwarded ("gossiped") through the mesh of subscribed peers until they reach everyone. Each peer only directly knows a few others, but messages propagate to the whole mesh in seconds.
Topic / topic prefix — A named stream within gossipsub. Teranode's mainnet topics share the prefix teranode/bitcoin/1.0.0/mainnet-, with suffixes block, subtree, rejected_tx, node_status.
Bootstrap peer — A well-known, hardcoded peer used for initial connectivity. Teranode mainnet currently advertises bootstraps via a /dnsaddr/ TXT record at mainnet.bootstrap.teranode.bsvb.tech. Bootstraps are entry points; they are not necessarily mining or producing operators.
Relay — In gossipsub, any peer that forwards a message it received to other peers. The "relay" of a given message is whoever passed it to the local listener — not who originated it. A single message may pass through many relays.
Broadcast — Publishing a message to a gossipsub topic so that all subscribers receive it. Broadcasts are not addressed to a specific recipient; they are visible to anyone in the mesh subscribed to the topic.
02 — Who's who
Node Identity
Operator — Whoever runs a Teranode instance: an individual, a company, a foundation, a mining pool, anyone. Operators self-report a client_name in their node_status broadcasts, but the term has no formal protocol meaning — it's shorthand for "the entity behind a given node."
client_name — The operator's self-chosen identifier, broadcast in every node_status message (e.g. bsva-mainnet-eu-2, mainnet.gorillanode.io). Operators name themselves; the unconfigured default is teranode.
producer — In block and subtree messages, the operator that originated the message. Distinct from relay (whoever passed it along).
03 — Inside the node
Teranode Architecture
Teranode — BSV's modern node implementation, succeeding the legacy SVNode. Designed for high transaction throughput. Written in Go.
Microservices — Teranode is not a single program. Per the official architecture overview, it is "a collection of microservices that work together to provide a horizontally scalable and highly efficient blockchain network." A single Teranode deployment runs roughly a dozen services in coordination, including:
- Asset Server — HTTP access to blockchain data
- Propagation Service — receives and forwards transactions
- Validator Service — validates transactions against network rules
- Subtree Validation Service — validates and persists newly received subtrees
- Block Validation Service — processes and validates new blocks
- Block Assembly Service — creates subtrees and assembles block templates for miners
- Blockchain Service — maintains blockchain state through a finite state machine
- Alert Service — distributes network alerts
- P2P Service — manages peer-to-peer communications, including the gossip layer described in this glossary
- Legacy Service — communicates with traditional BSV nodes
- RPC Service — provides Bitcoin RPC compatibility
- Block Persister / UTXO Persister Services — post-process blocks and maintain UTXO set files
FSM (Finite State Machine) — A computer-science construct in which a system is always in exactly one of a small set of named states, transitioning between them on defined events. Teranode's Blockchain Service is implemented as an FSM.
Blockchain Service vs. mining — The Blockchain Service is one specific microservice within Teranode. It "maintains the node's copy of the blockchain through a Finite State Machine that coordinates blockchain state transitions." It is not the whole node; it is the service that owns the lifecycle FSM. Mining, separately, is performed by external hardware (typically ASICs) that connects to the Block Assembly Service to receive block templates and submit proof-of-work solutions. Per the docs, "Miners are responsible for the computational work of finding valid blocks" and "receive block templates from Block Assembly Service." Running Teranode and mining are therefore two separable activities: an operator runs the node software; whether they also mine depends on whether mining hardware is connected to their Block Assembly service.
P2P Service — The microservice that owns Teranode's gossip-layer participation. Per the docs, it "uses libp2p for network communication" and "uses GossipSub for PubSub messaging, with automated topic subscription and management." Its responsibilities include broadcasting the operator's own node_status on startup ("the server's Start() method is invoked and publishes a node status message to announce its presence to the network"), publishing block / subtree / rejected-tx messages on their respective topics, and forwarding ("relaying") other operators' messages through the mesh. The P2P Service also exposes an HTTP server with a WebSocket endpoint (/ws) for external real-time subscribers. It is the service that an external libp2p listener connects to — a listener subscribing to mainnet-node_status is, on the wire, peering with the P2P Service of each operator in its mesh.
UTXO Store — Teranode's representation of the unspent transaction output set: "the current state of ownership of all Satoshi tokens in existence." Architecturally distinct from most other components: per the docs, "The UTXO Store is a shared library component that is used by multiple Teranode services to retrieve, store, and modify UTXOs" — i.e., it is not a microservice with its own API. Instead, multiple services (Validator, Block Validation, Block Assembly, etc.) link the UTXO Store library directly into their process and each open their own client connection to a configured backend. Supported backends:
- Aerospike — primary production datastore; high-performance clustered NoSQL
- SQL — PostgreSQL or SQLite
- Memory — in-memory store, development and testing only
- Nullstore — dummy implementation for testing
Note: Teranode does not use LevelDB. Legacy BSV nodes (SVNode) used LevelDB for the UTXO set; Teranode replaced that pattern with the shared-library + clustered-backend design above. A separate UTXO Persister Service writes UTXO set snapshots to files for backup or external export; it is not the live UTXO store but a sidecar that operates alongside it.
04 — Lifecycle
FSM States
The four Teranode Blockchain Service FSM states, quoted from services/blockchain/fsm.go and docs/topics/architecture/stateManagement.md in the bsv-blockchain/teranode repository:
| State | Definition |
|---|---|
| IDLE | "The Blockchain service always starts in an Idle state. No operations are permitted, all services are inactive, the node is not participating in the network in any way." |
| LEGACYSYNCING | "A full block sync performed against legacy BSV nodes" — used when a fresh Teranode needs to download historical blocks from the older SVNode network. |
| CATCHINGBLOCKS | "The node catching up on blocks. This state is triggered by BlockValidation when the node needs to catch up with the network." |
| RUNNING | "The node actively participating in the network" — fully synced, processing transactions and blocks, serving the mesh. |
Transitions:
- IDLE → (LEGACYSYNC) → LEGACYSYNCING
- LEGACYSYNCING → (RUN) → RUNNING
- IDLE → (RUN) → RUNNING
- RUNNING → (CATCHUPBLOCKS) → CATCHINGBLOCKS
- CATCHINGBLOCKS → (RUN) → RUNNING
- RUNNING | LEGACYSYNCING → (STOP) → IDLE
RUNNING indicates the node is operationally healthy and serving the network; it does not by itself indicate that the operator is mining.
05 — On the wire
node_status Fields
Operators broadcast a node_status message on mainnet-node_status every ~10 seconds. Common fields:
| Field | Meaning |
|---|---|
| client_name | Operator's self-chosen identifier |
| version | Teranode software version (e.g. v0.14.4, v0.15.0-beta-3) |
| fsm_state | One of IDLE, LEGACYSYNCING, CATCHINGBLOCKS, RUNNING |
| best_height | Operator's current chain tip height |
| best_block_hash | Hash of operator's current chain tip |
| listen_mode | full (accepts inbound peers) or listen_only (outbound only — firewalled or NAT'd) |
| storage | full (full archival) or pruned (older block bodies discarded; headers always retained) |
| connected_peers_count | Number of P2P peers this operator is currently connected to |
| tx_count / tx_pending | Pending transactions queued for inclusion |
| subtree_count / subtrees_pending | Subtrees built but not yet included in a block |
| min_mining_tx_fee | The operator's current minimum fee policy for accepting transactions |
| miner_name / last_miner | The miner of the most recent block this operator saw on the network. Not the identity of this operator — the identity of whoever mined the latest block. |
| uptime | How long the operator has been running |
06 — Other traffic
Other Messages
block — New block announcement: height, hash, header, coinbase, and a DataHubURL for HTTP fetch. Carries small notifications; the actual block data is fetched out-of-band over HTTP.
subtree — Subtree (transaction-batch) announcement, broadcast continuously between blocks. Carries a hash and a DataHubURL.
rejected_tx — Transaction rejection with reason code (e.g., fee too low, double-spend, invalid signature).
Subtree — A batch of transactions represented by its root hash. Per the Teranode data-model docs, "Subtrees are used to optimize the propagation of transactions and blocks." A Teranode block is structured as "a container of a group of subtrees" of equal size (except possibly the last). Rather than including full transaction data, a block contains lists of subtree identifiers. Operators continuously process subtrees as transactions arrive, so block assembly becomes "sequence these already-validated subtrees" rather than "process tens of thousands of fresh transactions at once."
DataHubURL / base_url — HTTP endpoint where the actual block or subtree data can be fetched. The architectural rule: announce on P2P, fetch on HTTP.
07 — End to end
Pipeline Order
Transaction-to-block flow inside a Teranode operator:
2. Tx validated → Validator Service
3. Tx batched → Subtree Validation Service (continuously)
4. Subtree announced → P2P Service (mainnet-subtree)
5. Subtree → block → Block Assembly Service (collects ready subtrees into a candidate block template)
6. Block template → Miner (external) (PoW computation)
7. PoW solution → Block Assembly Service
8. Block validated → Block Validation Service
9. Chain updated → Blockchain Service (FSM-owning service)
A consequence of this design: subtrees are gossiped continuously, not just when a new block lands. This is sometimes referred to as Teranode's "no mempool" model — transactions are immediately batched into subtrees rather than held in a flat memory pool.
08 — References
Sources
- bsv-blockchain/teranode — services/blockchain/fsm.go
- bsv-blockchain/teranode — docs/state-machine.diagram.md
- bsv-blockchain/teranode — docs/topics/architecture/stateManagement.md
- bsv-blockchain/teranode — docs/topics/architecture/teranode-microservices-overview.md
- bsv-blockchain/teranode — docs/topics/services/blockAssembly.md
- bsv-blockchain/teranode — docs/topics/datamodel/block_data_model.md
- bsv-blockchain/teranode — docs/topics/services/p2p.md
- bsv-blockchain/teranode — docs/topics/stores/utxo.md
- libp2p documentation