Repository navigation
Releases
v0.22.4
This release fetches announced blocks through their headers, as BCHN does, cuts the memory --slpgraphsearch needs to about a fifth, and has the gRPC address calls return the address's number of transactions. Nodes with --addrindex should read the upgrade notes first.
Performance
--slpgraphsearchkeeps about 210 bytes per SLP transaction instead of the whole transaction (about 1,000 bytes for a typical SEND, more for larger ones), and reads the transactions a search returns from the memory pool or the transaction index.- Loading
--slpgraphsearchtakes about a third less memory at its peak, about 280 MB less per million SLP transactions.
Consensus & Network
- Catching up with a competing chain that overtakes the node's own no longer takes two minutes per block.
- Add the
chipnet-seed.bchd.cashDNS seed. - A peer disconnected just as one of its messages arrived no longer leaves a goroutine behind.
- A synced node no longer downloads and stores the blocks of lower-work forks that peers announce.
- A compact block with an invalid header now costs the peer BCHN's ban score, and compact blocks go only to peers known to have the parent's header.
RPC & gRPC
- gRPC
GetAddressTransactionsandGetRawAddressTransactionsreturn the address's number of confirmed transactions inconfirmed_count. - On 32-bit builds,
GetAddressTransactionsandGetRawAddressTransactionswith annb_skipof 2^31 or more return no confirmed transactions instead of the newest ones. - gRPC
GetAddressTransactionsandGetRawAddressTransactionsno longer list a just-confirmed transaction as unconfirmed too. - The gRPC SLP calls no longer treat a transaction that left the memory pool unconfirmed as valid after the next block.
- The gRPC SLP calls no longer treat as valid a transaction that a reorg disconnected and the memory pool didn't take back.
GetSlpGraphSearchand the graph search count ofGetSlpTrustedValidationanswer bad client input withInvalidArgumentorNotFoundinstead ofInternalorAborted.GetSlpGraphSearchandGetSlpTrustedValidationanswer a transaction the SLP index does not hold withNotFound, and a failure to read the index withInternal, rather than both withAborted.GetSlpTrustedValidationanswers a query hash of the wrong length withInvalidArgumentrather thanAborted.GetSlpTokenMetadataanswers a token with no GENESIS or metadata in the SLP index withNotFound, a failure to read the index withInternal, and a token ID of the wrong length withInvalidArgument, instead ofAborted.CheckSlpTransactionandSubmitTransactionanswerInternalwhen the SLP index cannot read an input's entry, rather than taking the input for one without tokens.- When the SLP index fails to read a transaction's SLP data,
GetTransaction,GetBlock,GetMempoolandGetAddressTransactionsanswerInternal, and the subscriptions send the transaction asUNKNOWN_OR_INVALID, instead of reporting an invalid SLP transaction that burns its inputs. - An SLP transaction in the memory pool whose check hits a database failure is checked again at the next block, instead of staying invalid to the SLP calls while it is in the pool.
GetUnspentOutput,GetAddressUnspentOutputsandGetTransactionanswerInternalwhen the SLP index fails to read a token or its metadata, rather than leaving it out.GetUnspentOutputreturns the SLP token and token metadata of a confirmed output, not only of an unconfirmed one.- A memory pool transaction spending an output whose SLP index entry is corrupt is logged as an error, with advice to rebuild the index, and left unjudged instead of judged invalid.
- An output or transaction whose SLP index entry is corrupt fails the gRPC call with
Internal, and streams send it with its SLP state unknown, instead of answering without its token or token metadata. GetUnspentOutputreturns an output's SLP token metadata only wheninclude_token_metadatais set, asGetAddressUnspentOutputsdoes, so clients that read it must now set the flag.GetSlpTokenMetadatano longer reports a mint baton that a block burned while confirming, from the memory pool, the GENESIS or MINT that created it.GetSlpTokenMetadatareports a token's mint baton ended once a MINT ending it is in the memory pool, as it does once the MINT is confirmed, instead of the baton the MINT spent.searchrawtransactions, the websocket address filters andnotifyreceived, and the gRPC address calls and transaction filters refuse a legacy address from another network, such as a testnet address on mainnet, instead of reading it as this network's address with the same hash.- On systems that don't allow reading the network interfaces, such as Android, bchd creates its RPC certificate without their addresses instead of failing to start.
Database
- A block spending an output whose SLP index entry is corrupt stops the node with advice to rebuild the index with
--dropslpindex, instead of storing the spending transaction as invalid for good. - A corrupt SLP token metadata record stops the node with advice to rebuild the index, or fails the gRPC call that reads it, instead of crashing the node.
- When an index fails on a block, the log names the index instead of reporting a failure to write the chain state.
- When an index fails to catch up at startup, the error names the index.
Build & Packaging
- Update dependencies, including gRPC v1.85.0, protobuf v1.36.12, grpc-gateway v2.33.0 and the Prometheus client v1.25.0, and regenerate
bchrpc/pbwith them.
Other
- txscript can sign inputs that spend CashTokens, and sign with
SIGHASH_UTXOS.SignTxOutputWithSigHashes,SignatureScriptWithSigHashes,RawTxInECDSASignatureWithSigHashesandRawTxInSchnorrSignatureWithSigHashestake the transaction's signature hashes, computed once for all its inputs, which must include the outputs it spends (NewTxSigHashes(tx).WithUtxos(tx, utxos)) for those. The functions without them can't see the spent outputs, so they now return an error forSIGHASH_UTXOSinstead of a signature the network refuses. - txscript's signing functions return an error, instead of panicking or making an invalid signature, for signature hashes that don't fit the transaction and for
SIGHASH_UTXOSwithSIGHASH_ANYONECANPAY. - txscript's
SignTxOutputandSignTxOutputWithSigHashessign P2SH32 inputs. - txscript's
SignTxOutputkeeps a P2PKH or P2PK signature frompreviousScriptonly if it is valid, and no longer returns an invalid script when re-signing one wrapped in P2SH. - txscript's
CalcSignatureHashreturns an error forSIGHASH_UTXOSunless the signature hashes include all the outputs the transaction spends. --slpgraphsearchno longer logs an error for each SLP transaction that arrives while the graph loads.- txscript's
SignTxOutputdrops multisig signatures inpreviousScriptwhose hash type the network refuses, and returns an error for apreviousScriptin Schnorr multisig mode instead of losing its signatures. - txscript's signing functions return an error for a hash type the network refuses, such as
SigHashOld, instead of a signature it rejects. - txscript's
SignTxOutputreturns an error for a P2SH or P2SH32 input whose redeem script is itself P2SH or P2SH32, instead of an invalid script.
Upgrade notes
- Address index. On first start, and after an earlier release has run with
--addrindex, nodes with it read the address index once to count the transactions of large addresses: under a second on chipnet, a few minutes at most on mainnet.
v0.22.3
This release makes validation, initial sync and block relay considerably faster, adds double spend proofs, block finalization and Tor v3 support, adds CashTokens data and several BCHN-compatible calls to the JSON-RPC server, and brings consensus validation in line with Bitcoin Cash Node in a number of edge cases. It also drops free transactions, as BCHN did, and fixes many robustness issues in the P2P, RPC, gRPC and database code. Upgrading is recommended for all nodes; read the upgrade notes first if the node sets --minrelaytxfee to 0 or uses --profile, runs pruned or with --addrindex or --slpindex, serves sendrawtransaction, websocket or gRPC clients, or is short of memory.
Performance
- Hash the spent outputs once per transaction and size parsed scripts to their opcode count. Together, a full chipnet sync takes about 23% less wall time and 24% less CPU.
- Use the dcrd secp256k1 package in
bchec, as btcd does. Script validation is 26% faster and mempool acceptance 18% faster. - Analyse scripts without parsing them first, cutting memory allocated during validation and mempool acceptance by 16-31%.
- Add the outputs of an in-block parent to the UTXO view once instead of once per spending input (a 2000×2000 block goes from 142 ms to 0.38 ms).
- Hash a relayed block's transactions once for all compact block peers. With 125 peers this saves about 10 s of CPU per 32 MB block.
- With indexes on, sync allocates about half as much, and at the same
--gcpercentuses about half the CPU: ffldb commits to its cache's treaps in batches, the transaction and address indexes find transaction locations by scanning the block's bytes, and the SLP index sorts a block's transactions in linear time. - Refresh the checkpoints from BCHN (mainnet now 970892). During initial sync, blocks up to the last checkpoint only get the checks that don't depend on the chain state, so sync is much faster;
--nocheckpointsvalidates every block in full.
New options
--gcpercent(default 50, up from v0.22.2's fixed 10) sets the garbage collector target; higher values trade memory for CPU.GOGCandGOMAXPROCSare no longer overridden.--maxtxfee(default 0.1 BCH, as in BCHN) is the highest feesendrawtransactionandtestmempoolacceptaccept withoutallowhighfees.--maxreorgdepth(default 10) and--finalizationdelay(default 7200 seconds), as in BCHN.--rpcauthtimeoutnow also applies to websocket clients.--nodoublespendproofturns off double spend proofs.--sigcachemaxsizealso bounds the cache of transaction signature hashes, whose entries for transactions that failed validation or left the mempool unmined stayed until restart.--maxpeerskeeps--targetoutboundpeersslots for outbound peers, as BCHN keeps slots for its outbound connections, so inbound peers can't take them all. Persistent peers no longer count toward it, and a negative value is refused instead of crashing the node.--minrelaytxfeemust be above 0 and at most 21000000.--limitfreerelay,--norelaypriority,--blockminsizeand--blockprioritysizeare deprecated and do nothing.--profilewith a bare port listens on localhost only.--grpcmaxsubscriptions(default 100) limits the gRPC subscriptions all clients hold at once, and one client's to a quarter of it without--grpcauthtoken,--grpcmaxfilterentries(default 100,000) the entries one subscription's requests add to its transaction filter, and--grpcmaxconcurrentcalls(default 16) the other gRPC calls in progress, with up to four times as many waiting, as BCHN's HTTP server runs 16 requests and queues 64. A call over a limit getsResourceExhausted. A client is an IPv4 address or an IPv6 /56, so one with several addresses can hold more; clients at loopback, private or link-local addresses, such as a proxy in front of the server, share only the overall limit.
Consensus & Network
- Bring consensus validation in line with BCHN in several edge cases, including double spends within a block, failed signature checks and the signature cache, CashTokens prefix parsing and the coinbase rules, the BIP34 height push,
OP_NUM2BIN, and orphan blocks. No block on mainnet, testnet3, testnet4 or chipnet is affected. - Finalize blocks 10 deep and reject forks below them, and require BCHN's minimum chain work before the node considers itself synced. A sync peer that leaves the node below that work is replaced, so it can't hold the node on a low-work fork.
- Fix the stored ABLA state, which after a restart or a block disconnect could drop the next block's size limit to 16 MB.
- On testnet4 and chipnet the block size limit starts at 2 MB, as in BCHN, instead of 32 MB, and the UAHF, Magnetic Anomaly and Graviton rules start at BCHN's heights, one block later than before.
--excessiveblocksizenow defaults to the network's default size, which is also its minimum, and a larger value no longer raises the size and sigchecks limits blocks are validated against, except on regtest and simnet. - Support Tor v3 onion addresses and BIP155
addrv2, as BCHN does. Tor v2 addresses, which Tor no longer supports, are dropped. - Match bloom filters and build merkle blocks as BCHN does (gcash/bchutil#50).
- Match P2PK and bare multisig scripts to BCHN's templates for standardness. A key that isn't pushed directly, or doesn't start with a valid prefix, makes the script pay to script.
- Create, check and relay double spend proofs (
dsproof-beta), as BCHN does. - Every new transaction must pay
--minrelaytxfee, as in BCHN. Free relay and coin-age priority are gone. - Dust is judged at BCHN's default
-dustrelayfeeof 1000 satoshis per kB, whatever--minrelaytxfeeis, so raising that no longer refuses outputs BCHN relays. After the May 2026 upgrade an output whose script starts withOP_RETURNbut isn't a data carrier is never dust, as in BCHN. - Transactions leave the mempool two weeks after entering it, with the transactions that spend them, as with BCHN's default
-mempoolexpiry. A transaction a reorg put back below the minimum fee is never mined, and no longer stays until a restart. A reorg no longer leaves mempool transactions spending a block transaction the mempool refused, and puts back one that was also an orphan. - Regtest applies every upgrade from the first block, CashTokens included, and activates CSV at height 576, as BCHN does.
- Track each requested block and transaction, as BCHN does. A
notfound, 60 s without the transaction or the peer leaving moves a transaction request to the next peer that announced it, each peer's tracked announcements are capped at 100,000, and a peer that delivers none of the blocks it was asked for within BCHN's timeout is disconnected, its blocks going to other announcers. A compact block whose missing transactions don't arrive within 30 s, or that arrives while two from its peer are being reconstructed, is fetched in full. - Announced transactions are looked up in the UTXO set only when about to be requested, and without filling the UTXO cache, instead of twice for every unknown txid.
- A
getdatafor the compact block of a block more than 5 below the tip gets the full block, as in BCHN, and a compact block is built without copying the peer's whole known inventory. - Fix a deadlock between the peer handler and the sync manager that stopped sync and relay for good, and a shutdown hang behind a pending relay.
- Local addresses, which inbound onion peers come from, are no longer banned, as in BCHN, or held to
--maxpeersperip. Ended bans are dropped every 15 minutes, andnode disconnectreleases its peer's per-IP slot. - Fix several P2P message and compact block relay issues, including a data race on the
sendcmpctflags, and bound UPnP requests to five seconds. - BIP68 sequence locks and
OP_CHECKSEQUENCEVERIFYread the transaction version as unsigned, as BCHN does. Only versions that have been invalid since May 2023 are affected. - Bloom filtering follows BCHN: a peer without a filter gets filtered blocks as with one that matches everything,
filteraddwithout a filter is ignored,filterclearis always accepted and turns relay on, and themempoolreply lists the whole pool, parents first, with the peer's fee filter applied. - Messages other than blocks are held to BCHN's 2 MiB, or to their largest valid size, so a peer can make the node hold at most about 141 MB for one message instead of 268 MB.
- The block message limit follows ABLA, at twice the largest block size ABLA allows within the next 2048 blocks, as in BCHN, and never below the limit
--excessiveblocksizesets, so after a long run of full blocks the node can still receive the largest valid blocks. cfilter messages may hold the filter of any block that limit allows, instead of at most 4 MiB. - P2P rejects carry BCHN's short reasons, and none is sent for a duplicate, an orphan or an internal error, as in BCHN. Dust, an undersized transaction, one over its sigchecks limit and a script that fails only standardness flags are rejected with code 64, as in BCHN, and script failures name BCHN's script error.
- Script failures name the error BCHN gives for them, also where several of BCHN's errors shared one of bchd's error codes or, for all but a few scripts, where several rules fail, in
testmempoolaccept,sendrawtransactionand P2P rejects, for examplemandatory-script-verify-flag-failed (Push value size limit exceeded). With--relaynonstd, or on a network that relays nonstandard transactions, a transaction whose version breaks the May 2023 rule gets BCHN's code 64 andbad-txns-versionbefore its scripts run, instead of code 16 and a script error, and is not kept as an orphan. - A peer that sends a transaction breaking a consensus rule, such as a mandatory script failure, or an invalid block it was asked for, has BCHN's score for the rule added to its ban score, 100 for most rules, as BCHN does....
v0.22.2
Consensus & Network
- Only arm a peer stall deadline for a
getblockswith a non-zero stop hash. An open-endedgetblocksneeds no reply, so the deadline disconnected honest, fully-synced peers (btcsuite/btcd#1317). - Stop replying to
getblockswith an emptynotfoundwhen pruned. - Fix a hang on shutdown caused by a blocking queue send to a peer that had already quit.
- Always signal the send completion channel when serving a merkle block, which could otherwise wedge a peer's input handler.
- Fix two data races in the connection manager on
ConnReq.Addr. - Log a warning when a transaction is relayed to no peer, which happens when its fee rate is below every peer's fee filter.
Mining
- Pad the coinbase to the minimum transaction size enforced at the block height. Block generation was permanently broken on regtest above height 1000 and simnet above 3000.
- Set the Upgrade9 behavior flag in
CheckConnectBlockTemplate, which rejected valid CashToken transactions ingetblocktemplate.
RPC & gRPC
- Match transaction subscriptions on the address funding an input, so spends of outputs the subscription did not watch arrive now notify. Confirmed parents require
--txindex. - Report the missing parent rather than "already have transaction" when submitting a transaction held in the orphan pool, matching BCHN.
- Make the
estimatefeenblocksparameter optional, matching BCHN and Bitcoin ABC 0.19.1.
Database
- Fix a panic when a block rolls the block store over to a new flat file. The panic was recovered while the file lock was held, leaving the database wedged rather than crashing.
Security
- Fix a CashTokens consensus rule violation allowing minting NFT forgery. The authorization check shared one flag across all output categories, so a single authorized minting output authorized every other one in the same transaction. Reported by 0xaudron.
- Fix a remotely triggerable crash in the committed filter handlers, which dereferenced a missing index.
--fastsyncalso advertisedNODE_CFwithout maintaining one. - Reject raw transactions with trailing bytes in
decoderawtransactionandsendrawtransaction, which were previously discarded and the transaction relayed.
Build & Packaging
- Publish the Docker image to GHCR on each release tag.
- Rewrite the deprecated
io/ioutilusage go-bindata emits, with amake bindatatarget so it survives regeneration. - Update dependencies, including
google.golang.org/grpc,golang.org/x/crypto, andgolang.org/x/net.
Other
- Export
bchec.ErrInvalidSquareRootfor use witherrors.Is. - Modernize loops to range over integers, and adopt
slices.Backwardandstrings.Builder. - Assert the CHIP-2021-05 hashing density limit in the VM limits tests, which previously carried a check that could never execute.
- Fail rather than skip in the invalid VMB vector tests when a vector executes without error.
- Fix flaky address manager tests by generating only routable addresses.
- Removed support for plan9.
v0.22.1
Consensus & Network
- Remove the defunct
dnsseed.electroncash.deDNS seed.
Mining
- Include the Upgrade9 (CashTokens) script flags when building block templates. Templates were previously validated with the bare
StandardVerifyFlags, so on token-active networks valid CashToken transactions already in the mempool were dropped from the template, producing empty or near-empty blocks; the flags are now computed the same way the mempool and consensus block validation do.
Other
- Modernize
sync/atomicusage with the typed atomic APIs and adoptWaitGroup.Go.
v0.22.0
This release adds support for the May 15, 2026 Bitcoin Cash network upgrade ("upgrade12"). All node operators must upgrade before activation to stay in consensus.
What's new
- CHIP-2021-05 — Bounded looping operations (
OP_BEGIN/OP_UNTIL) - CHIP-2025-05 Functions — Function definition and invocation (
OP_DEFINE/OP_INVOKE) - CHIP-2025-05 Bitwise — Re-enables
OP_INVERT,OP_LSHIFTNUM,OP_RSHIFTNUM,OP_LSHIFTBIN,OP_RSHIFTBIN - CHIP-2024-12 P2S — Pay-to-Script standardization
- VMB test vectors for all of the above
Activation
| Network | MTP activation |
|---|---|
| Mainnet / testnet3 / testnet4 | 2026-05-15 12:00 UTC |
| Chipnet | 2025-11-15 12:00 UTC (already active) |
| Regtest / simnet | always active |
Upgrade notes
- No database migration required.
- Pre-upgrade script types (P2PKH, P2SH20, P2SH32, etc.) continue to behave as before.
- Upgrade before May 15, 2026 to avoid consensus divergence.
Full Changelog: v0.21.1...v0.22.0
v0.21.1
v0.21.0
v0.20.0
v0.20.0-rc2
- Updated seeds to match BCHN and add newly restored BCHD seeds.
- Fixed syncing issue with nodes supporting sendaddrv2 messages.
- Fixed syncing testnet4 with SLP indexes.
v0.20.0-rc1
This is a huge milestone. Finally are back in consensus with the rest of the BCH ecosystem!