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 53 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-priorityblockchain: add exports methods based on block header tipby Calvin Kim · eeb2d43a · Feb 25, 2026 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Calvin Kim

blockchain: add exports methods based on block header tip

The added exported methods on BlockChain provide access to the block
header tip like fetching block hashes and heights from the headers
chain.

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

This commit adds five new public read-only helper methods to btcd's blockchain package so other parts of the program can query the 'header chain' tip (the longest chain of block headers). The methods only expose information that was already tracked internally; they do not change any behavior, permissions, or validation rules. There is no indication this fixes a bug or closes a security hole.

Lower-priorityblockchain: add ProcessBlockHeaderby Calvin Kim · c1a46122 · Feb 25, 2026 · 2 filesMessage 58 · ThinInformational 15Details
Commit message · Calvin Kim

blockchain: add ProcessBlockHeader

ProcessBlockHeader performs chain selection and context-free &
contextual validation for the given block header. The function allows
a header-first downloading of blocks even without checkpoints.

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

This commit adds a new public function, ProcessBlockHeader, to btcd's blockchain package. It is a feature addition that exposes existing internal header-validation logic so callers can download and validate block headers before receiving full blocks. There is no indication in the commit or supplied references that this fixes a security bug or introduces a vulnerability.

Lower-priorityblockchain: change HaveBlock to also check for block data availabilityby Calvin Kim · e4b38e0c · Feb 25, 2026 · 3 filesMessage 73 · AdequateLow 46Details
Commit message · Calvin Kim

blockchain: change HaveBlock to also check for block data availability

In block processing and block downloading, HaveBlock is used to check if
the block data already exists. It was ok to just check for the
existence of the blockNode but we now we also need to check if the data
exists as the blockNode may be present for just the block header.

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

This commit fixes a logic bug in btcd (a Bitcoin implementation in Go). Previously, when the software was asked 'Do you already have this block?', it answered 'yes' if it knew the block's header, even if it did not actually have the full block data stored. Now it correctly checks that both the header is known and the full block data exists on disk. This could have caused the node to skip downloading a block it thought it already had, leading to incomplete data or inconsistent behavior.

Lower-priorityblockchain: reuse existing header node in maybeAcceptBlockby Calvin Kim · f9645f07 · Feb 25, 2026 · 2 filesMessage 73 · AdequateModerate 58Details
Commit message · Calvin Kim

blockchain: reuse existing header node in maybeAcceptBlock

maybeAcceptBlock unconditionally created a new blockNode, overwriting the
index entry. If maybeAcceptBlockHeader had already processed the header,
the pointer held by bestHeader's chainView became orphaned, breaking
bestHeader.Contains and downstream checks like IsValidHeader.

Check for an existing node first and upgrade its status to
statusDataStored rather than replacing it.

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

This commit fixes a bug in btcd's blockchain handling where accepting a full block could overwrite an existing header-only entry in the block index. That overwrite would leave an internal 'best header' view pointing to an orphaned record, causing later checks that rely on header membership to fail. The fix reuses the existing index entry and upgrades its status instead of replacing it.

Lower-priorityblockchain: don't flush blockNodes that we don't have the data forby Calvin Kim · 9e45f60e · Feb 25, 2026 · 2 filesMessage 95 · StrongLow 32Details
Commit message · Calvin Kim

blockchain: don't flush blockNodes that we don't have the data for

On flushes to the database, we check that the blockNodes we have for
the downloaded block headers are not flushed to the disk unless the
block data is stored as well for backwards compatibility.

With older btcd clients, they rely on the fact that the blockNode is
present to check if the block data is also present. Since we now
store blockNodes for just the block headers, this is no longer true.

Because of this, we don't flush the blockNodes if there's no
accompanying block data for it. This results in downloading and
verifying the headers again if the node were to restart but since the
header data is small and the verification is quick, it's not a big
downside.

As an optimization, flushToDB now skips opening a write transaction
entirely when every dirty node is header-only. This avoids a no-op
write transaction on every ProcessBlockHeader call during header sync.

95/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
Why it was queued
defensive validation
AI analysis · Low 32/100

This change fixes a backwards-compatibility problem in btcd, a Bitcoin implementation. Previously, when a newer btcd stored information about a block header without the full block data, it could write that header-only record to disk. If the user later opened the same database with an older btcd version, the older software would assume the full block existed and fail unrecoverably. The patch now avoids writing those header-only records to disk. It also skips unnecessary database write transactions during header-only sync, which is a performance improvement. There is no direct evidence in the commit of an active security exploit, but the unrecoverable-error scenario is a reliability and availability concern.

Lower-priorityblockchain: add maybeAcceptHeaderby Calvin Kim · fd16786b · Feb 25, 2026 · 1 fileMessage 58 · ThinInformational 12Details
Commit message · Calvin Kim

blockchain: add maybeAcceptHeader

maybeAcceptHeader performs checks to accept block headers into the
header chain. This function allows for a true headers-first download
where we only accept block headers for downloading new blocks.

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

This commit adds a new internal function to btcd that accepts block headers into a separate 'header chain' before downloading full blocks. It is a feature/refactoring change for a 'headers-first' download mode. There is no indication in the commit that it fixes a security bug or introduces a vulnerability; it appears to be normal protocol implementation work.

Lower-priorityblockchain: add ErrKnownInvalidBlock error codeby Calvin Kim · 743d0a2c · Feb 25, 2026 · 2 filesMessage 72 · AdequateInformational 15Details
Commit message · Calvin Kim

blockchain: add ErrKnownInvalidBlock error code

Distinguish between a block that has itself failed validation
versus one that is only invalid due to an ancestor.

72/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Explains rationale or failure mode
AI analysis · Informational 15/100

This commit only adds a new error code constant and its string mapping in the blockchain package. It does not change any validation logic, network behavior, or how blocks are accepted or rejected. By itself, it cannot introduce or fix a security issue.

Lower-priorityblockchain: add statusHeaderStored for blockNode statusby Calvin Kim · b60c2c30 · Feb 25, 2026 · 1 fileMessage 73 · AdequateInformational 15Details
Commit message · Calvin Kim

blockchain: add statusHeaderStored for blockNode status

Since we may now have blockNodes with just the block header stored
without the data, we add a new status to account for this.

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

This commit simply adds a new bookkeeping flag and a helper method to track whether a block header has been stored on disk. It does not change any security-sensitive behavior, fix a bug, or alter how data is validated. There is no indication this is a security patch.

Lower-priorityblockchain: add bestHeader to BlockChainby Calvin Kim · 5f25cf0d · Feb 25, 2026 · 2 filesMessage 80 · StrongInformational 15Details
Commit message · Calvin Kim

blockchain: add bestHeader to BlockChain

We add a chainview of bestHeaders so that we'll be able to keep track of
headers separately from the bestChain. This is needed as we're getting
headers for new block annoucements instead of invs.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Informational 15/100

This commit adds a new internal bookkeeping structure called bestHeader to btcd's blockchain tracking. It mirrors the existing bestChain view but is intended to track headers separately from full blocks. There is no visible security fix or vulnerability being patched; it appears to be preparatory refactoring for a later change in how new blocks are announced.

Lower-priorityserver: address review feedback on peer lifecycle handlingby Or Aharonee · f6d69f7a · Feb 18, 2026 · 1 fileMessage 85 · StrongLow 40Details
Commit message · Or Aharonee

server: address review feedback on peer lifecycle handling

Prioritize verAckCh in peerLifecycleHandler select to avoid
nondeterministic peerAdd skipping when both channels are ready.

Guard OnVerAck against double-close by checking the channel before
closing, logging an error instead of panicking.

Adjust peerLifecycleEvent comment to reflect that peerAdd may be
skipped when the peer disconnects before or concurrently with verack.

Fix verAckCh field comment formatting.

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

This commit fixes two internal timing bugs in how btcd manages peer connections during the Bitcoin handshake. It prevents a peer-registration step from being accidentally skipped when handshake messages arrive at the same time as a disconnect, and it stops the server from crashing if a peer somehow sends its final handshake acknowledgment twice. These are robustness fixes rather than obvious remote-attack paths, but they remove conditions that could destabilize a node.

Lower-priorityserver: serialize peer lifecycle via single goroutineby Or Aharonee · ce913598 · Feb 16, 2026 · 3 filesMessage 83 · StrongModerate 69Details
Commit message · Or Aharonee

server: serialize peer lifecycle via single goroutine

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

- Make peerLifecycleHandler (renamed from peerDoneHandler) the sole
sender of both peerAdd and peerDone events for each peer. OnVerAck
now closes a signal channel (verAckCh) instead of sending directly,
and peerLifecycleHandler selects on verAckCh vs peer.Done() to
decide whether to send peerAdd before peerDone. This guarantees
ordering by construction: a single goroutine sends both events
sequentially, eliminating the negotiateTimeout race window.

- Add Done() method to peer.Peer exposing the quit channel read-only,
enabling select-based disconnect detection from server code.

- Remove the now-unused AddPeer method.

- Address style feedback: 80-char line limit, empty lines between
switch cases, break long function calls, use require.GreaterOrEqualf
instead of if+Fatalf, bump syncRaceConcurrency to 300 for
backpressure testing, add TestPreVerackDisconnect for disconnect
prior to verack.

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

This commit is a follow-up fix for a race condition in how btcd adds and removes peers. The previous fix tried to ensure that when a peer connects and quickly disconnects, the 'peer added' and 'peer done' notifications are always seen in the right order by the sync manager. This commit makes that guarantee stronger by having a single goroutine handle both events, instead of two separate code paths. It also adds tests that demonstrate the bug could corrupt sync manager state and prevent the node from syncing.

Lower-priorityserver: fix peer add/done race between peerHandler and syncManagerby Or Aharonee · 091b7901 · Feb 16, 2026 · 2 filesMessage 85 · StrongHigh 73Details
Commit message · Or Aharonee

server: fix peer add/done race between peerHandler and syncManager

peerDoneHandler ran as a separate goroutine per peer and independently
notified both peerHandler (via donePeers channel) and the sync manager
(via syncManager.DonePeer) about a peer disconnect. Because these two
sends were unsynchronized, the sync manager could observe DonePeer
before NewPeer when a peer connected and disconnected quickly. This
caused the sync manager to log "unknown peer", then later register the
already-dead peer as a sync candidate that was never cleaned up,
potentially leaving it stuck with a dead sync peer.

Two structural changes eliminate the race:

1. Merge the newPeers and donePeers channels into a single
peerLifecycle channel. Since OnVerAck (add) always fires before
WaitForDisconnect returns (done), a single FIFO channel guarantees
peerHandler always processes add before done for a given peer,
removing the select-ambiguity where Go could pick done first.

2. Move the syncManager.DonePeer call and orphan eviction from
peerDoneHandler into handleDonePeerMsg, which runs inside
peerHandler. All sync manager peer lifecycle notifications now
originate from the single peerHandler goroutine and flow into
sm.msgChan in guaranteed add-before-done order.

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

This commit fixes a race condition in btcd, a Bitcoin node implementation. When a peer connected and disconnected very quickly, the node could tell its block-syncing component that the peer left before it ever told it the peer arrived. That left the syncer believing a dead peer was still its active sync partner, so the node could stop syncing new blocks from real peers. The fix funnels all peer add/remove events through one ordered channel so the syncer always sees arrival before departure. A new integration test demonstrates the bug by bombarding a node with handshake-then-disconnect connections and then checking whether it still syncs blocks.

AI review queuedbtcec/schnorr: fix nonce generation commentsby Erick Cestari · 3a0df885 · Jan 15, 2026 · 1 fileMessage 68 · AdequateInformational 15Details
Commit message · Erick Cestari

btcec/schnorr: fix nonce generation comments

The comments in schnorrSign and Sign incorrectly stated that CustomNonce
triggers RFC6979 nonce generation. The actual behavior is the opposite:

- With CustomNonce: BIP-340 compliant nonce derivation (steps 6-8)
- Without CustomNonce (default): RFC6979 deterministic nonce generation

Also fixes typo "set 14" -> "step 14".

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
signing or wallet pathsecond-pass: broader security terminologysecond-pass: security-sensitive path
AI analysis · Informational 15/100

This commit only fixes documentation comments in the code. It corrects a description about which nonce-generation method is used when a custom nonce option is provided. No actual signing logic or behavior was changed, so there is no security risk from this patch itself.

Lower-prioritybuild: bump version of Go container for release buildsby Olaoluwa Osuntokun · 7d4da229 · Jan 13, 2026 · 1 fileMessage 62 · AdequateInformational 15Details
Commit message · Olaoluwa Osuntokun

build: bump version of Go container for release builds

62/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
Why it was queued
documentation-only discount
AI analysis · Informational 15/100

This commit simply updates the version of the Go programming language used to build release binaries inside a Docker container, from Go 1.22.11 to Go 1.23. There is no code change, no bug fix, and no security patch visible in the diff. It is a routine build-maintenance change.

AI review queuedfix spelling errorby Jameson Lopp · d3615dcc · Dec 25, 2025 · 1 fileMessage 28 · OpaqueInformational 15Details
Commit message · Jameson Lopp

fix spelling error

28/100 · OpaqueMessage clarity
✓ Subject identifies a change! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Informational 15/100

This commit fixes a typo in a log message only: 'alloacting' is corrected to 'allocating'. There is no functional code change, no security fix, and no behavior change.

Lower-priorityregtest: align activations with Bitcoin Coreby Boris Nagaev · cd4e5426 · Dec 25, 2025 · 8 filesMessage 90 · StrongLow 28Details
Commit message · Boris Nagaev

regtest: align activations with Bitcoin Core

Set regtest buried heights to match Core: BIP34/65/66 at height 1 and make
CSV/SegWit/Taproot always active. Added regtest coverage for header version
floors, coinbase height enforcement, and deployment state to ensure we now
reject the blocks Core rejects and accept the ones Core accepts.

Updated package fullblocktests to generate BIP34-compliant blocks.

Test helpers now set prev block height to 0 (not the default -1) so generated
blocks start at height 1 and satisfy coinbase height rules.

90/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
AI analysis · Low 28/100

This commit changes btcd's regression test network (regtest) rules so they match Bitcoin Core's behavior. It makes several Bitcoin protocol upgrades active from block 1 instead of being delayed or inactive. The change is primarily about test-network compatibility and does not appear to be a security fix for main Bitcoin production networks. It adds tests to confirm regtest now rejects old-style blocks and accepts modern ones, just like Core does.

Lower-priorityblockchain: run BIP30 if we are on non-BIP34 forkby Boris Nagaev · 5baa6387 · Dec 24, 2025 · 3 filesMessage 76 · AdequateHigh 72Details
Commit message · Boris Nagaev

blockchain: run BIP30 if we are on non-BIP34 fork

Mirror BIP34-aware BIP30 skip logic from Bitcoin Core.

PR https://github.com/bitcoin/bitcoin/pull/6931 in Bitcoin Core introduced
an optimization that skips the expensive BIP30 duplicate coinbase check once
BIP34 is active *and* the chain actually contains the recorded activation block.
See the comment in that PR "//Only continue to enforce if we're below BIP34
activation height or the block hash at that height doesn't correspond."

btcd used to drop the check purely based on height. On a fork that lacks the
BIP34 activation block, that difference lets a duplicate coinbase slip through
consensus. This patch ports the missing pieces: we store the activation hash in
chain parameters and only disable BIP30 after we see that block on-chain.

76/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
AI analysis · High 72/100

This commit fixes a subtle consensus bug in btcd, a Bitcoin implementation. BIP30 prevents two blocks from having the same special 'coinbase' transaction ID, and BIP34 makes duplicate coinbase IDs practically impossible once it activates. btcd was skipping the BIP30 check based only on block height, but on an alternate chain that has not actually activated BIP34 at that height, a duplicate coinbase could slip through. The fix mirrors Bitcoin Core by also checking that the known BIP34 activation block hash is present on the current chain before disabling BIP30.

Lower-priorityblockchain: run BIP30 check at BIP0034Heightby Boris Nagaev · f7dd09f5 · Dec 24, 2025 · 2 filesMessage 76 · AdequateModerate 60Details
Commit message · Boris Nagaev

blockchain: run BIP30 check at BIP0034Height

Sync the behaviour with Bitcoin Core.

See https://github.com/bitcoin/bitcoin/pull/6931

In Core, the BIP30 flag is cleared only if the previous block's ancestor chain
already contains the BIP34 activation block. For the activation block itself
(height = BIP0034Height), pindex->pprev->GetAncestor(BIP34Height) returns
nullptr, so the flag stays on and BIP30 is still enforced. In other words, Core
enforces BIP30 for the activation block and skips it starting with the following
block.

76/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
AI analysis · Moderate 60/100

This commit fixes a subtle off-by-one bug in btcd's blockchain validation. BIP30 is a rule that prevents duplicate coinbase transactions, which could otherwise allow an attacker to overwrite existing Bitcoin funds. BIP34 later made duplicate coinbases impossible by requiring unique block heights in coinbase data. btcd was skipping the BIP30 duplicate check starting exactly at the BIP34 activation block, but Bitcoin Core still runs the BIP30 check for that one activation block. The change aligns btcd with Core by moving the skip point one block later, so the duplicate-coinbase check is still enforced at the BIP34 activation height.

Lower-priorityblockchain: make BIP30 enforcement logic testableby Boris Nagaev · 29d105bb · Dec 24, 2025 · 2 filesMessage 78 · AdequateInformational 14Details
Commit message · Boris Nagaev

blockchain: make BIP30 enforcement logic testable

Upcoming commits tweak the conditions under which the expensive BIP30
duplicate-coinbase check should run. To unit-test those changes, this
commit moves the decision logic out of BlockChain.checkConnectBlock and
into a dedicated helper, bip0030CheckNeeded. The behaviour is unchanged;
the new helper is covered by tests in bip30_test.go.

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

This commit is a pure code cleanup and test-addition change. It moves an existing decision about when to run an expensive Bitcoin rule check into a new helper function, without changing when the check runs. It also adds unit tests for that helper. There is no security fix or behavior change.

Lower-priorityblockchain: fix overly eager BIP30 bypassby Boris Nagaev · 6803c625 · Dec 24, 2025 · 2 filesMessage 86 · StrongModerate 59Details
Commit message · Boris Nagaev

blockchain: fix overly eager BIP30 bypass

Bitcoin Core PR https://github.com/bitcoin/bitcoin/pull/12204 tightened BIP30
handling: re-enable the check once height 1,983,702 is reached.

This change ports that logic into btcd and adds a regression test.

86/100 · StrongMessage clarity
✓ 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 59/100

This update fixes a rule in btcd (a Bitcoin implementation) that was skipping an expensive duplicate-check too early. The change re-enables that duplicate check once the blockchain reaches height 1,983,702, matching a safeguard already added to Bitcoin Core. Without the fix, a carefully crafted block could potentially reuse an old coinbase transaction ID after BIP34 is active, which could cause nodes to disagree on the state of coins. The patch includes a regression test.

Lower-prioritytreap, ffldb: change Put() to take in multiple key-value pairsby Calvin Kim · e0091247 · Nov 14, 2025 · 4 filesMessage 85 · StrongInformational 18Details
Commit message · Calvin Kim

treap, ffldb: change Put() to take in multiple key-value pairs

Previously, the Put() function took in a single key-value pair,
resulting in memory allocation overhead as the intermediary treapNodes
got allocated and immediately garbage collected, resulting in
performance loss due to the garbage collection overhead.

We're able to recycle the intermediary treapNodes allocated by taking in
multiple key-value pairs. This results in better performance of the
node especially during UTXO cache flushes.

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

This commit is a performance optimization, not a security fix. It changes the database cache's treap (a type of search tree) so that it can insert many key-value pairs in one batch instead of one at a time. The goal is to reduce memory allocation and garbage collection overhead when flushing the UTXO cache. There is no indication in the commit message or diff that this fixes a security vulnerability.

Lower-prioritytreap: add recycle() method on treapNodeby Calvin Kim · 0e95ae38 · Oct 30, 2025 · 1 fileMessage 60 · AdequateInformational 15Details
Commit message · Calvin Kim

treap: add recycle() method on treapNode

The recycle method resets and puts the treapNode into the treapNodePool
to be recycled at a future date.

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

This commit adds a small helper method that clears a data structure node and returns it to an internal memory pool for reuse. It is a routine performance/memory-management change with no visible security implications.

Lower-prioritytreap: return newly created treapNodes in put()by Calvin Kim · 65d39687 · Oct 30, 2025 · 1 fileMessage 80 · StrongInformational 14Details
Commit message · Calvin Kim

treap: return newly created treapNodes in put()

The newly created treapNodes in put() are now returned so that the
caller has access to them. This is done so that the caller can put back
some of the treapNodes to sync.Pool.

For multiple put operations, an immutable treap will allocate many
treapNodes that will immediately be garbage collected. Let's say
there's 3 key-value pairs that are going to be inserted:

key 1: 50
key 2: 10
key 3: 4

Then the insertion is like so:

1: allocate 50.

50

2: clone 50, allocate 10.

50
/ \
10

3: clone 50, clone 10, allocate 4

50
/ \
10
/
4

In this example, only the nodes allocated during insertion of (3) is
going to be used. The rest is going to be garbage collected and they
can be safely be put in the sync.Pool if there's a guarantee that the
previous copies are not being accessed. This is true if the put
operations are going to be called in batches.

By returning the pointers of these allocated treapNodes, we allow the
caller to make such optimizations.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Informational 14/100

This commit is a performance optimization for an internal data structure (a treap, a type of tree used in btcd's database). It changes the private put() function to return pointers to newly created nodes so that future callers can recycle them through a sync.Pool, reducing memory allocations. The public Put() method ignores these returned nodes, so behavior is unchanged. There is no security fix or vulnerability patch here.

Lower-priorityrpcclient: ensure http dial respects timeoutby Matt Leon · 582b999f · Oct 29, 2025 · 1 fileMessage 68 · AdequateLow 37Details
Commit message · Matt Leon

rpcclient: ensure http dial respects timeout

Ensure that the dial phase of rpcclient's HTTP posts respects the http.Client's Timeout. It was instead falling back to the OS settings.

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

This commit fixes a bug in btcd's RPC client where network connection attempts ignored the configured timeout and could hang for a very long time (relying on the operating system's default limits). The fix makes the dial operation respect the context and timeout that the HTTP client already carries. It is a reliability and availability improvement rather than a direct theft-of-funds bug, but long-hanging connections can be abused to exhaust client resources or stall dependent services.

Lower-prioritybuild: bump version to v0.25by Olaoluwa Osuntokun · 798b4ed4 · Oct 27, 2025 · 1 fileMessage 57 · ThinInformational 15Details
Commit message · Olaoluwa Osuntokun

build: bump version to v0.25

57/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
AI analysis · Informational 15/100

This commit simply changes a version label from 'beta.rc1' to 'beta' in a single source file. It is a routine release-version bump with no security relevance.