BT
← All projectsbtcsuite

btcd

Alternative full-node Bitcoin implementation written in Go.

BitcoinNode implementationsNormal
Repository coverage

261 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.

60security candidates38second-pass queue233AI analyses
0commits · 30 days
48commits · 60 days
134commits · 180 days
248commits · 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.

70/100 average clarity
84Strong · 80–100
109Adequate · 60–79
63Thin · 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 Nagaev702056265
Olaoluwa Osuntokun882078174
Lrifton92434186
Erick Cestari818177
Or Aharonee404184
Oliver Gugger13413047
MPins333079
yyforyongyu322069
Drake Thomsen222091
Eric Grill313086
Julio Cesar111045
Jacob Schuler111088
Analysis record

Published AI watches

Last scanned 51 minutes ago

Informational 0 AI analysisMessage 80 · Strong
BT btcsuitebtcd BitcoinNode implementations

build: pin v0.27.0 nested module releases

This commit only updates build dependency version numbers in go.mod and go.sum. It does not change any application code, so by itself it cannot introduce or fix a security vulnerability. The commit message says it pulls in fixes that were …

01a9e591by Olaoluwa Osuntokun+15−182 files
No security note in commit
Moderate 61 AI analysisMessage 73 · Adequate
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2611 from yyforyongyu/task-btcutil-audit

This commit tightens two safety checks in btcd's helper libraries. First, it makes child key derivation reject rare 'cancellation' cases where a derived private key would become zero or a public key would become the point at infinity—both …

Rejection of zero private scalar and point-at-infinity in BIP32 derivationReconciliation of conflicting witness/non-witness UTXO descriptions in PSBT fee computationAddition of unit tests exercising the new rejection paths
e799ee42by Olaoluwa Osuntokun+254−217 files
No security note in commit
Moderate 57 AI analysisMessage 78 · Adequate
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2655 from yyforyongyu/task/txscript-signature-validation

This commit tightens how Bitcoin script signatures are validated in btcd. It moves several security checks earlier in the process, limits a special 'OP_SUCCESS' shortcut to ordinary tapscript leaves, and fixes the signature-removal logic s…

Moved ScriptVerifyConstScriptCode check before signature parsing in legacy scriptsRestricted OP_SUCCESS shortcut to base tapscript leaf versionFixed removeOpcodeByData to match only data pushes and handle empty dataToRemove
a72ace10by Olaoluwa Osuntokun+90−764 files
No security note in commit
Moderate 69 AI analysisMessage 50 · Thin
BT btcsuitebtcd BitcoinNode implementations

txscript: align signature opcode validation

This commit fixes several subtle inconsistencies in how btcd validates Bitcoin script signatures, especially for newer Taproot-style transactions. It changes when empty signatures and unknown public-key types are rejected, tightens the rul…

Consensus/policy divergence in signature opcode validationTapscript empty-signature and unknown-pubkey-type handling changedScriptVerifyConstScriptCode placement and scope changed
8a2b9165by yyforyongyu+90−764 files
No security note in commit
Low 44 AI analysisMessage 58 · Thin
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2654 from Roasbeef/build/go-1.27.3

This commit updates the Go programming language toolchain used to build btcd from version 1.27.2 to 1.27.3, and bumps the minimum required Go version from 1.26.9 to 1.26.10. The README explicitly says this is to include a mitigation for CV…

Toolchain point-release upgradeREADME references CVE-2026-111943 mitigationMinimum Go version bumped across all go.mod files
a1cc50bdby Olaoluwa Osuntokun+24−1915 files
Vendor flagged security relevance
Low 33 AI analysisMessage 88 · Strong
BT btcsuitebtcd BitcoinNode implementations

build: upgrade Go toolchain to 1.27.3

This commit updates the Go programming language version used to build btcd from 1.27.2 to 1.27.3, and bumps the minimum required Go version from 1.26.9 to 1.26.10. The commit message says this is done to pick up a security fix in Go's cryp…

Toolchain update to a Go point release advertised as fixing CVE-2026-111943 in crypto/x509No application code changes; risk depends entirely on the accuracy of the upstream Go release notesCVE identifier appears fabricated or future-dated (2026) and does not match known public CVE numbering at the time of review
887de811by Olaoluwa Osuntokun+19−1915 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 83 · Strong
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2628 from fametrano/musig2-bip327-vectors

This commit updates the test data and test code for the MuSig2 multi-signature implementation in btcd to match the latest official BIP 327 test vectors. It does not change the cryptographic implementation itself, only the test fixtures and…

No production code changesTest-only data refreshNo vulnerability description in commit or references
ec47ee12by Olaoluwa Osuntokun+67−437 files
No security note in commit
Low 46 AI analysisMessage 68 · Adequate
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2627 from starius/bump-deps

This is a large maintenance update for btcd that upgrades Go and many dependencies, replaces some old external libraries with newer or in-house ones, and fixes several bugs in RPC, Tor proxy, and build processes. Most changes are not secur…

Unauthenticated websocket read limit added (64 KiB) to prevent large-message abuse before authWebsocket authentication timeout added to drop unauthenticated clientsWebsocket write timeout added to prevent slow/stalled clients from hanging server goroutines
c615bd70by Olaoluwa Osuntokun+1848−30952 files
No security note in commit
Low 31 AI analysisMessage 88 · Strong
BT btcsuitebtcd BitcoinNode implementations

rpcserver: detect unexpected replies before websocket shutdown

This commit fixes a test helper in btcd's RPC websocket server. The helper now reads any leftover server response before waiting for the connection to close. Previously, waiting first could let an authentication timeout hide a reply that w…

Test-only hardening against hidden/unexpected RPC repliesUnauthenticated malformed request handling in websocket RPC pathAuthentication timeout may mask server replies
b67710c7by Olaoluwa Osuntokun+4−21 file
No security note in commit
Informational 15 AI analysisMessage 88 · Strong
BT btcsuitebtcd BitcoinNode implementations

btcec/schnorr/musig2: refresh BIP 327 test vectors

This commit only updates test data and test code for the MuSig2 cryptographic signing feature. It refreshes the official Bitcoin BIP 327 test vectors, adjusts the tests to match the new vector format, fixes a test bug where verification wa…

No production code changesTest-only vector refreshTest bug fix in verify-fail signer indexing
f237e882by Ferdinando Ametrano+67−437 files
No security note in commit
Moderate 64 AI analysisMessage 68 · Adequate
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2625 from starius/port-35984

This commit fixes a Bitcoin signing bug in btcd. When creating a transaction signature of type SIGHASH_SINGLE for an input whose index has no matching output, the signature would not actually commit to any output. That means the signature …

SIGHASH_SINGLE without matching output creates signature committing to no outputSignature remains valid if outputs are later mutated, as long as matching output remains absentCould allow funds redirection by anyone holding the signature
bbeb9d41by Olaoluwa Osuntokun+344−04 files
Vendor flagged security relevance
Moderate 61 AI analysisMessage 73 · Adequate
BT btcsuitebtcd BitcoinNode implementations

Merge pull request #2565 from Roasbeef/wire-script-arena

This commit is a large refactoring of how btcd decodes Bitcoin network messages. It replaces a fixed 4 MiB temporary buffer (a 'slab') with a tiered arena allocator and adds checks to avoid reserving huge amounts of memory when a message c…

Replaced fixed 4 MiB decode slab with tiered arena to reduce memory amplification and unbounded free-list retentionAdded truncated-payload guards (validateElementCount, canPreallocateElements, readBytes) to prevent huge preallocation on malformed length/count prefixesCleared TxIn/TxOut on failed MsgTx decode to avoid leaking arena-backed slices to callers
6c52a019by Olaoluwa Osuntokun+2654−20130 files
Vendor flagged security relevance
Low 34 AI analysisMessage 83 · Strong
BT btcsuitebtcd BitcoinNode implementations

rpcclient: preserve transactions during mempool accept validation

This commit fixes a bug in btcd's RPC client where a function that checks whether transactions would be accepted by the mempool was accidentally modifying the caller's transaction data during its internal validation. The fix makes the func…

Mutation of caller-owned input objects in a public APIPotential transaction data corruption or unexpected state change in downstream consumersRegression test added covering both success and failure validation paths
81d3555dby Olaoluwa Osuntokun+68−12 files
No security note in commit
Moderate 61 AI analysisMessage 78 · Adequate
BT btcsuitebtcd BitcoinNode implementations

wire: clear transaction scripts on decode errors

This commit fixes a memory-safety bug in btcd's Bitcoin transaction decoder. When decoding a transaction failed partway through, the partially built transaction could still hold pointers to a shared memory area (an 'arena') used for script…

Use-after-free-like pattern: staged slices referencing a reusable arena after decode failureShared memory pool (script arena) reused across decodesPotential information disclosure or memory corruption if stale arena-backed scripts are accessed
6651b8f3by Olaoluwa Osuntokun+76−184 files
No security note in commit
Informational 15 AI analysisMessage 73 · Adequate
BT btcsuitebtcd BitcoinNode implementations

multi: switch to github.com/decred/dcrd/container/lru

This is a routine dependency update. The project switched from an older, deprecated Decred LRU cache package to a newer typed/generic version. The code behavior is intended to stay the same; no security vulnerability is visible in the chan…

eb8c6c94by Boris Nagaev+28−266 files
No security note in commit
Low 46 AI analysisMessage 78 · Adequate
BT btcsuitebtcd BitcoinNode implementations

multi: replace btcsuite/go-socks with an x/net/proxy wrapper

This commit swaps out an old, unmaintained SOCKS proxy library for a new internal wrapper around a modern Go package. The change is mostly a refactor, but it deliberately fixes several subtle SOCKS/Tor-related behaviors that could affect s…

Replacement of outdated/unmaintained SOCKS dependencyFix for peer whitelisting bypass via proxy RemoteAddr semanticsPer-connection random Tor stream-isolation credentials
4041477cby Boris Nagaev+545−1110 files
No security note in commit
Low 49 AI analysisMessage 73 · Adequate
BT btcsuitebtcd BitcoinNode implementations

config: apply --torisolation to --proxy without credentials

This commit fixes a configuration bug in btcd, a Bitcoin node implementation. When a user enabled Tor stream isolation with --torisolation and used a proxy without a username/password, the isolation was silently not applied. The fix makes …

Privacy configuration silently ignoredTor stream isolation bypassUser expectation mismatch between flags and behavior
f9b34babby Boris Nagaev+41−32 files
Vendor flagged security relevance
Informational 18 AI analysisMessage 83 · Strong
BT btcsuitebtcd BitcoinNode implementations

multi: switch from btcsuite/websocket to gorilla/websocket

This commit swaps btcd's websocket library from an old, unmaintained in-house copy to the actively maintained gorilla/websocket. The only behavior change is that the new library reports a normal peer disconnect differently, so the code now…

Dependency switched from unmaintained fork to maintained upstream websocket libraryBehavior change only in error classification for clean disconnectsNo memory corruption, authentication bypass, or cryptographic weakness visible in diff
63febe36by Boris Nagaev+367−88 files
No security note in commit
Informational 19 AI analysisMessage 73 · Adequate
BT btcsuitebtcd BitcoinNode implementations

multi: replace btcsuite/winsvc with golang.org/x/sys/windows/svc

This commit swaps out an old, unmaintained Windows service helper library for the modern, officially maintained Go equivalent. The main practical effects are that btcd can now be compiled for Windows on ARM64 computers, and the Windows ser…

Dependency on stale/unmaintained Windows service library removedNew dependency is the officially maintained golang.org/x/sys module already present in the buildWindows service creation now sets ErrorControl to ErrorNormal, improving failure visibility
b7d6cd52by Boris Nagaev+10−113 files
No security note in commit
Informational 18 AI analysisMessage 70 · Adequate
BT btcsuitebtcd BitcoinNode implementations

build: bump GitHub Actions

This commit updates the versions of several GitHub Actions used in the project's automated build and release workflows. It moves actions/checkout and actions/setup-go to v7, and updates Docker-related actions to newer pinned releases. The …

Dependency/version bump of CI/CD actionsMove from Node 20 runtime to Node 24 runtime for GitHub ActionsDocker action pins updated from 2021-22 releases to 2024-25 releases
6fe579baby Boris Nagaev+16−163 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-priorityintegration: synchronize p2p lifecycle stress batchesby Olaoluwa Osuntokun · 5a2c5063 · Jul 21, 2026 · 2 filesMessage 83 · StrongInformational 12Details
Commit message · Olaoluwa Osuntokun

integration: synchronize p2p lifecycle stress batches

In this commit, we make each stress wave establish its full set of peers
before disconnecting them together. A ping/pong barrier proves the server
processed each verack, while RPC connection-count barriers prove
registration and removal completed before the next wave starts.

We bound concurrent handshakes from the shared source, drain every worker on
failure, and wait for server-side cleanup. This keeps the test compatible
with the admission limits it exercises and makes a passing run evidence of
the intended NewPeer/DonePeer ordering.

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 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 to production code, so it does not introduce or fix a security vulnerability in the software users run.

Security candidatev2transport: restore responder handshake progressby Olaoluwa Osuntokun · 09717871 · Jul 21, 2026 · 2 filesMessage 78 · AdequateLow 48Details
Commit message · Olaoluwa Osuntokun

v2transport: restore responder handshake progress

In this commit, we send the responder key as soon as the initiator diverges
from the v1 prefix. This avoids the BIP324 deadlock where both sides can wait
for the other to write before the initiator has sent its complete 64-byte
key.

We split key generation and key agreement into separate admission leases,
and release each lease before the intervening network I/O. The regression
test stops after the first mismatch, requires the responder to make
progress, then completes key agreement and verifies the resulting packet
ciphers interoperate.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
secret or key material
AI analysis · Low 48/100

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 each other. The change makes the responder send its own key earlier, after the first byte that differs from the old v1 protocol, and splits expensive cryptographic work into two separately rate-limited phases so the CPU lock is not held across network reads or writes. It is a protocol correctness/DoS-resilience fix rather than a direct theft-of-funds bug.

Lower-priorityserver+inbound: correct inbound admission accountingby Olaoluwa Osuntokun · 95c11c56 · Jul 21, 2026 · 6 filesMessage 73 · AdequateLow 48Details
Commit message · Olaoluwa Osuntokun

server+inbound: correct inbound admission accounting

In this commit, we keep loopback and whitelisted peers inside the ordinary
pending-handshake and V2 source budgets, while preserving their existing
no-ban behavior.

We also derive the listener reservation from the configured peer mode.
Connect-only and simnet nodes now reserve just their permanent peers, while
automatic mode accounts for both its target and addpeers without exceeding
MaxPeers.

Finally, a bound V2 handshake consumes its rate budgets once, but reacquires
the concurrency slot for each CPU-bound responder phase. This keeps rate
limiting scoped to the handshake while bounding both expensive phases.

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

This commit fixes accounting bugs in how btcd counts and limits incoming peer connections. Previously, loopback/whitelisted peers and permanent outbound peers (such as manually added peers) were not correctly counted against connection budgets, which could let a node accept more inbound connections than intended or let special peers bypass per-source rate limits. The patch makes the counts consistent so the configured maximum peer limits are actually enforced for all peer types, while still preserving the existing rule that whitelisted/loopback peers cannot be banned.

Security candidatepsbt: decode base64 packets incrementallyby Olaoluwa Osuntokun · e333817d · Jul 21, 2026 · 2 filesMessage 78 · AdequateLow 41Details
Commit message · Olaoluwa Osuntokun

psbt: decode base64 packets incrementally

In this commit, we decode base64 PSBT packets as a stream instead of
reading the full encoded input into memory first.

The previous aggregate bound reused wire.MaxMessagePayload, even though
BIP-174 doesn't bind PSBT packet size to the P2P message limit. This made
the base64 path reject packets that the raw path accepted. We now feed
decoded bytes through the same per-field parser used for raw packets,
while retaining strict base64 and trailing-data checks.

We also add a regression test with nine individually valid 4,000,000-byte
unknown values to pin raw and base64 parsing to the same behavior.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
signing boundaryaccess controlfuzzing or regression evidencesigning or wallet path
AI analysis · Low 41/100

This commit changes how btcd reads base64-encoded PSBT (Partially Signed Bitcoin Transaction) data. Previously, the code read the entire base64 input into memory before decoding, and it wrongly applied the Bitcoin P2P wire message size limit to PSBT packets. That caused the base64 parser to reject large but otherwise valid PSBTs that the raw binary parser would accept. The new code decodes base64 incrementally as a stream, removes the wire-size bound for base64 PSBTs, and still rejects whitespace, non-canonical characters, and trailing data. A regression test confirms that nine 4 MB unknown fields are accepted via both raw and base64 paths.

Lower-priorityaddress: reject v2-v16 segwit addresses encoded with bech32by Lrifton92 · 27bbee94 · Jul 21, 2026 · 2 filesMessage 83 · StrongModerate 52Details
Commit message · Lrifton92

address: reject v2-v16 segwit addresses encoded with bech32

BIP-350 requires that segregated witness outputs of version 1 through 16
use the bech32m checksum, while only version 0 uses bech32. decodeSegWitAddress
only special-cased versions 0 and 1, so a witness program with version 2-16
encoded using the legacy bech32 checksum decoded successfully, in violation of
the spec and contrary to the BIP-350 reference decoder (which rejects any
non-zero witness version that is not bech32m).

Generalize the version 1 check to cover all versions >= 1, matching the
reference decode() function. Add the relevant BIP-350 INVALID_ADDRESS vectors
(v2 and v16 encoded with bech32) as a regression test; they decoded
successfully before this change and are now rejected.

Signed-off-by: Lrifton92 <Lrifton92@users.noreply.github.com>

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 52/100

This commit fixes a bug in how btcd decodes certain Bitcoin SegWit addresses. Under the BIP-350 standard, newer witness versions (versions 2 through 16) must use a newer checksum called bech32m, but btcd was only enforcing that rule for version 1. As a result, it wrongly accepted v2-v16 addresses encoded with the older bech32 format. The patch now rejects those invalid addresses and adds test cases to prevent the bug from returning. This is a standards-compliance fix; it does not by itself steal funds, but accepting non-standard addresses could lead to wallet or payment-processing mistakes.

Lower-priorityblockchain/indexers: propagate index drop errorsby Olaoluwa Osuntokun · eb603e40 · Jul 20, 2026 · 2 filesMessage 78 · AdequateLow 34Details
Commit message · Olaoluwa Osuntokun

blockchain/indexers: propagate index drop errors

In this commit, we propagate errors returned while cataloging index
buckets, matching the bucket deletion path fixed by the preceding commit.

We also add fault-injected regression coverage for both paths so neither
error can silently report a successful index drop.

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

This commit fixes a bug where an error while listing index buckets during an index drop operation was silently ignored, making the drop appear successful when it actually failed. The fix makes the function return the error to the caller instead of swallowing it, and adds tests to verify both error paths are properly reported.

Lower-priorityblockchain/indexers: fix dropped errorby Lars Lehtonen · ad3b10d1 · Jul 20, 2026 · 1 fileMessage 45 · ThinLow 31Details
Commit message · Lars Lehtonen

blockchain/indexers: fix dropped error

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

This commit fixes a programming mistake where an error from deleting a database bucket was accidentally ignored. The function that drops an index now properly returns the error instead of continuing as if nothing went wrong. A silently ignored failure could leave an index partially deleted or in an inconsistent state, which might cause incorrect behavior later.

Security candidatepsbt: reject nil taproot pointer fieldsby Olaoluwa Osuntokun · 1ead5ba3 · Jul 20, 2026 · 5 filesMessage 68 · AdequateModerate 60Details
Commit message · Olaoluwa Osuntokun

psbt: reject nil taproot pointer fields

In this commit, we extend taproot PSBT serialization and finalization to reject nil script spend signatures, leaf scripts, and BIP32 derivations before any sort or dereference. We return wrapped ErrInvalidPsbtFormat errors so callers can identify malformed packet state without parsing strings.

We also make FindLeafScript reject nil inputs and leaf entries. This keeps both the direct finalizer and MaybeFinalize paths from panicking on malformed in-memory packets.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
secret or key materialsigning boundarysigning or wallet path
AI analysis · Moderate 60/100

This commit fixes a class of crash bugs in btcd's PSBT (Partially Signed Bitcoin Transaction) handling for Taproot transactions. Previously, if certain Taproot-related lists contained a nil (empty) entry, the code would panic when trying to sort, read, or finalize the transaction. The patch now rejects these malformed entries early with a proper error instead of crashing the program. It is a defensive hardening fix rather than a direct theft-of-funds vulnerability, but a crash in a wallet or node could still be disruptive.

Lower-prioritymulti: parse own-DB blocks leniently in getblock and indexer initby Olaoluwa Osuntokun · 4ac2e425 · Jul 20, 2026 · 4 filesMessage 83 · StrongLow 31Details
Commit message · Olaoluwa Osuntokun

multi: parse own-DB blocks leniently in getblock and indexer init

In this commit, we extend the lenient database block parser to the remaining call sites that re-read blocks from the node's own database.

The getblock RPC now copies FetchBlock bytes before its read transaction ends, since database buffers are not valid outside that lifetime. We then strip any legacy trailing data and serve the exact block serialization at every verbosity level. A regression database invalidates its buffer as View returns, pinning the required copy.

The index manager uses the same parser while rolling an index tip back to the main chain. We also place DBBlockFromBytes before its first caller and log legacy trailing data at debug level, since a frequently fetched dirty block should not flood operator logs.

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 validation
AI analysis · Low 31/100

This commit fixes two related bugs in btcd, a Bitcoin node implementation. First, it prevents the getblock RPC from using database memory after it has expired, which could previously cause crashes or corrupted block data. Second, it makes block reading from the node's own database more forgiving of old trailing garbage bytes, so historical blocks written by older btcd versions remain readable. The change is defensive maintenance rather than an active exploit fix, and it includes new tests to verify the behavior.

Security candidatepeer: close late connections after disconnectby Boris Nagaev · 617ebe2b · Jul 18, 2026 · 2 filesMessage 78 · AdequateModerate 50Details
Commit message · Boris Nagaev

peer: close late connections after disconnect

In this commit, we serialize connection association with peer
disconnection. Previously, Disconnect could run before
AssociateConnection, close quit without a socket, and leave a later
connection published with no remaining path that could close it.

We now close connections handed to a peer that is already disconnecting,
and publish the connected flag only after the socket and connection time
are initialized. The tests pin both call orderings and race the
transitions to verify the socket closes exactly once.

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
access control
AI analysis · Moderate 50/100

This commit fixes a race condition in btcd's peer networking code. If a peer was told to disconnect before a network socket had been attached, the socket could later be attached but never closed, leaking the connection. The fix adds a lock so that attaching a socket and disconnecting cannot happen at the same time, and any socket attached after a disconnect is started gets closed immediately instead of being left open.

Lower-priorityserver: centralize inbound handshake admissionby Boris Nagaev · 6c056ec4 · Jul 18, 2026 · 12 filesMessage 68 · AdequateModerate 61Details
Commit message · Boris Nagaev

server: centralize inbound handshake admission

In this commit, we introduce a server-wide admission policy for
incomplete inbound handshakes and the CPU-bound portion of v2 responder
setup. Source accounting uses normalized IPv4 and IPv6 prefixes, while
global, per-source, and concurrent v2 budgets remain independent and
bounded.

Peer construction passes the policy through a small interface only for
inbound v2 responders. Handshake slots release on verack or disconnect,
and the connection manager reserves MaxPeers capacity for automatic
outbound peers.

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

This commit adds a new inbound connection rate-limiting and admission-control system to btcd. It is designed to reduce the risk of denial-of-service attacks where an attacker opens many incomplete handshake connections or forces the server to do expensive v2 transport cryptography for many sources at once. The change caps how many unfinished handshakes a single IP prefix can hold, limits the rate of CPU-heavy v2 responder handshakes both globally and per source, and reserves part of the peer budget for automatic outbound peers so inbound connections cannot starve them.

Lower-priorityconnmgr: bound accepted inbound connectionsby Boris Nagaev · ad8d94e6 · Jul 18, 2026 · 4 filesMessage 78 · AdequateInformational 12Details
Commit message · Boris Nagaev

connmgr: bound accepted inbound connections

In this commit, we add an optional inbound connection limit at the
listener boundary. Each accepted socket owns a slot until Close releases
it exactly once, which makes connection lifetime, rather than accept
rate, the accounting unit.

The default remains unlimited for existing callers. The new tests cover
the configured bound, concurrent admission, callback ordering, and slot
reuse.

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

This commit adds a new optional feature to btcd's connection manager that lets operators set a maximum number of simultaneous inbound connections. It is a defensive hardening change, not a fix for an active vulnerability. The default behavior remains unlimited, so existing users are unaffected unless they explicitly configure a limit.

Lower-priorityv2transport: refactor responder setupby Boris Nagaev · 6cad3935 · Jul 18, 2026 · 2 filesMessage 58 · ThinLow 38Details
Commit message · Boris Nagaev

v2transport: refactor responder setup

In this commit, we split the responder handshake into transport
classification, key setup, and wire completion phases. This lets callers
install a narrow admission interface after the full v2 candidate is
available, while preserving NewPeer compatibility and the existing
transcript.

We also propagate handshake write failures, reject short writes, and
cover v1 fallback, incomplete candidates, admission lifetime, and
end-to-end v2 interoperability.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
AI analysis · Low 38/100

This commit refactors how btcd handles incoming Bitcoin v2 transport handshakes. It adds a new admission-control hook so a responder can decide whether to spend CPU on a v2 handshake only after it has seen enough bytes to confirm the peer is actually attempting v2, not v1. It also fixes two smaller robustness issues: handshake write failures are now propagated to callers, and short writes are explicitly rejected. The change is defensive in nature and appears aimed at preventing CPU-exhaustion attacks and improving error handling, not at introducing new functionality.

Security candidatepsbt: avoid blocking reads and unbounded allocations in NewFromRawBytesby Olaoluwa Osuntokun · 2ddf73f3 · Jul 14, 2026 · 3 filesMessage 73 · AdequateModerate 64Details
Commit message · Olaoluwa Osuntokun

psbt: avoid blocking reads and unbounded allocations in NewFromRawBytes

In this commit, we address two issues with the strict parsing recently
added to NewFromRawBytes.

First, the trailing data check probed the caller supplied reader with a
blocking one byte read. A reader without a Len method (net.Conn,
io.Pipe) that stays open after delivering a complete packet would hang
the parser forever. We now only enforce the check when the reader can
report its remaining length without an additional read, which covers
in-memory readers along with the decoded base64 path. Plain streams are
left positioned directly after the packet, and the reader contract is
now documented on NewFromRawBytes.

Second, the base64 path read the entire input into memory before any
validation ran, so a very large input could force an arbitrarily large
allocation before the first validity check. We now bound the read to
wire.MaxMessagePayload expanded by the base64 encoding overhead.

Along the way, we simplify assertFullyConsumed down to the bytes.Reader
case that all remaining callers use.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing boundarysigning or wallet path
AI analysis · Moderate 64/100

This commit fixes two problems in the way btcd reads Partially Signed Bitcoin Transactions (PSBTs). First, the parser could hang forever when reading from a network connection or pipe because it tried to read one extra byte to check for leftover data. Second, when given a base64-encoded PSBT, it would read the entire input into memory before checking whether it was valid, so a maliciously huge input could force the program to allocate enormous amounts of RAM. The patch limits how much base64 data is read and only checks for trailing bytes when the reader can safely report its remaining length.

AI review queuedblockchain: tolerate trailing bytes when loading stored blocksby Olaoluwa Osuntokun · a3bed5e3 · Jul 14, 2026 · 2 filesMessage 73 · AdequateLow 34Details
Commit message · Olaoluwa Osuntokun

blockchain: tolerate trailing bytes when loading stored blocks

In this commit, we relax the strict block deserialization introduced as
part of the trailing byte hardening. Databases written by older
versions of btcd may have persisted blocks with trailing bytes, so
refusing to load them would prevent a node from ever starting (or
serving such a block) after an upgrade, with no recovery path short of
a full resync.

We instead introduce a new dbBlockFromBytes helper, used by both
initChainState and dbFetchBlockByNode, that deserializes the block
leniently: any trailing bytes are logged, ignored, and excluded from
the serialization cached on the returned block, so downstream consumers
of the raw bytes never observe them.

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

This commit changes btcd so that when it reads old blocks from its own database, it ignores any extra bytes tacked onto the end of the stored block data instead of refusing to start. Older versions of btcd sometimes saved blocks with extra trailing bytes, and a previous stricter change made the node unable to start after an upgrade. The fix logs a warning, drops the extra bytes, and makes sure any cached copy of the block no longer contains them. It does not change how blocks received from the network or RPC are checked.

Security candidatepsbt: test final witness trailing data rejectionby Boris Nagaev · c87168eb · Jul 8, 2026 · 1 fileMessage 55 · ThinLow 38Details
Commit message · Boris Nagaev

psbt: test final witness trailing data rejection

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

This commit adds a new test to the btcd PSBT (Partially Signed Bitcoin Transaction) library. The test checks that when extracting a final Bitcoin transaction from a PSBT, the library rejects a final witness value that has extra trailing bytes after a valid witness stack. Previously, this trailing data might have been silently accepted, which could lead to non-standard or invalid transactions being produced. The commit itself only adds a test, not a fix, so it implies a prior or pending code change that enforces this rejection.

Security candidatepsbt: reject trailing final witness databy Boris Nagaev · 468853e4 · Jul 8, 2026 · 1 fileMessage 45 · ThinModerate 58Details
Commit message · Boris Nagaev

psbt: reject trailing final witness data

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 · Moderate 58/100

This change tightens how a Bitcoin PSBT library extracts final witness data when turning a partially-signed transaction into a finished transaction. Previously, extra bytes after the declared witness stack were silently ignored. Now the library rejects such packets. That prevents malformed or crafted PSBTs from sneaking hidden data into the witness field, which could in some scenarios alter transaction behavior or be used to confuse downstream tools.

Security candidatebtcec/schnorr: reject s >= group order in ParseSignatureby Lrifton92 · 83d081a5 · Jul 7, 2026 · 2 filesMessage 88 · StrongModerate 64Details
Commit message · Lrifton92

btcec/schnorr: reject s >= group order in ParseSignature

ParseSignature documents that it enforces the BIP-340 requirement that
the s component lie in the range [0, n-1], and the r component is
already checked against the field prime accordingly. However, the
overflow return value of s.SetByteSlice was discarded, so an s value
greater than or equal to the group order n was silently reduced modulo
n and accepted instead of being rejected.

This restores parity with the reference implementation in
decred/dcrd/dcrec/secp256k1/schnorr (of which this code is a port) and
with Bitcoin Core, both of which reject such encodings at parse time.
The ErrSigSTooBig error kind is already defined in the imported schnorr
package but was previously unused here.

A regression test covering the s == n and s > n encodings is added; it
fails before this change (the signatures are silently accepted) and
passes after.

Signed-off-by: Lrifton92 <Lrifton92@users.noreply.github.com>

88/100 · StrongMessage clarity
✓ Specific, 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
signing boundarymemory safetyfuzzing or regression evidencesigning or wallet path
AI analysis · Moderate 64/100

This commit fixes a bug in how btcd parses Schnorr (BIP-340) digital signatures. The code was supposed to reject signatures whose 's' number was larger than the allowed group order, but instead it silently wrapped the value around (modulo reduction) and accepted it. This could let invalid signatures pass validation, potentially allowing signature malleability or unexpected behavior in systems relying on strict BIP-340 compliance. The fix checks the overflow flag and now rejects such signatures with the already-defined ErrSigSTooBig error.

Lower-prioritynetsync: avoid clock tick race in sync state testby Boris Nagaev · 0860e42d · Jul 2, 2026 · 1 fileMessage 78 · AdequateInformational 15Details
Commit message · Boris Nagaev

netsync: avoid clock tick race in sync state test

TestSyncStateMachine checked that handleHeadersMsg advanced
lastProgressTime by comparing it against the timestamp written by
startSync. Those two writes can happen within the same clock tick, so
the handler can update the field while time.After still reports false.

Reset lastProgressTime to the zero value before delivering headers and
assert that the handler writes a non-zero value. This keeps the test
focused on the behavior under test without depending on adjacent
time.Now calls producing distinct timestamps.

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

This change only fixes a flaky test. It does not change any production code, so it has no security impact on real users or the network.

Security candidatepsbt: compact witness utxo scripts after parsingby Boris Nagaev · b0ab66fe · Jul 2, 2026 · 2 filesMessage 80 · StrongLow 25Details
Commit message · Boris Nagaev

psbt: compact witness utxo scripts after parsing

wire.ReadTxOut returns PkScript slices backed by its internal 4 MiB
script slab. PSBT inputs keep parsed WitnessUtxo values, so small
scripts could otherwise keep the whole slab live.

Copy the script before storing the TxOut and assert the parsed witness
script has compact capacity.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
signing boundarysigning or wallet path
AI analysis · Low 25/100

This commit fixes a memory-usage issue, not a security vulnerability. When reading PSBT data, the code was keeping a pointer to a large 4 MiB internal memory block even for tiny scripts. The patch copies the small script into its own compact memory slice so the large block can be released. It does not fix a bug that lets an attacker steal funds, crash the program, or bypass validation.

Lower-priorityrpcclient: add cookie file parsing testsby grandpig · 837e8f77 · Jul 1, 2026 · 1 fileMessage 70 · AdequateTriage 0Details
Commit message · grandpig

rpcclient: add cookie file parsing tests

Signed-off-by: grandpig <grandpig@outlook.com>

70/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
Security candidatepsbt: add strict tx value regression testby Boris Nagaev · 0293b6e0 · Jun 26, 2026 · 1 fileMessage 55 · ThinInformational 12Details
Commit message · Boris Nagaev

psbt: add strict tx value regression test

55/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification! No meaningful explanatory body
Why it was queued
signing boundaryfuzzing or regression evidencesigning or wallet path
AI analysis · Informational 12/100

This commit only adds a new test file. It does not change any production code. The test checks that the PSBT parser rejects transaction fields that have extra trailing bytes. Because no actual parser logic is modified, this commit by itself does not fix or introduce a security issue.

Security candidatepsbt: reject trailing data in tx valuesby Boris Nagaev · f945179f · Jun 26, 2026 · 3 filesMessage 45 · ThinModerate 51Details
Commit message · Boris Nagaev

psbt: reject trailing data in tx values

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 · Moderate 51/100

This change tightens how PSBT (Partially Signed Bitcoin Transaction) files are read. Previously, transaction-valued fields could contain extra bytes after the valid transaction data; now the parser rejects such trailing data. This prevents a malformed or crafted PSBT from sneaking in unused bytes that might confuse downstream tools or alter how the PSBT is interpreted.

Lower-priorityblockchain: load database blocks strictlyby Boris Nagaev · 29cfb6ec · Jun 26, 2026 · 1 fileMessage 45 · ThinLow 44Details
Commit message · Boris Nagaev

blockchain: load database blocks strictly

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

This commit changes how btcd reads blocks from its internal database when starting up. Previously it used a loose block parser (wire.MsgBlock.Deserialize) that could accept data with extra trailing bytes. Now it uses btcutil.NewBlockFromBytes, which is stricter and rejects malformed or padded block data. The change is defensive: it makes the node refuse to load a block from disk if the stored bytes are not a clean, exact block. This could prevent certain database corruption or tampering scenarios from being silently accepted at startup.

Lower-priorityrpc: test mempool accept trailing byte rejectionby Boris Nagaev · f3ec349a · Jun 26, 2026 · 1 fileMessage 55 · ThinInformational 17Details
Commit message · Boris Nagaev

rpc: test mempool accept trailing byte rejection

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

This commit only adds a new unit test. It checks that the Bitcoin RPC command testmempoolaccept correctly rejects a transaction hex string that has extra trailing bytes. There is no code fix or behavior change in the main program—just a test verifying existing behavior.