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 50 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-priorityserver: gate handleDonePeerMsg on peerAdded, not VerAckReceivedby Olaoluwa Osuntokun · e6f589e5 · May 12, 2026 · 1 fileMessage 73 · AdequateLow 32Details
Commit message · Olaoluwa Osuntokun

server: gate handleDonePeerMsg on peerAdded, not VerAckReceived

peer.processRemoteVerAckMsg sets verAckReceived=true *before* it
invokes the OnVerAck listener that closes verAckCh. If the peer
disconnects in that window, the peerLifecycleHandler select may
pick Peer.Done() over verAckCh and skip the peerAdd send -- yet
VerAckReceived() still returns true. handleDonePeerMsg would then
call syncManager.DonePeer for a peer that was never NewPeer'd
(sync manager logs a warning and discards).

Add an explicit peerAdded atomic.Bool on serverPeer. Set it in
peerLifecycleHandler after peerAdd has been enqueued. Gate the
syncManager.DonePeer + orphan eviction in handleDonePeerMsg on
peerAdded.Load() so those side effects only fire for peers that
were actually registered.

This tightens the "peerAdd precedes peerDone, or peerAdd is
skipped entirely" invariant from this PR into something explicit
rather than something derived from a flag that races OnVerAck.

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

This commit fixes a subtle internal race condition in btcd's peer-handling logic. Previously, a peer could disconnect at exactly the wrong moment, causing the server to tell its sync manager that a peer had finished even though it had never been properly registered. That produced only a warning and skipped cleanup, but it weakened the invariant that every 'peer done' event matches a prior 'peer add' event. The patch adds an explicit flag so the server only runs cleanup side effects for peers that were actually registered.

AI review queuedserver: guard OnVerAck with sync.Onceby Olaoluwa Osuntokun · f1b95f8f · May 12, 2026 · 1 fileMessage 68 · AdequateLow 25Details
Commit message · Olaoluwa Osuntokun

server: guard OnVerAck with sync.Once

The prior select/default+close() guard on verAckCh is correct only
under the invariant that OnVerAck is invoked from a single goroutine
(peer.processRemoteVerAckMsg on the input handler). The two steps
are not atomic: any future change that invokes listeners off the
input goroutine would let two concurrent callers both observe
default and panic on double-close.

Replace the guard with sync.Once. This makes the close-once
contract obviously correct rather than correct-by-distant-invariant
and drops the dead "called more than once" log path.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
second-pass: broader security terminology
AI analysis · Low 25/100

This commit hardens a Bitcoin peer handshake callback so it cannot accidentally close the same notification channel twice if future code changes call it from multiple goroutines. The old design was safe only because of a distant, unenforced rule about which goroutine could call it. The new design uses Go's sync.Once to make the 'close only once' guarantee obvious and robust. There is no currently reachable bug; it is a defensive correctness fix.

Lower-prioritytxscript: add tests for new P2A awarenessby Olaoluwa Osuntokun · 053fb4c1 · May 12, 2026 · 1 fileMessage 55 · ThinInformational 15Details
Commit message · Olaoluwa Osuntokun

txscript: add tests for new P2A awareness

55/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only adds new test code for an existing feature called P2A (pay-to-anchor) script recognition. It does not change any production code, so it cannot introduce a security vulnerability or fix one on its own. The tests verify that the software correctly identifies a special Bitcoin script type and does not confuse it with other script types.

Lower-prioritytxscript: recognize P2A witness program during script executionby Olaoluwa Osuntokun · 891bcb2d · May 12, 2026 · 2 filesMessage 73 · AdequateModerate 59Details
Commit message · Olaoluwa Osuntokun

txscript: recognize P2A witness program during script execution

In this commit, we modify the execution logic, such that the P2A witness
program doesn't appear as a unknown witness program version. For
execution, we just make sure the script passes.

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

This commit changes how btcd recognizes a new Bitcoin output type called 'pay-to-anchor' (P2A) when checking whether a transaction is allowed to spend it. Before the change, P2A outputs were treated as an unknown future witness version, which could cause btcd to reject valid P2A spends or behave differently from Bitcoin Core. The fix makes btcd explicitly accept P2A spends as valid 'anyone-can-spend' outputs, matching expected network rules. There is no direct evidence in the commit that this is a security bug, but inconsistent script validation between node implementations can lead to chain splits or transaction relay problems.

Lower-prioritybtcutil: add new AddressPayToAnchor addr typeby Olaoluwa Osuntokun · 939b9394 · May 12, 2026 · 6 filesMessage 45 · ThinInformational 18Details
Commit message · Olaoluwa Osuntokun

btcutil: add new AddressPayToAnchor addr type

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

This commit adds support for a new Bitcoin address type called Pay-to-Anchor (P2A). It is a feature addition that lets btcd recognize and encode/decode a specific kind of SegWit address used for transaction fee bumping. There is no indication in the commit that it fixes a security bug or introduces a vulnerability.

Security candidatetxscript: support trivial signing for P2Aby Olaoluwa Osuntokun · 241bf7ca · May 12, 2026 · 1 fileMessage 45 · ThinLow 34Details
Commit message · Olaoluwa Osuntokun

txscript: support trivial signing for P2A

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
signing boundarysigning or wallet path
AI analysis · Low 34/100

This commit adds support in btcd's transaction-signing code for a new Bitcoin output type called P2A (Pay-to-Anchor). P2A outputs are intentionally designed to be 'anyone-can-spend,' meaning no signature is needed to spend them. The change simply tells btcd to return an empty script when asked to sign such an output, rather than failing because it doesn't recognize the type. This is a feature addition to keep btcd compatible with Bitcoin's evolving protocol, not a fix for a vulnerability in the cryptographic sense. However, because P2A outputs are anyone-can-spend by design, any wallet or node that mishandles them could in theory lose funds placed in such outputs, so the change has security-adjacent relevance.

Lower-prioritymempool: add p2a specific policyby Olaoluwa Osuntokun · 2682f2c1 · May 12, 2026 · 2 filesMessage 78 · AdequateLow 32Details
Commit message · Olaoluwa Osuntokun

mempool: add p2a specific policy

P2A is standard if the witness and the sigscript is empty. We make a
smol refactor to be able to write a unit test for the input
standardness.

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

This commit adds a new mempool policy rule for a special Bitcoin output type called Pay-to-Anchor (P2A). It ensures that transactions spending P2A outputs are only accepted into the memory pool if they have empty signature and witness data. It also adds tests confirming the dust threshold for these outputs. There is no direct evidence in the commit that this fixes an active security vulnerability; it appears to be a policy implementation aligning btcd with expected Bitcoin network behavior.

Lower-priorityrpctest: add new e2e test for new P2A behaviorby Olaoluwa Osuntokun · de921aee · May 12, 2026 · 1 fileMessage 70 · AdequateInformational 15Details
Commit message · Olaoluwa Osuntokun

rpctest: add new e2e test for new P2A behavior

We make sure it'll be accepted into the mempool, and can be spent
without a witness.

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

This commit only adds a new integration test file for the recently added Pay-to-Anchor (P2A) feature in btcd. It does not change any production code, consensus rules, or network behavior. The test verifies that P2A outputs can be created, spent without a signature, and that policy rules reject invalid variations (non-empty witness and sub-dust outputs). There is no security vulnerability here.

Lower-prioritytxscript: recognize P2A scripts in ParsePkScriptby Olaoluwa Osuntokun · f26e6bb7 · May 12, 2026 · 1 fileMessage 45 · ThinLow 34Details
Commit message · Olaoluwa Osuntokun

txscript: recognize P2A scripts in ParsePkScript

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

This small update teaches btcd's transaction-script parser to recognize a new Bitcoin output type called 'Pay-to-Anchor' (P2A). Without this change, the parser would treat P2A outputs as unsupported, which could cause btcd to reject or mishandle transactions that use this new output type. The patch also adds a safety check so that scripts without an associated address don't accidentally return a nil address. It is a forward-compatibility / robustness fix rather than a clear-cut vulnerability patch.

Lower-prioritytxscript: add initial awareness of new P2A output scriptby Olaoluwa Osuntokun · e07d161e · May 12, 2026 · 1 fileMessage 50 · ThinLow 35Details
Commit message · Olaoluwa Osuntokun

txscript: add initial awareness of new P2A output script

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Low 35/100

This commit adds support in btcd for a new Bitcoin output type called Pay-to-Anchor (P2A). It is a feature addition, not a fix for a known vulnerability. P2A outputs are designed to be 'anyone-can-spend' scripts used for fee-bumping (CPFP). The change itself appears defensive and correct, but because it introduces a new script class and address type, it could affect how wallets and downstream tools classify transactions. There is no direct evidence in the commit or supplied references that this is a security patch or that it addresses an active exploit.

Security candidatebtcjson: add tests for StringOrArray and Warnings fieldby Olaoluwa Osuntokun · 91cf7b24 · May 12, 2026 · 1 fileMessage 96 · StrongInformational 15Details
Commit message · Olaoluwa Osuntokun

btcjson: add tests for StringOrArray and Warnings field

Add a regression test for the StringOrArray.MarshalJSON infinite-recursion
fix that exercises both the direct method call and the path through
json.Marshal. Without the fix, the test triggers a goroutine stack
overflow.

Also add a round-trip test and tests for the new Warnings field on
GetBlockChainInfoResult, covering both the legacy single-string form and
the post-bitcoin#29845 array form.

96/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✓ Names security-relevant behavior explicitly
Why it was queued
memory safetyfuzzing or regression evidence
AI analysis · Informational 15/100

This commit only adds new test code for a previously fixed bug. It does not change any production code, so it cannot introduce or fix a live security issue on its own. The tests verify that a type called StringOrArray can be safely converted to JSON without getting stuck in infinite recursion, and that a 'warnings' field can accept either a single string or a list of strings.

Lower-prioritybtcjson: add Warnings field to GetBlockChainInfoResultby Eric Grill · 63924193 · May 12, 2026 · 2 filesMessage 81 · StrongInformational 19Details
Commit message · Eric Grill

btcjson: add Warnings field to GetBlockChainInfoResult

Bitcoin Core added a warnings field to getblockchaininfo in PR #10858,
and recently changed it from a string to an array in PR #29845. Add
the field using StringOrArray type to handle both formats.

This allows rpcclient to properly unmarshal getblockchaininfo responses
from all Bitcoin Core versions.

Closes #2444

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
AI analysis · Informational 19/100

This commit adds a missing 'Warnings' field to btcd's JSON-RPC response structure for getblockchaininfo. It is a compatibility fix so btcd can parse responses from Bitcoin Core versions that include this field, whether it is a single string or an array of strings. There is no security vulnerability here.

Security candidatebtcjson: fix infinite recursion in StringOrArray.MarshalJSONby Eric Grill · b528a353 · May 12, 2026 · 1 fileMessage 86 · StrongLow 39Details
Commit message · Eric Grill

btcjson: fix infinite recursion in StringOrArray.MarshalJSON

The MarshalJSON method was calling json.Marshal(h) where h is of type
StringOrArray. Since StringOrArray implements json.Marshaler, this
caused json.Marshal to call MarshalJSON again, resulting in infinite
recursion and a stack overflow.

Fix by converting to the underlying []string type before marshaling,
which breaks the interface lookup cycle.

Closes #2369

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

86/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
memory safety
AI analysis · Low 39/100

This commit fixes a bug where a piece of code responsible for turning a list of text strings into JSON format accidentally called itself forever, eventually crashing the program with a stack overflow. The fix changes the code to convert the custom type to a plain list of strings before handing it to the JSON encoder, breaking the endless loop.

Lower-prioritytests: fix stale regtest assumptions after #2467by Boris Nagaev · 74f48480 · May 6, 2026 · 3 filesMessage 98 · StrongInformational 15Details
Commit message · Boris Nagaev

tests: fix stale regtest assumptions after #2467

PR #2467 changed regtest to match Core's BIP34/65/66 activation rules, and
the merged stack carries that (commit cd4e5426 "regtest: align activations
with Bitcoin Core"). Height-1 regtest blocks now need a BIP34-compliant
coinbase height and a post-BIP66 block version.

The failing tests came from commits added after PR #2467 was opened on
December 25, 2025 but before it merged on April 30, 2026:

- c1a46122 ("blockchain: add ProcessBlockHeader")
- f9645f07 ("blockchain: reuse existing header node in maybeAcceptBlock")
- dc6e096c ("netsync: add TestSyncStateMachine for end-to-end IBD sync flow")
- ce094262 ("netsync: add TestStartSyncBlockFallback for block-only sync path")
- 2aae8a6d ("netsync: add TestStartSyncChainCurrent for chain-current noop path")

Because those tests landed later, they kept the old regtest assumptions even
though #2467 had already been authored and tested against the older tree.
Once #2467 finally merged, these newer tests started building invalid regtest
blocks and headers.

Fix them by setting the genesis tip height to 0 before generating descendants,
using Version 4 in the regtest block/header helpers, and encoding the test
coinbase height with a minimal BIP34 push plus padding for the generic coinbase
script-length rule.

98/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
AI analysis · Informational 15/100

This commit fixes broken test code, not production code. After an earlier change made the regtest network follow stricter block-version and coinbase-height rules, several newer tests were still creating fake blocks the old way, causing them to fail. The patch updates those test helpers to produce valid regtest blocks and headers. There is no security issue in live software.

AI review queuedmake fmtby Boris Nagaev · 51944b27 · May 6, 2026 · 3 filesMessage 0 · OpaqueInformational 15Details
Commit message · Boris Nagaev

make fmt

0/100 · OpaqueMessage clarity
! Very short subject! Too few words to establish purpose! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 15/100

This commit only reformats code to match the project's style rules. It changes whitespace and indentation in three files and removes one blank line. There are no functional changes, no bug fixes, and no security implications.

Lower-priorityrpcclient: resolve all batch futures if Send failsby Boris Nagaev · fac1a225 · May 6, 2026 · 2 filesMessage 83 · StrongModerate 50Details
Commit message · Boris Nagaev

rpcclient: resolve all batch futures if Send fails

Batch requests were only clearing batchList on Send() errors. The
per-request futures remained unresolved, so callers waiting on Receive
could block forever after a failed batch round trip.

Add failBatchRequests to fan out the Send() error to every queued batch
request and clear tracking state in one place. A regression test now
verifies queued futures complete with the same error returned by Send().

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
fuzzing or regression evidence
AI analysis · Moderate 50/100

This commit fixes a bug in btcd's RPC batch client. Previously, if sending a batch of RPC requests failed (for example, due to a network or server error), the client would clear its internal list of batched requests but would never signal the failure to each individual request's 'future' result object. Callers waiting for results could therefore block forever. The patch adds a helper that fans out the Send() error to every queued request and clears tracking state in one place, plus a regression test verifying queued futures complete with the same error.

Lower-priorityrpcclient: avoid duplicate batch POST handlersby Boris Nagaev · 1f00e1a3 · May 6, 2026 · 2 filesMessage 78 · AdequateLow 44Details
Commit message · Boris Nagaev

rpcclient: avoid duplicate batch POST handlers

NewBatch called New() and then called start() again. In HTTP POST mode that
created a second sendPostHandler and another shutdown-cancel goroutine, which
broke the expected single-flight serialization of POST sends.

Keep NewBatch as a semantic toggle only: rely on New() to start handlers
once, then set batch=true. A regression test now checks that batch POST
requests stay serialized through one active transport call.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
AI analysis · Low 44/100

This commit fixes a bug in btcd's RPC batch client where creating a batch client accidentally started two background goroutines for sending HTTP POST requests instead of one. That broke the intended single-file behavior: two RPC requests could be sent at the same time rather than one at a time. The patch makes NewBatch simply turn on batch mode instead of starting the handlers again, and adds a test to confirm only one POST is in flight at a time.

Lower-priorityrpcclient: support canceling in-flight http requestsby Matt Leon · 5b189f5f · May 6, 2026 · 2 filesMessage 83 · StrongLow 33Details
Commit message · Matt Leon

rpcclient: support canceling in-flight http requests

Use a shutdown-aware context for HTTP POST handling so shutdown can
interrupt in-flight requests.

Centralize shutdown error remapping in sendPostRequestAndRespond so all
error exits consistently return ErrClientShutdown when shutdown causes a
context cancellation. Move the retrying HTTP POST path into
sendPostRequestWithRetry and cover it with shutdown regression tests.

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
fuzzing or regression evidence
AI analysis · Low 33/100

This commit improves how the btcd RPC client shuts down when using plain HTTP POST mode. Previously, an in-flight HTTP request could keep running after the client was asked to shut down, potentially making shutdown hang or wait for a network timeout. The change wires the shutdown signal into the HTTP request context so that pending requests are cancelled immediately, and it adds tests to confirm shutdown interrupts requests during retries and while reading response bodies.

Lower-priorityrpcclient: avoid double-resolving POST requests on shutdownby Boris Nagaev · 13ccec2c · May 6, 2026 · 2 filesMessage 83 · StrongLow 42Details
Commit message · Boris Nagaev

rpcclient: avoid double-resolving POST requests on shutdown

When shutdown races with sendPostRequest, a request could be marked
as ErrClientShutdown and still be enqueued. The sendPostHandler cleanup
loop would then try to send a second terminal response and could block
forever on a full response channel.

Fix this by prioritizing the shutdown path. First check shutdown with a
non-blocking select and return immediately when it is already closed.
Then use a second select to choose between enqueue and shutdown for the
remaining race window.

A regression test verifies a shutdown request is failed immediately and
never enqueued.

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
fuzzing or regression evidence
AI analysis · Low 42/100

This commit fixes a race condition in btcd's RPC client that could cause the client to hang forever during shutdown. When the client was shutting down at the same moment a request was being sent, the old code could both mark the request as failed due to shutdown and still place it in the outgoing queue. A cleanup loop would later try to send a second response on a channel that was already full, blocking indefinitely. The fix prioritizes the shutdown path so requests are failed immediately and never queued once shutdown has started. A regression test was added to confirm the behavior.

Lower-prioritytxscript: support latest Core tx_invalid semanticsby Olaoluwa Osuntokun · 4d03fb1e · Apr 29, 2026 · 1 fileMessage 65 · AdequateInformational 13Details
Commit message · Olaoluwa Osuntokun

txscript: support latest Core tx_invalid semantics

Handle BADTX sanity cases while keeping tx_invalid on Bitcoin Core's
included-flags convention.

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 13/100

This commit only changes a test file in btcd. It adds helper functions so that btcd's transaction-script test runner can understand newer Bitcoin Core test vectors marked 'BADTX' (context-free invalid transactions). No production code is modified, so this cannot directly affect live Bitcoin nodes or wallets.

Lower-prioritytxscript: return ErrCleanStack for witness cleanstack failuresby Olaoluwa Osuntokun · 02358960 · Apr 29, 2026 · 1 fileMessage 83 · StrongInformational 19Details
Commit message · Olaoluwa Osuntokun

txscript: return ErrCleanStack for witness cleanstack failures

The refreshed Bitcoin Core script reference tests expect witness
clean-stack failures to report CLEANSTACK rather than a generic
EVAL_FALSE result.

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

This is a tiny one-line change in btcd's transaction-script engine. It swaps the error code returned when a SegWit (witness) script leaves extra items on the stack after execution. Previously the code reported a generic 'evaluation returned false' error; now it reports the more specific 'clean stack' error expected by Bitcoin Core's reference test suite. The commit message frames this as test-compatibility, not a security fix, and the change does not alter whether a transaction is accepted or rejected—only which diagnostic error is produced.

Lower-prioritytxscript: align empty CHECKSIG pubkey validation with Coreby Olaoluwa Osuntokun · af7f3792 · Apr 29, 2026 · 1 fileMessage 83 · StrongLow 46Details
Commit message · Olaoluwa Osuntokun

txscript: align empty CHECKSIG pubkey validation with Core

The refreshed Bitcoin Core script reference tests cover cases where an
empty CHECKSIG input must still fail pubkey encoding checks before the
interpreter falls back to a generic false result.

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

This change fixes a subtle mismatch between btcd and Bitcoin Core in how they handle a specific edge case in transaction script validation. When a signature is empty in a CHECKSIG operation, btcd previously skipped checking whether the provided public key was properly encoded and simply returned 'false'. Bitcoin Core, however, checks the public key encoding first and fails the script if the key is malformed. This patch makes btcd behave the same way, which is important for keeping all Bitcoin nodes in agreement about which transactions are valid.

Lower-prioritytxscript: use finalOpcodeData for nested P2SH redeem script extractionby Olaoluwa Osuntokun · 63772e52 · Apr 29, 2026 · 2 filesMessage 73 · AdequateHigh 70Details
Commit message · Olaoluwa Osuntokun

txscript: use finalOpcodeData for nested P2SH redeem script extraction

Both NewEngine and GetWitnessSigOpCount used sigScript[1:] (a raw byte
suffix of the scriptSig) to identify the candidate redeem script for
nested P2SH witness detection. GetPreciseSigOpCount and the existing
P2SH execution path already get the redeem script as the final pushed
element of the push-only scriptSig (via finalOpcodeData and
savedFirstStack[len-1] respectively). This commit consolidates the
nested-witness detection sites to use finalOpcodeData(0, scriptSig) so
all three places agree on what the redeem script is.

As a side effect of using the actual redeem script for detection, the
len(witness) != 0 precondition in NewEngine becomes redundant — the
redeem script's shape alone determines whether the spend is nested
witness, and verifyWitnessProgram already enforces the required
witness-stack shape downstream.

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

This commit fixes how btcd recognizes 'nested' SegWit transactions wrapped inside older P2SH outputs. Previously, two code paths guessed the redeem script by taking a raw slice of the signature script starting at the second byte (sigScript[1:]). That shortcut can mis-identify the redeem script when the signature script has more than one data push or unusual encoding. The patch makes all three relevant code paths agree: the redeem script is the last data push in the signature script. It also removes the requirement that a witness stack must be present to treat an input as nested SegWit, and tightens the malleability check so the signature script must be exactly one canonical push of the witness program. A related change makes unknown future SegWit versions enforce a clean stack instead of silently disabling SegWit behavior.

Lower-prioritytxscript: support latest Core tx_valid semanticsby Olaoluwa Osuntokun · 9d93e3d6 · Apr 29, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · Olaoluwa Osuntokun

txscript: support latest Core tx_valid semantics

Bitcoin Core's tx_valid vectors now specify flags to exclude from the
full script-flag set. Apply that parser directly in TestTxValidTests.

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

This commit only changes a test file so that btcd's internal test suite correctly reads the latest Bitcoin Core reference test vectors. It does not alter any production transaction-validation code, consensus rules, or network-facing behavior. There is no security issue here.

Lower-prioritytxscript: reject OP_CODESEPARATOR in unexecuted branches for non-segwitby Olaoluwa Osuntokun · 8ee32c69 · Apr 29, 2026 · 3 filesMessage 73 · AdequateLow 44Details
Commit message · Olaoluwa Osuntokun

txscript: reject OP_CODESEPARATOR in unexecuted branches for non-segwit

In this commit, we fix a policy-level divergence with Bitcoin Core when
handling OP_CODESEPARATOR inside unexecuted OP_IF branches in non-segwit
scripts with the ScriptVerifyConstScriptCode flag.

Bitcoin Core's EvalScript (interpreter.cpp:474-476) places the
SCRIPT_VERIFY_CONST_SCRIPTCODE check for OP_CODESEPARATOR before the
fExec branch-execution gate, causing it to fire unconditionally on every
OP_CODESEPARATOR encountered during script iteration -- even inside
OP_FALSE OP_IF ... OP_ENDIF envelopes.

Previously, btcd's equivalent check lived inside the opcodeCodeSeparator
handler, which was never reached for opcodes in unexecuted branches due
to the early return in executeOpcode that skips non-conditional opcodes
when isBranchExecuting() is false. This meant a script like:

OP_FALSE OP_IF OP_CODESEPARATOR OP_ENDIF <validation>

would be rejected by Bitcoin Core's mempool but accepted by btcd's.

The fix moves the check before the branch-execution gate in
executeOpcode, matching Bitcoin Core's structure. This follows the
existing pattern in btcd where isOpcodeDisabled and isOpcodeAlwaysIllegal
checks already fire regardless of branch execution state.

Note: SCRIPT_VERIFY_CONST_SCRIPTCODE is purely a policy flag (included
in STANDARD_SCRIPT_VERIFY_FLAGS but not MANDATORY_SCRIPT_VERIFY_FLAGS),
so this was not a consensus divergence. Both implementations would accept
such transactions if mined in a block.

Found via differential fuzzing by Bruno from bitcoinfuzz.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
fuzzing or regression evidence
AI analysis · Low 44/100

This commit fixes a minor policy-level mismatch between btcd and Bitcoin Core. A special script command called OP_CODESEPARATOR, when placed inside an 'IF' branch that never runs, was being rejected by Bitcoin Core's mempool but accepted by btcd. The change makes btcd reject it too, but only as a mempool policy rule—not a consensus rule—so already-mined transactions would still be valid to both. It was found through automated fuzz testing.