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

Lower-prioritywire: Reduce MaxMessagePayload to 4MBby Erick Cestari · 20378648 · Mar 6, 2026 · 1 fileMessage 60 · AdequateLow 37Details
Commit message · Erick Cestari

wire: Reduce MaxMessagePayload to 4MB

To align with Bitcoin Core, reduce the maximum message payload size from
32MB to 4MB.

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

This commit lowers the largest single network message btcd will accept from 32 MB down to 4 MB, matching the limit used by Bitcoin Core. The change is a hardening/configuration alignment, not a fix for a known active attack. It mainly reduces the memory and processing exposure from a peer sending an oversized protocol message, which could help mitigate denial-of-service or memory-pressure issues. There is no direct evidence in the commit that a specific vulnerability was being exploited.

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.

Lower-prioritywire: skip IPv4-mapped IPv6 addresses in addrv2 messagesby Erick Cestari · 40eea632 · Mar 6, 2026 · 2 filesMessage 83 · StrongModerate 51Details
Commit message · Erick Cestari

wire: skip IPv4-mapped IPv6 addresses in addrv2 messages

This issue was discovered through differential fuzzing between btcd and
Bitcoin Core.

IPv4-mapped IPv6 addresses (::ffff:0:0/96, RFC 4291) sent with networkID
0x02 (IPv6) in addrv2 messages are now properly rejected. Per BIP155,
these addresses should use networkID 0x01 (IPv4) instead. This aligns
btcd's behavior with Bitcoin Core's addrv2 handling.

Changes:
- Add ipv4MappedPrefix constant for the ::ffff:0:0/96 prefix
- Add isIPv4Mapped() helper function to detect these addresses
- Update readNetAddressV2() to skip IPv4-mapped addresses with IPv6 networkID
- Add comprehensive test coverage for IPv4-mapped address detection

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

This commit fixes a network-address handling bug in btcd, a Bitcoin implementation. When another node sent an IPv4 address disguised as an IPv6 address inside newer 'addrv2' peer messages, btcd would accept it. The change makes btcd reject those mismatched addresses, matching the behavior of the main Bitcoin Core software. This prevents inconsistent address records from spreading between nodes and avoids potential confusion or attacks that rely on address format tricks.

Lower-priorityaddrmgr: treat RFC7343 (ORCHIDv2) addresses as unroutableby Erick Cestari · 52e7b26a · Mar 6, 2026 · 2 filesMessage 83 · StrongLow 40Details
Commit message · Erick Cestari

addrmgr: treat RFC7343 (ORCHIDv2) addresses as unroutable

This issue was discovered through differential fuzzing between btcd and
Bitcoin Core.

Add detection and filtering of IPv6 ORCHIDv2 addresses as defined by
RFC7343 (2001:20::/28). These addresses are overlay routable
cryptographic hash identifiers and should not be treated as routable
peer addresses, consistent with Bitcoin Core's behavior.

Changes:
- Add rfc7343Net variable for the 2001:20::/28 address block
- Add IsRFC7343() function to detect ORCHIDv2 addresses
- Update IsRoutable() to exclude RFC7343 addresses
- Add comprehensive test coverage for RFC7343 detection
- Fix incorrect error message in TestIPTypes (IsRFC1918 -> IsRFC6145)

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

This commit fixes a network-address classification bug in btcd, a Bitcoin implementation. It makes sure a special type of IPv6 address (ORCHIDv2, defined in RFC 7343) is treated as non-routable, so btcd will not try to connect to it as a regular peer. The change aligns btcd with Bitcoin Core and was found by comparing the two implementations through differential fuzzing.

Lower-prioritynetsync: add TestStartSyncChainCurrent for chain-current noop pathby Calvin Kim · 2aae8a6d · Feb 26, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Calvin Kim

netsync: add TestStartSyncChainCurrent for chain-current noop path

Verify that startSync does not set syncPeer or ibdMode when the
chain tip is recent and no peer advertises a height above ours.

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ 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, fix a bug, or alter behavior. The test checks that the Bitcoin sync manager does nothing when the local chain is already up to date and no peer has a higher block height. There is no security issue here.

Lower-prioritynetsync: add TestStallNoDisconnectAtSameHeight for stall handlerby Calvin Kim · 570d3c8d · Feb 26, 2026 · 1 fileMessage 50 · ThinInformational 15Details
Commit message · Calvin Kim

netsync: add TestStallNoDisconnectAtSameHeight for stall handler

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
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 or fix one directly. The test checks that the sync manager does not disconnect a peer that is at the same block height when a stall is sampled.

Lower-prioritynetsync: add TestStartSyncBlockFallback for block-only sync pathby Calvin Kim · ce094262 · Feb 26, 2026 · 1 fileMessage 83 · StrongInformational 14Details
Commit message · Calvin Kim

netsync: add TestStartSyncBlockFallback for block-only sync path

Verify that startSync skips header download and directly requests
blocks when the header chain is already caught up to the peer's
height but the block chain lags behind.

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

This commit only adds a new unit test to the Bitcoin-related btcd project. It checks that when the header chain is already up-to-date but the actual block chain is behind, the sync manager skips downloading headers and directly requests blocks. There is no change to production code, no bug fix, and no security-relevant behavior change.

Lower-prioritynetsync: add TestSyncStateMachine for end-to-end IBD sync flowby Calvin Kim · dc6e096c · Feb 26, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Calvin Kim

netsync: add TestSyncStateMachine for end-to-end IBD sync flow

Tests the full IBD state machine: startSync → fetchHeaders →
handleHeadersMsg → fetchHeaderBlocks → handleBlockMsg → IBD complete.

Three sub-cases exercise different paths:
- fresh IBD from genesis
- node restart with partially synced blocks
- stalled sync peer recovery via handleStallSample

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

This commit only adds a new automated test file for the Bitcoin sync manager. It does not change any production code, so it cannot introduce a security vulnerability or fix one in the running software. The change is purely defensive testing: it simulates various Initial Block Download (IBD) scenarios to make sure the sync logic behaves correctly.

Lower-prioritynetsync: rename headersFirstMode to ibdModeby Calvin Kim · 0b1c7b7a · Feb 26, 2026 · 2 filesMessage 68 · AdequateInformational 15Details
Commit message · Calvin Kim

netsync: rename headersFirstMode to ibdMode

ibdMode is a more fitting name than headersFirstMode since all blocks
are downloaded headers-first during the initial block download.

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

This commit is a simple rename of an internal variable from 'headersFirstMode' to 'ibdMode' (short for 'initial block download mode') and updates related comments. No behavior of the Bitcoin node software changes; it is purely a code clarity and naming improvement.

Lower-prioritynetsync: update handleBlockMsgby Calvin Kim · 9530eda3 · Feb 26, 2026 · 1 fileMessage 58 · ThinInformational 23Details
Commit message · Calvin Kim

netsync: update handleBlockMsg

handleBlockMsg is updated to not be based off of the headerList and
sm.nextCheckpoint when doing operations related to checkpoints and
headers.

58/100 · ThinMessage clarity
✓ Descriptive subject✓ Provides detailed explanatory context
AI analysis · Informational 23/100

This commit refactors how btcd's network sync manager handles incoming blocks during the initial blockchain download. It moves checkpoint/header-list logic into a helper function and changes the conditions for switching from 'headers-first' mode to normal mode. The change appears to be a code cleanup and logic simplification rather than a clear security fix. There is no explicit security claim in the commit message or diff.

Lower-prioritynetsync: change startSync to be based off of processed headersby Calvin Kim · 46574cc7 · Feb 26, 2026 · 1 fileMessage 73 · AdequateLow 31Details
Commit message · Calvin Kim

netsync: change startSync to be based off of processed headers

ince we now utilize ProcessBlockHeaders, we change the startSync
function to utilize the block index for downloading blocks/headers
instead of using the headerList in SyncManager.

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

This commit refactors how the Bitcoin node decides which peer to sync blocks from. It switches the sync logic to rely on the new 'processed headers' state rather than the older internal header list. The change removes direct handling of SegWit peer filtering, checkpoint-based headers-first mode, and some equality fallback logic, delegating those concerns to helper functions like fetchHigherPeers, fetchHeaders, and fetchHeaderBlocks. There is no explicit security fix described in the commit, but any refactor of consensus-critical sync code carries a risk of subtle bugs that could affect which blocks a node accepts.

Lower-prioritynetsync: remove unused headerList and checkpoint codeby Calvin Kim · 5af7680b · Feb 26, 2026 · 1 fileMessage 73 · AdequateInformational 14Details
Commit message · Calvin Kim

netsync: remove unused headerList and checkpoint code

Since we no longer utilize the headerList for doing headers-first
download and checkpoint tracking, we remove related code.

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

This commit is a routine cleanup that removes leftover code for a 'headers-first' download mode and checkpoint tracking that is no longer used. There is no security issue here; it simply deletes unused fields and helper functions to make the code smaller and easier to maintain.

AI review queuednetsync: require peer argument in fetchHeaderBlocksby Calvin Kim · 8588a251 · Feb 26, 2026 · 2 filesMessage 85 · StrongLow 42Details
Commit message · Calvin Kim

netsync: require peer argument in fetchHeaderBlocks

Refactor fetchHeaderBlocks and buildBlockRequest to take an explicit
peer parameter instead of implicitly using sm.syncPeer. This makes the
caller responsible for choosing which peer to fetch from and adds a nil
guard to prevent a panic if the sync peer has been cleared.

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
second-pass: broader security terminology
AI analysis · Low 42/100

This change is a defensive refactor in btcd's network synchronization code. It makes a block-downloading helper function take the target peer as an explicit argument instead of silently relying on a shared 'sync peer' field. It also adds checks so the function does nothing if that peer is missing, preventing a program crash (panic) in cases where the sync peer has been disconnected or cleared. There is no direct evidence this fixes an actively exploitable remote vulnerability, but it removes a crash path during peer churn.

Lower-priorityintegration: add reorg regression test for fetchHeaderBlocks fork pointby Calvin Kim · 71792688 · Feb 26, 2026 · 1 fileMessage 83 · StrongInformational 15Details
Commit message · Calvin Kim

integration: add reorg regression test for fetchHeaderBlocks fork point

This tests that after two nodes diverge and reconnect, the shorter
node downloads blocks starting from the fork point rather than its
current height. It verifies the reorg completes, both nodes
converge, and the orphaned fork appears as a side chain via
getchaintips.

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 · Informational 15/100

This commit only adds a new regression test file. It does not change any production code, so it cannot by itself introduce a security vulnerability or fix one. The test documents a previously fixed bug in block reorganization handling and verifies the fix remains effective.

Lower-prioritynetsync: change fetchHeaderBlocks to be based on the processed block headersby Calvin Kim · dc90f8ca · Feb 26, 2026 · 2 filesMessage 73 · AdequateLow 48Details
Commit message · Calvin Kim

netsync: change fetchHeaderBlocks to be based on the processed block
headers

We introduce buildBlockRequest that'll create a getdata message based
off of the block index instead of the headerList in SyncManager.

The new fetchHeaderBlocks utilizes buildBlockRequest and now will create
fetch requests based on the processed block headers.

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 a bug in btcd's block-download logic. Previously, when the node asked its sync peer for blocks, it could accidentally request the same blocks twice if a routine refill triggered while those blocks were still in-flight. The duplicate block would then be treated as 'unrequested' and the peer would be disconnected, slowing or stalling synchronization. The fix builds block requests from the processed header chain and skips any blocks already marked as requested.

Lower-priorityblockchain: add BestChainHeaderForkHeight to return the fork point between the best chain and the best header chainby Calvin Kim · 28b6690c · Feb 26, 2026 · 1 fileMessage 65 · AdequateInformational 13Details
Commit message · Calvin Kim

blockchain: add BestChainHeaderForkHeight to return the fork point
between the best chain and the best header chain

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

This commit adds a new read-only helper function that reports where the chain of fully-downloaded blocks and the chain of known block headers last shared a common block. It does not change any existing behavior, fix a bug, or alter security logic. It simply exposes information already maintained internally so other code can use it for block downloads after reorganizations.

Lower-prioritynetsync: use ProcessBlockHeader in handleBlockHeaderby Calvin Kim · 26c24592 · Feb 26, 2026 · 1 fileMessage 65 · AdequateLow 32Details
Commit message · Calvin Kim

netsync: use ProcessBlockHeader in handleBlockHeader

Instead of the old headerList based header processing, we make use of
the new ProcessBlockHeader function.

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

This commit refactors how btcd handles incoming block headers during peer synchronization. It replaces a custom header-list processing path with a centralized `ProcessBlockHeader` function. The most notable behavioral change is that the code no longer disconnects peers merely for sending headers when the node is not in 'headers-first sync' mode. This could allow unrequested headers to be processed, but the actual validation work is now delegated to the chain's standard header verification logic. There is no explicit security claim in the commit, and the change appears primarily architectural.

Lower-prioritynetsync: add isInIBDModeby Calvin Kim · 51576a44 · Feb 26, 2026 · 2 filesMessage 51 · ThinInformational 12Details
Commit message · Calvin Kim

netsync: add isInIBDMode

isInIBDMode returns if the SyncManager needs to download blocks and sync
to the latest chain tip.

It determines if it's in ibd mode by checking if the blockchain thinks
we're current and if we don't have peers that are at higher advertised
blocks.

51/100 · ThinMessage clarity
✓ Subject identifies a change✓ Provides detailed explanatory context
AI analysis · Informational 12/100

This commit adds a new helper function called isInIBDMode to btcd's network synchronization code. It simply checks whether the local node is still catching up to the rest of the Bitcoin network (Initial Block Download mode). The change is purely additive: it introduces the helper and its unit tests, but does not change any existing behavior or fix any visible bug on its own.