BT
← All projectsbtcsuite

btcd

Alternative full-node Bitcoin implementation written in Go.

BitcoinNode implementationsNormal
Repository coverage

209 commits in the local evidence base

Every captured commit receives deterministic security triage and a separate communication-quality score. Security candidates and broader second-pass signals receive full-patch Ollama analysis.

46security candidates22second-pass queue203AI analyses
10commits · 30 days
10commits · 60 days
147commits · 180 days
204commits · 365 days
Backfill bands
Aug 5 → Feb 621 seen1 candidatesComplete
Feb 6 → Jun 6112 seen7 candidatesComplete
Jun 6 → Jul 634 seen13 candidatesComplete
Jul 6 → Aug 530 seen7 candidatesComplete
Commit communication

Does the history explain itself?

Message quality measures whether a commit identifies its scope, purpose, rationale, testing, and supporting references. It does not change the security-severity score.

68/100 average clarity
64Strong · 80–100
80Adequate · 60–79
60Thin · 40–59
5Opaque · 0–39
Read the scoring rubric →
Developer activity

Who is changing the project?

Public Git author strings; identities are not independently verified.

DeveloperCommitsCandidatesAnalyzedHigh riskMessage avg.
Boris Nagaev461546160
Olaoluwa Osuntokun651461173
Lrifton92434186
Erick Cestari818177
Or Aharonee404184
Oliver Gugger13413047
MPins333079
Drake Thomsen222091
Eric Grill313086
Jacob Schuler111088
Julio Cesar111045
Kim111045
Analysis record

Published AI watches

Last scanned 47 minutes ago

Informational 12 AI analysisMessage 86 · Strong
BT btcsuitebtcd BitcoinNode implementations

rpcserver: test null getblock verbosity

This commit only adds a new integration test that sends a null value for the optional verbosity parameter of the getblock RPC and checks that the server returns a normal verbose block response. It does not change any production code. The t…

Regression test for a prior RPC server panic (#2600)No production code changes; defensive test coverage only
c130f0bfby Olaoluwa Osuntokun+36−01 file
No security note in commit
Moderate 65 AI analysisMessage 73 · Adequate
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2600 from allocz/fix_issue_2597

This patch fixes a server crash in btcd's JSON-RPC 'getblock' command. When a caller did not provide an optional 'verbosity' parameter, the code later dereferenced a nil pointer, causing the entire btcd process to panic. The fix supplies a…

nil-pointer dereference panic in RPC handlerdenial-of-service via crafted JSON-RPC requestserver process crash (availability impact)
a3f20384by Olaoluwa Osuntokun+5−11 file
No security note in commit
Moderate 59 AI analysisMessage 58 · Thin
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2601 from vbrekher/fix/psbt-multi-a-finalizer

This change fixes how btcd finalizes a specific type of Bitcoin Taproot smart contract called multi_a. Previously, the finalizer simply stacked signatures in the order they appeared in the PSBT file. For multi_a contracts, signatures must …

Incorrect witness ordering for multi_a tapscripts could produce invalid Bitcoin transactionsNew parser enforces standard multi_a template and rejects unsupported CHECKSIGADD constructionsDuplicate and non-matching signatures now return ErrInvalidPsbtFormat
ca0bb02cby Olaoluwa Osuntokun+366−93 files
No security note in commit
Informational 12 AI analysisMessage 95 · Strong
BT btcsuitebtcd BitcoinNode implementations

psbt: test multi_a excess signature handling

This commit only adds a new unit test for the PSBT finalizer. It checks that when a Bitcoin Taproot multi-signature (multi_a) input has more valid signatures than required, the finalizer picks exactly the required number and leaves the ext…

26ee1cc8by Olaoluwa Osuntokun+33−01 file
No security note in commit
Informational 12 AI analysisMessage 95 · Strong
BT btcsuitebtcd BitcoinNode implementations

psbt: test multi_a signature input ordering

This commit only adds a new test case to the project's test suite. It does not change any production code. The test verifies that a PSBT (Partially Signed Bitcoin Transaction) finalizer correctly orders signatures for a specific type of Ta…

Regression test for Taproot multi_a signature orderingNo production code changesDefensive guard against incorrect finalizer implementations
709069b9by Olaoluwa Osuntokun+36−131 file
No security note in commit
Informational 15 AI analysisMessage 58 · Thin
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2580 from Roasbeef/version-bump-v0.26.2

This commit only changes the software version number from v0.26.1-beta.rc1 to v0.26.2-beta. It does not modify any security-related code, network behavior, or user-facing functionality. There is no security issue here.

05585e03by Olaoluwa Osuntokun+2−21 file
No security note in commit
Informational 15 AI analysisMessage 80 · Strong
BT btcsuitebtcd BitcoinNode implementations

build: bump version to v0.26.2-beta

This commit only changes the software version number from v0.26.1-beta.rc1 to v0.26.2-beta. It does not modify any program logic, network code, or security behavior. There is no security issue here.

d9948c49by Olaoluwa Osuntokun+2−21 file
No security note in commit
Informational 15 AI analysisMessage 80 · Strong
BT btcsuitebtcd BitcoinNode implementations

build: bump version to v0.26.1-beta.rc1

This commit only changes the reported software version number from v0.26.0-beta to v0.26.1-beta.rc1. It does not alter any program logic, network behavior, or security-sensitive code. There is no security issue here.

3fa0a65cby Olaoluwa Osuntokun+2−21 file
No security note in commit
Informational 18 AI analysisMessage 78 · Adequate
BT btcsuitebtcd BitcoinNode implementations

version: preserve semantic version separators

This commit fixes a small bug in how the btcd Bitcoin node software cleans up version strings. Previously, dots in pre-release version labels like 'beta.rc1' were accidentally removed, turning them into 'betarc1'. The change adds dots to t…

No security-relevant signals in commit message or diffChange is a string-normalization correctness fixNo input from untrusted network sources is processed by this code path
65db4939by Olaoluwa Osuntokun+20−12 files
No security note in commit
Informational 15 AI analysisMessage 85 · Strong
BT btcsuitebtcd BitcoinNode implementations

build: pin tagged submodules and remove local replacements

This commit is a routine build housekeeping change. It updates two internal Go module dependencies to newly published tagged versions and removes local directory overrides so that everyone builds with the same published code. There is no i…

3d3b5e8aby Olaoluwa Osuntokun+8−82 files
No security note in commit
Informational 15 AI analysisMessage 88 · Strong
BT btcsuitebtcd BitcoinNode implementations

build: bump v2transport to v1.1.0

This commit only updates a dependency version number in the project's Go module file. It bumps the v2transport package from version 1.0.1 to 1.1.0 so that downstream projects building btcd as a module can access new handshake admission API…

8d902916by Olaoluwa Osuntokun+1−11 file
No security note in commit
Informational 12 AI analysisMessage 83 · Strong
BT btcsuitebtcd BitcoinNode implementations

rpcclient: harden DisableAuth transport tests

This commit only changes tests and clarifies a public comment. It does not alter the actual authentication behavior of the btcd RPC client. The code already only suppresses the internally generated Basic auth header when DisableAuth is tru…

No functional code change; only tests and commentsComment clarification that DisableAuth only suppresses generated Basic auth, not caller-provided Authorization headersTests now cover WebSocket handshake, cookie bypass, and caller-provided headers
52d2fadeby Olaoluwa Osuntokun+186−1272 files
No security note in commit
Informational 15 AI analysisMessage 78 · Adequate
BT btcsuitebtcd BitcoinNode implementations

rpcclient: wrap DisableAuth tests to 80 columns

This commit only reformats an existing test file. It wraps long lines to 80 columns, splits nested code into separate variables, and adjusts whitespace. No production code was changed, and no security behavior is altered.

fe84a0e1by Olaoluwa Osuntokun+83−521 file
No security note in commit
Informational 15 AI analysisMessage 96 · Strong
BT btcsuitebtcd BitcoinNode implementations

rpcclient: add tests for DisableAuth header behavior

This commit only adds new unit tests for an existing feature. It does not change any production code, so it cannot introduce a security vulnerability or fix one directly. The tests verify that an existing option called DisableAuth correctl…

9b849c17by Drake Thomsen+109−01 file
No security note in commit
Informational 21 AI analysisMessage 86 · Strong
BT btcsuitebtcd BitcoinNode implementations

rpcclient: make HTTP Basic Auth optional via DisableAuth

This change adds a new optional setting called DisableAuth to the btcd RPC client. When a user turns it on, the client will not send username/password credentials automatically. This is meant to let users connect to external Bitcoin API se…

New opt-in configuration flag that disables authentication headersDefault behavior unchanged; authentication still required unless user explicitly disables itNo validation added to ensure alternative authentication is present when DisableAuth is true
5d22b395by Drake Thomsen+25−131 file
No security note in commit
Informational 14 AI analysisMessage 83 · Strong
BT btcsuitebtcd BitcoinNode implementations

integration: stabilize pre-verack disconnect cycles

This change only modifies an integration test file. It makes a test more reliable by waiting for a version response and retrying connection attempts, rather than changing any production code that handles real Bitcoin peer connections. Ther…

76ba8842by Olaoluwa Osuntokun+58−191 file
No security note in commit
Low 27 AI analysisMessage 83 · Strong
BT btcsuitebtcd BitcoinNode implementations

server+connmgr: make outbound startup deterministic

This commit fixes a scheduling bug in how a Bitcoin node decides how many automatic outbound peers to connect to at startup. Previously, if a user had configured permanent peers, those permanent peers could grab internal connection IDs bef…

Non-deterministic outbound peer count at startupPermanent peers could consume connection request IDs before automatic counter sampledPotential for fewer automatic outbound peers than configured, reducing network diversity
58ee9ef6by Olaoluwa Osuntokun+157−224 files
No security note in commit
Low 26 AI analysisMessage 68 · Adequate
BT btcsuitebtcd BitcoinNode implementations

config: reject non-positive maxpeers

This commit fixes a configuration bug in btcd, a Bitcoin node implementation. Previously, setting maxpeers=0 caused the node to enter a tight loop: it would repeatedly try to connect to outbound peers and immediately reject them. The chang…

Denial-of-service-like resource exhaustion via tight reconnect loop triggered by a configuration valueInput validation added for a previously unbounded configuration parameterNo memory corruption, authentication bypass, or remote code execution signals present
7e9414faby Olaoluwa Osuntokun+42−23 files
No security note in commit
Informational 12 AI analysisMessage 83 · Strong
BT btcsuitebtcd BitcoinNode implementations

integration: synchronize p2p lifecycle stress batches

This commit changes only test code. It tightens up an integration test that simulates many fake Bitcoin peers connecting and disconnecting from a node, and makes a small cleanup in a unit test for closing network pipes. There is no change …

No production code changedTest-only synchronization improvementsNo authentication, cryptography, consensus, or network handling logic modified
5a2c5063by Olaoluwa Osuntokun+217−202 files
No security note in commit
Low 48 AI analysisMessage 78 · Adequate
BT btcsuitebtcd BitcoinNode implementations

v2transport: restore responder handshake progress

This commit fixes a deadlock risk in btcd's new Bitcoin v2 transport handshake. Previously, the responder waited until it had received the initiator's full 64-byte key before doing any work, which could cause both sides to sit waiting for …

BIP324 handshake deadlock avoidanceCPU admission lease split to prevent resource exhaustion / lock holding across network I/OResponder now sends key material before full initiator key is received
09717871by Olaoluwa Osuntokun+231−862 files
No security note in commit
Repository ledger

Explore captured commits

Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.

Lower-prioritytxscript: refactor CalcScriptInfo for nested P2SH analysisby Olaoluwa Osuntokun · ee91afcf · Apr 29, 2026 · 1 fileMessage 73 · AdequateLow 35Details
Commit message · Olaoluwa Osuntokun

txscript: refactor CalcScriptInfo for nested P2SH analysis

Extract the nested P2SH analysis from CalcScriptInfo into a dedicated
calcP2SHScriptInfo helper, and switch it to use finalOpcodeData for
redeem-script extraction (matching the consolidation in NewEngine and
GetWitnessSigOpCount). The helper also threads the inner witness-script
expected-input contribution for nested P2WSH spends, which the previous
inline code did not account for.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 35/100

This commit refactors how btcd counts expected inputs and signature operations for a specific kind of Bitcoin transaction: P2SH (pay-to-script-hash) that hides a SegWit (witness) program inside. The main change is that nested P2SH-P2WSH transactions now also account for the inner witness script's expected stack arguments, which the previous code ignored. The commit does not claim to fix a vulnerability, but the change corrects an analysis gap that could cause fee-estimation or policy checks to undercount required inputs for these transactions.

Lower-prioritytxscript: update tx_invalid.json from Bitcoin Coreby Olaoluwa Osuntokun · 1b76fcb4 · Apr 29, 2026 · 1 fileMessage 75 · AdequateLow 28Details
Commit message · Olaoluwa Osuntokun

txscript: update tx_invalid.json from Bitcoin Core

Updated from Bitcoin Core master
(e32bc7f817e7adeffef22a985bf8dbd4aa3e08d8), file
src/test/data/tx_invalid.json.

75/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
AI analysis · Low 28/100

This commit updates a single test data file (tx_invalid.json) used to check that btcd rejects invalid Bitcoin transactions. It pulls in newer test vectors from Bitcoin Core and adjusts some test flags. It does not change any production code, so it cannot directly introduce a live security bug. However, the new test cases include important consensus-related checks (e.g., duplicate inputs, bad coinbase sizes, null inputs, and stricter script rules). If btcd's existing code does not already handle these cases correctly, the tests may now fail and reveal latent consensus or denial-of-service issues.

Lower-prioritytxscript: update tx_valid.json from Bitcoin Coreby Olaoluwa Osuntokun · 77a33163 · Apr 29, 2026 · 1 fileMessage 70 · AdequateLow 28Details
Commit message · Olaoluwa Osuntokun

txscript: update tx_valid.json from Bitcoin Core

Updated from Bitcoin Core master
(e32bc7f817e7adeffef22a985bf8dbd4aa3e08d8), file
src/test/data/tx_valid.json.

70/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
AI analysis · Low 28/100

This commit updates a single test data file (tx_valid.json) used by btcd's transaction-script test suite, syncing it with a newer version from Bitcoin Core. It changes test cases and the verification flags they are labeled with, but does not modify any production code. On its own, this is a test-maintenance change and not a direct security patch. However, the new test vectors are designed to exercise stricter signature rules (DERSIG, LOW_S, STRICTENC, NULLDUMMY, CONST_SCRIPTCODE, etc.) and segwit behavior. If btcd's script engine already enforces those rules, the tests should pass; if it does not, the updated tests would reveal discrepancies. The commit therefore signals an effort to keep btcd aligned with Bitcoin Core's consensus and standardness rules, which has indirect security relevance, but it does not by itself fix or introduce a vulnerability.

Lower-prioritytxscript: update script_tests.json from Bitcoin Coreby Olaoluwa Osuntokun · 44bfb2b7 · Apr 29, 2026 · 1 fileMessage 75 · AdequateInformational 15Details
Commit message · Olaoluwa Osuntokun

txscript: update script_tests.json from Bitcoin Core

Updated from Bitcoin Core master
(e32bc7f817e7adeffef22a985bf8dbd4aa3e08d8), file
src/test/data/script_tests.json.

75/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit only updates a single test data file (script_tests.json) used by btcd's transaction-script test suite. It pulls in the latest test vectors from Bitcoin Core. No production code, consensus logic, or network behavior was changed. It is a test-only synchronization and does not introduce or fix any security vulnerability on its own.

Lower-prioritytxscript: support latest Core script_tests formatby Olaoluwa Osuntokun · 53036fdb · Apr 29, 2026 · 1 fileMessage 78 · AdequateInformational 14Details
Commit message · Olaoluwa Osuntokun

txscript: support latest Core script_tests format

Add support for newly named Bitcoin Core script-test result tokens and
skip taproot placeholder rows that are already covered by
TestTaprootReferenceTests.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 14/100

This commit only updates btcd's test code to understand the latest Bitcoin Core test file format. It adds new error-code names used in reference tests, skips taproot placeholder rows that are tested elsewhere, and cleans up field indexing. There is no change to the actual transaction-script validation engine that runs on the live Bitcoin network, so this does not create or fix a security vulnerability in production code.

Security candidateecdsa: update recovery error messages and fix test comparisonby MPins · 8c40eb75 · Apr 24, 2026 · 1 fileMessage 95 · StrongInformational 15Details
Commit message · MPins

ecdsa: update recovery error messages and fix test comparison

Update the expected error strings in recoveryTests to match the new
error message format introduced by the secp256k1 v4.4.0 upgrade.
Also replace reflect.DeepEqual with a string-based errorStringEqual
helper to avoid type mismatches between fmt.Errorf and wrapped errors,
and drop the now-unused "reflect" import.

95/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
Why it was queued
cryptography-sensitive pathsigning or wallet path
AI analysis · Informational 15/100

This commit only changes test code. It updates the expected error messages in a test file to match a newer version of a cryptographic library and swaps one test-comparison helper for another. There is no change to the actual signature-recovery logic that runs in production, so it does not create or fix a security vulnerability in live code.

Security candidateecdsa: add VerifyLowS helper and testsby MPins · 77e3f98a · Apr 23, 2026 · 2 filesMessage 70 · AdequateLow 28Details
Commit message · MPins

ecdsa: add VerifyLowS helper and tests

Introduce a VerifyLowS helper to detect non-canonical
high-S ECDSA signatures, along with unit tests.

70/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
Why it was queued
signing boundarycryptography-sensitive pathsigning or wallet path
AI analysis · Low 28/100

This commit adds a new helper function called VerifyLowS to the btcd Bitcoin library's ECDSA signature code. Its purpose is to detect signatures whose 'S' value is in the mathematically equivalent but non-standard 'high-S' form, which can make signatures malleable (one valid signature can be transformed into another valid one). The commit also adds unit tests. It does not by itself change any consensus or network validation rules; it only provides a reusable utility for callers to enforce low-S if they choose.

Security candidatego.mod, go.sum: updated secp256k1 to v4.4.0by MPins · 5d5251d8 · Apr 18, 2026 · 2 filesMessage 73 · AdequateInformational 11Details
Commit message · MPins

go.mod, go.sum: updated secp256k1 to v4.4.0

The new version exposes Signature.S(), giving direct access to the S
scalar without re-parsing the DER bytes. This enables a cleaner
implementation of the VerifyLowS helper added in this branch.

73/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
signing boundary
AI analysis · Informational 11/100

This commit only updates two dependency version numbers in Go module files (go.mod and go.sum). It bumps the secp256k1 cryptographic library from version 4.0.1 to 4.4.0, plus a minor update to an indirect dependency. The commit message says the newer version exposes an internal value used by a helper function elsewhere in the same branch. There is no actual code change in this commit, and no security problem or fix is described.

Lower-priorityrpcclient: speed up string parsingby Oli · cd70f77f · Apr 9, 2026 · 1 fileMessage 68 · AdequateLow 25Details
Commit message · Oli

rpcclient: speed up string parsing

This commit replaces the parsing of a JSON string with a simple
prefix/suffix replacement of the quotes. That is much faster than
allocating memory for a JSON parser.
Where possible, we also directly decode the hex with a decoder to
further reduce the number of allocations.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 25/100

This commit changes how the btcd RPC client parses JSON string responses. Instead of using a full JSON parser to extract quoted strings, it now uses a custom helper that strips the surrounding quote characters directly. The stated goal is performance: fewer memory allocations and faster parsing. The change removes proper JSON validation from several code paths, which could in theory allow malformed or unexpected server responses to be processed incorrectly. However, the commit message frames this purely as an optimization, and no security bug or exploit is demonstrated in the materials.

Lower-priorityrpcclient: add GetTxOutProof{,Async} methodsby Oli · d1a428e3 · Apr 9, 2026 · 2 filesMessage 45 · ThinInformational 17Details
Commit message · Oli

rpcclient: add GetTxOutProof{,Async} methods

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 17/100

This commit adds a new client method to request and decode a Bitcoin proof that a transaction was included in a block. It also adds a small helper that strips surrounding quote characters from a JSON string response instead of fully parsing it. There is no indication in the commit that this fixes a security bug; it appears to be a routine feature addition with a minor parsing optimization.

AI review queuedserver, integration: add unit regression tests for peer lifecycle fixby Or Aharonee · 08be37f3 · Apr 9, 2026 · 2 filesMessage 83 · StrongInformational 12Details
Commit message · Or Aharonee

server, integration: add unit regression tests for peer lifecycle fix

Address review feedback on the peer add/done race fix:

Add three direct unit tests in server_test.go that exercise the fix
without the full server or rpctest harness:

- TestOnVerAckDoubleCall: call OnVerAck twice on the same serverPeer,
assert no panic and verAckCh remains closed.
- TestPeerLifecycleOrdering: verack before disconnect emits peerAdd
then peerDone in order.
- TestPeerLifecycleSimultaneousReady: both verAckCh and Peer.Done()
ready before the handler runs; assert peerDone always arrives and
peerAdd, if emitted, precedes it (100 iterations).

Harden integration tests in sync_race_test.go:

- Check fakePeerConn errors via require.NoError instead of discarding.
- Extract dialAndSendVersion helper for TestPreVerackDisconnect;
check all errors instead of silently continuing.
- Fix comment wording ("produces" -> "is expected to produce").

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
defensive validationfuzzing or regression evidencesecond-pass: broader security terminology
AI analysis · Informational 12/100

This commit only adds and improves regression tests for a previously fixed peer lifecycle race condition. It does not change production code, so it cannot introduce a new vulnerability or directly fix one. The tests verify that a prior fix behaves correctly under edge cases such as duplicate verack messages and peers disconnecting before handshake completion.

Lower-prioritychaincfg/chainhash: add strict parsingby Boris Nagaev · 5fefcc66 · Apr 9, 2026 · 2 filesMessage 78 · AdequateLow 37Details
Commit message · Boris Nagaev

chaincfg/chainhash: add strict parsing

Add NewHashFromStrStrict and DecodeStrict for callers that must
parse full txids or block hashes exactly.

Keep NewHashFromStr and Decode lenient for compatibility, but add
NOTE docs steering typical parsing to the strict helpers.

Add tests for the new strict behavior and preserve coverage for the
existing lenient short and odd hex behavior.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Low 37/100

This commit adds new strict hash-parsing functions to btcd's chainhash package. The existing lenient functions accept shortened or odd-length hex strings and silently pad them with zeros, which can be risky when parsing transaction or block IDs. The new strict helpers require an exact 64-character hex string. The commit does not switch any callers to the strict versions, so it is a defensive API addition rather than an immediate fix for a known vulnerability.

Lower-prioritywire: use MaxProtocolMessageLength as a max size for MsgRejectby Calvin Kim · 28fd6a7f · Apr 6, 2026 · 2 filesMessage 73 · AdequateLow 47Details
Commit message · Calvin Kim

wire: use MaxProtocolMessageLength as a max size for MsgReject

As we introduced a new MaxProtocolMessageLength, MsgReject max size
should also be lowered to MaxProtocolMessageLength.

If this isn't lowered and if we ever have a MsgReject message that is
bigger than MaxProtocolMessageLength, then the MaxPayloadLength() check
on the message will pass but it won't serialize in functions
WriteMessageWithEncodingN() and WriteV2MessageN() as both of these
functions have a separate check that each message isn't greater than
MaxProtocolMessageLength.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 47/100

This commit tightens the maximum allowed size of Bitcoin protocol 'reject' messages so it matches the general message-size limit already used elsewhere. Before the fix, a reject message could claim a legal size under one check but then fail to send under a stricter second check, which could cause inconsistent handling between reading and writing network messages.

Lower-prioritymain: add regtest port for btcwalletby Abdullahi Yunus · 2c19db8a · Mar 30, 2026 · 1 fileMessage 60 · AdequateInformational 20Details
Commit message · Abdullahi Yunus

main: add regtest port for btcwallet

Since btcwallet now supports regtest, we add the default port
`18332`. Now `--wallet` command works on regtest.

60/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 20/100

This commit simply enables the `--wallet` command-line option to work on Bitcoin's regression test network (regtest) by assigning it the default port 18332. Previously, using `--wallet` with `--regtest` produced an error because the companion btcwallet software did not yet support regtest. There is no security issue here; it is a routine feature-enablement change.

Lower-prioritywire: fix IPv4-mapped IPv6 addresses using wrong networkID in addrv2by Calvin Kim · 077c9b7c · Mar 30, 2026 · 1 fileMessage 73 · AdequateModerate 51Details
Commit message · Calvin Kim

wire: fix IPv4-mapped IPv6 addresses using wrong networkID in addrv2

Go's net.ParseIP stores IPv4 addresses as 16-byte IPv4-mapped IPv6
addresses (::ffff:x.x.x.x). NetAddressV2FromBytes dispatches on
address length, so these 16-byte addresses were incorrectly matched
as IPv6 and serialized with networkID 0x02 (IPv6) instead of 0x01
(IPv4). BIP-155 doesn't forbid this, but Bitcoin Core silently drops
them anyway (undocumented, naturally). Detect IPv4-mapped IPv6
addresses and extract the 4-byte IPv4 address with the correct
networkID.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Moderate 51/100

This commit fixes a bug where IPv4 addresses were accidentally advertised as IPv6 addresses on the Bitcoin peer-to-peer network. Because of how Go stores IP addresses internally, a 16-byte IPv4-mapped IPv6 representation was being tagged with the IPv6 network type. Bitcoin Core silently ignores such mixed messages, so affected btcd nodes could have had their address announcements ignored by peers, potentially hurting connectivity and peer discovery. There is no direct evidence this was exploited as an attack.

Lower-prioritywire: add test for IPv4-mapped IPv6 address in NetAddressV2FromBytesby Calvin Kim · 1031309a · Mar 30, 2026 · 1 fileMessage 83 · StrongInformational 12Details
Commit message · Calvin Kim

wire: add test for IPv4-mapped IPv6 address in NetAddressV2FromBytes

Add a test case that passes a 16-byte IPv4-mapped IPv6 address
(::ffff:127.0.0.1) to NetAddressV2FromBytes and asserts that it
is recognized as IPv4 with networkID 0x01, not IPv6 with 0x02.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 12/100

This commit only adds a new unit test to btcd's networking code. It checks that a special IPv6 address format (the IPv4-mapped IPv6 address ::ffff:127.0.0.1) is correctly treated as an IPv4 address. There is no code change that fixes or changes behavior; it only adds a test verifying existing behavior.

AI review queuedwire: separate protocol message limit from serialization boundby Erick Cestari · 5e96c5b3 · Mar 24, 2026 · 2 filesMessage 81 · StrongLow 47Details
Commit message · Erick Cestari

wire: separate protocol message limit from serialization bound

Revert MaxMessagePayload to 32MB and introduce MaxProtocolMessageLength
(~4MB) for p2p network message size enforcement. This mirrors Bitcoin
Core's separation between MAX_SIZE (32MB serialization bound) and
MAX_PROTOCOL_MESSAGE_LENGTH (~4MB network limit) introduced in
bitcoin/bitcoin#5843.

The previous commit reduced MaxMessagePayload to 4MB, but that constant
is also used as a serialization bound for deriving maxTxInPerMessage,
maxTxOutPerMessage, and variable-length string limits in contexts beyond
network messages (e.g. database deserialization via MsgTx.Deserialize).
While consensus limits keep real values well below the 4MB-derived
bounds, conflating the two constants is architecturally incorrect and
diverges from Bitcoin Core's design.

The new MaxProtocolMessageLength is now enforced in all four network
read/write paths: WriteMessageN, WriteMessageWithEncodingN,
ReadMessageWithEncodingN, and ReadV2MessageN (which previously had no
overall message size check).

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
second-pass: broader security terminology
AI analysis · Low 47/100

This commit fixes a design mix-up in btcd's Bitcoin message handling. It restores the general 32 MB serialization safety limit and adds a separate ~4 MB limit specifically for peer-to-peer network messages. It also adds a missing size check for the newer v2 transport message reader. The change is defensive: it prevents very large messages from being accepted over the network while keeping internal database/RPC serialization limits consistent with Bitcoin Core.

Lower-prioritynetsync: add TestIsSyncCandidateRegtestby Olaoluwa Osuntokun · 7f47da83 · Mar 24, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · Olaoluwa Osuntokun

netsync: add TestIsSyncCandidateRegtest

Add a test verifying that isSyncCandidate accepts peers from any
address on regtest, including Docker bridge IPs, remote IPs, and IPv6.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context✓ Mentions testing or verification
AI analysis · Informational 15/100

This commit only adds a new unit test. It does not change any production code, so it cannot introduce a security vulnerability by itself. The test checks that btcd's sync-manager treats all peers as valid sync candidates on the Bitcoin 'regtest' private network, including Docker container addresses and remote IPs. This is expected behavior for regtest, which is meant for local testing and has no real-world Bitcoin value at stake.

Lower-prioritynetsync: allow sync with non-localhost peers on regtest/simnetby Abdullahi Yunus · 26124d27 · Mar 24, 2026 · 1 fileMessage 73 · AdequateLow 31Details
Commit message · Abdullahi Yunus

netsync: allow sync with non-localhost peers on regtest/simnet

In this commit, we remove the localhost-only restriction for sync peer
candidates on regtest and simnet. Previously, isSyncCandidate rejected
any regtest peer not on 127.0.0.1 or localhost, which prevented IBD
when nodes run in Docker containers on bridge networks (e.g. 172.18.0.x).

We also replace fragile pointer-equality checks against global chaincfg
params with value-based Name field comparisons, and extend the exception
to simnet since it has the same local-only usage pattern.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 31/100

This change loosens a network safety rule for two private Bitcoin test networks (regtest and simnet). Previously, nodes on these test networks would only accept initial block download from a peer running on the same computer (localhost). Now they will accept it from any reachable peer, such as another node in a Docker container. This is a deliberate usability fix for testing environments, but it removes a guard that helped prevent untrusted remote peers from feeding blocks to a regtest/simnet node. It is not a vulnerability in the public Bitcoin network (mainnet), which is unaffected.

Lower-priorityaddrmgr: fix IsRoutable for IPv6 addresses starting with 0by Eric Grill · 4a4e2d24 · Mar 24, 2026 · 2 filesMessage 91 · StrongModerate 64Details
Commit message · Eric Grill

addrmgr: fix IsRoutable for IPv6 addresses starting with 0

In this commit, we fix `IsRoutable` to correctly reject IPv6 addresses
whose first 16-bit group is zero (i.e., in the `0000::/16` reserved
block per RFC 4291). Differential fuzzing between btcd and Bitcoin Core
revealed that addresses like `0:9881:8181:8181:fe00:a:9e:9801` were
slipping through as routable when they shouldn't be.

We add a new `zero6Net` (`0000::/16`) definition alongside the existing
`zero4Net`, and introduce an `IsZero` helper that checks both. The /16
prefix width is intentional: the broader /8 reservation would
incorrectly catch allocated sub-ranges like `0064:ff9b::/96` (RFC 6052,
NAT64). We also carve out an exception for RFC 6145 translated IPv4
addresses (`::ffff:0:0:0/96`), which live within `0000::/16` but are
valid for routing.

Test coverage includes the original bug report address, various
zero-prefix IPv6 addresses, the RFC 6145 exclusion, and corresponding
`GroupKey` entries to confirm they land in the "unroutable" bucket.

Fixes #2431

91/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
fuzzing or regression evidence
AI analysis · Moderate 64/100

This commit fixes a bug in btcd's address manager where certain invalid IPv6 addresses starting with '0:' were incorrectly treated as valid internet-routable addresses. These addresses belong to a reserved block that should never be routed. The fix adds a check to reject them, with a special exception for a specific translated-IPv4 range. Because Bitcoin nodes share peer addresses with each other, accepting such addresses could let an attacker pollute the peer database with unusable or specially crafted entries, potentially degrading network connectivity.

Lower-prioritytxscript: switch template engine from html/template to text/templateby Erick Cestari · d36b9ded · Mar 10, 2026 · 1 fileMessage 85 · StrongLow 47Details
Commit message · Erick Cestari

txscript: switch template engine from html/template to text/template

html/template automatically HTML-escapes special characters to prevent
XSS, which can silently corrupt arbitrary script data. Since the output
is binary script bytes and not HTML, this escaping provides no benefit
and might breaks correctness.

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Low 47/100

This commit swaps the template engine used to build Bitcoin scripts from Go's HTML-aware template package to a plain-text template package. The old engine would automatically escape characters like angle brackets and quotes for safe web display, but because the output here is raw binary script data, that escaping could quietly change the bytes produced. The fix removes a source of silent data corruption when users generate transaction scripts from templates.

AI review queuedpeer: add panic recovery to message handling goroutinesby Erick Cestari · 45135e67 · Mar 9, 2026 · 2 filesMessage 73 · AdequateLow 46Details
Commit message · Erick Cestari

peer: add panic recovery to message handling goroutines

Add a recoverFromPanic method that catches panics in peer goroutines,
logs the error with a stack trace, and disconnects the offending peer
instead of crashing the entire node. This provides defense-in-depth
against future unknown panics in message parsing or handling.

Protect two goroutine boundaries:
- The negotiation goroutine in start(), which handles pre-handshake
message decoding via BtcDecode.
- The inHandler goroutine, which processes all post-handshake messages.

Refactor inHandler cleanup from manual end-of-function calls to
defer-based cleanup, ensuring close(p.inQuit) always runs even on
panic, which prevents stallHandler from hanging.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
second-pass: broader security terminology
AI analysis · Low 46/100

This commit adds a safety net to btcd's peer networking code. Previously, a bug in message parsing or handling could crash the entire Bitcoin node. Now, if a peer-handling goroutine panics, the node catches the panic, logs it, and disconnects only the offending peer. It also fixes cleanup so that internal shutdown signals are always sent, even during a panic. The change is defensive and does not by itself fix any known specific crash bug.

Lower-prioritywire: add test for trailing bytes rejection in ReadMessageby Olaoluwa Osuntokun · c64768b2 · Mar 6, 2026 · 1 fileMessage 95 · StrongInformational 12Details
Commit message · Olaoluwa Osuntokun

wire: add test for trailing bytes rejection in ReadMessage

In this commit, we add TestReadMessageTrailingBytes which constructs a
valid version message with 4 garbage bytes appended to the payload. The
wire frame uses a correct checksum over the full dirty payload so that
the checksum validation passes, but the new trailing-bytes check in
readMessageWithEncodingNInternal catches the unconsumed bytes and
returns a MessageError.

95/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
AI analysis · Informational 12/100

This commit only adds a new unit test. It does not change any production code. The test checks that ReadMessage correctly rejects Bitcoin wire messages that have extra garbage bytes appended after the expected payload. The test is verifying behavior that was apparently added in a prior commit (the message mentions a 'new trailing-bytes check'). On its own, this commit is not a security fix and does not introduce a vulnerability.

Lower-prioritywire: enforce full payload consumption in ReadMessageby Olaoluwa Osuntokun · c13dec24 · Mar 6, 2026 · 1 fileMessage 73 · AdequateModerate 64Details
Commit message · Olaoluwa Osuntokun

wire: enforce full payload consumption in ReadMessage

In this commit, we add a strictness check to
readMessageWithEncodingNInternal that verifies all payload bytes were
consumed by BtcDecode. After BtcDecode returns, the remaining length of
the payload buffer is checked, and if any bytes remain unconsumed, the
message is rejected with a MessageError.

Previously, the payload buffer was passed to BtcDecode without any
post-decode validation, meaning any bytes beyond what BtcDecode consumed
were silently ignored. This check ensures wire message payloads are
exactly the size needed for the decoded message, tightening our
conformance to the expected wire format.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Moderate 64/100

This change tightens how btcd reads network messages from other Bitcoin peers. Previously, a peer could tack extra bytes onto the end of a valid message and btcd would silently accept it. Now those messages are rejected. The commit message notes that such trailing bytes could have been stored, for example in the block database, so this closes a potential avenue for injecting unwanted data or causing confusion.

Security candidatewire: bound witness read to remaining slabby Erick Cestari · 3bf00861 · Mar 6, 2026 · 2 filesMessage 83 · StrongHigh 72Details
Commit message · Erick Cestari

wire: bound witness read to remaining slab

Add a bounds check against the remaining slab capacity so oversized
witness items return a decode error. Add a regression test for witness
items that overflow the decode slab.

83/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
memory safetyfuzzing or regression evidence
AI analysis · High 72/100

This commit fixes a bug in btcd's transaction decoding where a malformed Bitcoin transaction could claim witness data larger than the internal decode buffer. Before the fix, this could cause a panic (crash) when the code tried to copy data into a too-small buffer. The patch adds a size check so the transaction is rejected cleanly instead of crashing the node.