Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Networks

satd runs on the same networks as Bitcoin Core, plus testnet5, which Core has not released yet. One node runs one network. Each keeps its data in its own subdirectory of the data directory and listens on its own ports.

NetworkSelect withData directoryP2P portRPC port
mainnetnothing (default), -chain=mainthe data directory itself83338332
testnet3-testnet, -chain=testtestnet3/1833318332
testnet4-testnet4, -chain=testnet4testnet4/4833348332
testnet5-testnet5, -chain=testnet5testnet5/1835318352
signet-signet, -chain=signetsignet/ (a custom signet: signet_<message start>/)3833338332
regtest-regtest, -chain=regtestregtest/1844418443

The same selectors work in bitcoin.conf (testnet5=1, chain=testnet5), and settings under the network's section ([main], [test], [testnet4], [testnet5], [signet], [regtest]) apply only on that network. Naming more than one network is an error. sat-cli and sat-tui take the same selectors and pick the network's RPC port and cookie path from them. See Configuration and the flag reference.

Testnet5

Testnet5 is the test network of BIP 95. It drops the rule that made testnet3 and testnet4 easy to disrupt: a block may no longer fall back to the minimum difficulty after 20 minutes, so difficulty follows mainnet's retarget, from a minimum of about a million (compact 0x1a0fffff). Blocks are mined by ASICs, not CPUs. BIP 94 does not apply. Every earlier soft fork (BIP 34, 65, 66, CSV, segwit, taproot) is active from block 1, and so is BIP 54.

Genesis00000000000008c1637e7d3252dc1c333d4546fd6fff6a474b200d674a91d497
Message start46495645 (FIVE)
PortsP2P 18353, RPC 18352, onion service 18354
Addressesas the other test networks: tb1…, m…/n…, 2…
getblockchaininfo.chaintestnet5
Assume-valid, minimum chain worknone: every script is verified

Bitcoin Core's support is in open pull requests (#35861 for the network, #35793 for BIP 54); satd follows them.

Finding peers

No Core release ships seeds for testnet5, and satd ships none either: no DNS seeds and no fixed seeds. A fresh node has nobody to ask for addresses, so give it at least one peer you know runs testnet5, for example from the fixed-seed list proposed in Core #35861 or from another operator:

satd -testnet5 -addnode=<host>          # 18353 unless the entry names a port
sat-cli -testnet5 getpeerinfo

-addnode keeps the node's own address discovery running, so it learns more peers from the first one. -connect pins it to the peers you name and nothing else, and also holds a network crawl. Both can go in bitcoin.conf, under [testnet5] if the file is shared with other networks.

BIP 54, the consensus cleanup

Testnet5 enforces BIP 54 from block 1, with Core #35793's rules and reject reasons:

RuleReject reason
The first block of a difficulty period is at most two hours older than its parenttime-timewarp-attack
The last block of a period is not older than the period's firsttime-negative-interval
A transaction's inputs carry at most 2,500 legacy signature operationsbad-txns-legacy-sigops
No transaction is exactly 64 bytes without its witnessbad-txns-size
The coinbase's lock time is the previous block's heightbad-cb-locktime
The coinbase input's sequence is not 0xffffffffbad-cb-sequence

The mempool refuses what such a block could not hold: a 64-byte transaction (txn-size-64) and one over the signature-operation limit (bad-txns-legacy-sigops). getdeploymentinfo lists the deployment as consensuscleanup, an always-active BIP 9 deployment (height 0), as Core #35793 reports it; on networks without BIP 54 it is absent, as in Core.

On regtest, -test=bip54 turns on the same rules, the same mining behaviour and the same getdeploymentinfo row, for testing. Core #35793 has BIP 54 always on for regtest; satd keeps it behind the switch until Core releases it. No other network is affected.

Mining on testnet5

Every template satd builds (getblocktemplate, the generate RPCs, Stratum V1 and V2) already obeys BIP 54: its coinbase lock time is the previous block's height, its coinbase input sequence 0xfffffffe, and its earliest time keeps the two timestamp rules. A getblocktemplate client must say that it knows the rule, or it is refused with error -8 (Support for 'consensuscleanup' rule requires explicit client support):

sat-cli -testnet5 getblocktemplate '{"rules":["segwit","consensuscleanup"]}'

The template's rules then lists !consensuscleanup. A client that builds its own coinbase must set that lock time and a non-final sequence itself. Stratum V2 Job Declaration holds a declared coinbase to the same rules, and the Stratum server's default share difficulty is 10,000, as on mainnet. See Stratum Mining Server.