BT
← All projectsbtcsuite

btcd

Alternative full-node Bitcoin implementation written in Go.

BitcoinNode implementationsNormal
Repository coverage

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

43security candidates20second-pass queue43AI analyses
31commits · 30 days
65commits · 60 days
177commits · 180 days
198commits · 365 days
Backfill bands
Aug 5 → Feb 621 seen1 candidatesComplete
Feb 6 → Jun 6112 seen7 candidatesComplete
Jun 6 → Jul 634 seen13 candidatesComplete
Jul 6 → Aug 530 seen7 candidatesComplete
Commit communication

Does the history explain itself?

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

68/100 average clarity
61Strong · 80–100
75Adequate · 60–79
57Thin · 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.
Lrifton92433186
Erick Cestari811177
Boris Nagaev461515060
Olaoluwa Osuntokun561111073
Oliver Gugger1344047
MPins333079
Drake Thomsen222091
Eric Grill311086
Julio Cesar111045
Jacob Schuler111088
Kim111045
Calvin Kim4300072
Analysis record

Published AI watches

Last scanned 0 minutes ago

Informational 15 AI analysisMessage 85 · Strong
BT btcsuitebtcd BitcoinNode implementations

build: pin tagged submodules and remove local replacements

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

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

rpcclient: add tests for DisableAuth header behavior

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

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

rpcclient: make HTTP Basic Auth optional via DisableAuth

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

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

rpcclient: harden DisableAuth transport tests

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

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

rpcclient: wrap DisableAuth tests to 80 columns

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

fe84a0e1by Olaoluwa Osuntokun+83−521 file
No security note in commit
Low 48 AI analysisMessage 78 · Adequate
BT btcsuitebtcd BitcoinNode implementations

v2transport: restore responder handshake progress

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

BIP324 handshake deadlock avoidanceCPU admission lease split to prevent resource exhaustion / lock holding across network I/OResponder now sends key material before full initiator key is received
09717871by Olaoluwa Osuntokun+231−862 files
No security note in commit
Low 41 AI analysisMessage 78 · Adequate
BT btcsuitebtcd BitcoinNode implementations

psbt: decode base64 packets incrementally

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 lim…

Removes an incorrect size bound that caused base64 PSBT parsing to reject valid large packets (denial-of-service / interoperability issue)Switches from full in-memory base64 decode to incremental streaming, reducing peak memory for large base64 PSBTsRetains strict base64 alphabet checks and rejects trailing data after the PSBT packet
e333817dby Olaoluwa Osuntokun+129−602 files
No security note in commit
Moderate 60 AI analysisMessage 68 · Adequate
BT btcsuitebtcd BitcoinNode implementations

psbt: reject nil taproot pointer fields

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 t…

nil-pointer dereference / panic prevention in Taproot PSBT finalizernil-pointer dereference / panic prevention in PSBT serializationinput validation added before sort.Slice and pointer dereference
1ead5ba3by Olaoluwa Osuntokun+171−165 files
Vendor flagged security relevance
Moderate 50 AI analysisMessage 78 · Adequate
BT btcsuitebtcd BitcoinNode implementations

peer: close late connections after disconnect

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…

Connection leak / resource exhaustion due to missing close pathRace condition between connection association and disconnectionAtomic flag published before connection state is fully initialized
617ebe2bby Boris Nagaev+111−72 files
No security note in commit
Moderate 64 AI analysisMessage 73 · Adequate
BT btcsuitebtcd BitcoinNode implementations

psbt: avoid blocking reads and unbounded allocations in NewFromRawBytes

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 le…

Denial-of-service via blocking read on open stream (potential infinite hang)Denial-of-service via unbounded memory allocation on base64 input before validationStrict parsing hardening for PSBT base64 decoding
2ddf73f3by Olaoluwa Osuntokun+87−283 files
Vendor flagged security relevance
Moderate 58 AI analysisMessage 45 · Thin
BT btcsuitebtcd BitcoinNode implementations

psbt: reject trailing final witness data

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 li…

strict parsing of serialized witness datarejection of trailing bytes in PSBT final script witnesspotential malleability / ambiguity reduction in PSBT extraction
468853e4by Boris Nagaev+13−91 file
No security note in commit
Low 38 AI analysisMessage 55 · Thin
BT btcsuitebtcd BitcoinNode implementations

psbt: test final witness trailing data rejection

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 by…

Strict parsing of final witness data to reject malformed/trailing bytesPrevents creation of transactions with non-standard witness encodingTest-only commit implies behavior enforcement elsewhere in the codebase
c87168ebby Boris Nagaev+26−01 file
No security note in commit
Moderate 64 AI analysisMessage 88 · Strong
BT btcsuitebtcd BitcoinNode implementations

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

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 …

BIP-340 signature parsing non-compliancesilent modulo reduction of s componentsignature malleability risk from non-canonical encodings
83d081a5by Lrifton92+42−12 files
Vendor flagged security relevance
Low 25 AI analysisMessage 80 · Strong
BT btcsuitebtcd BitcoinNode implementations

psbt: compact witness utxo scripts after parsing

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 compa…

memory retention reductionno input validation changeno cryptographic change
b0ab66feby Boris Nagaev+10−12 files
No security note in commit
Informational 12 AI analysisMessage 55 · Thin
BT btcsuitebtcd BitcoinNode implementations

psbt: add strict tx value regression test

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 itsel…

Regression test added for strict parsing of transaction-valued PSBT fieldsNo production code changes
0293b6e0by Boris Nagaev+117−01 file
No security note in commit
Informational 12 AI analysisMessage 55 · Thin
BT btcsuitebtcd BitcoinNode implementations

psbt: test witness utxo txout strict parsing

This commit only adds new test code for the PSBT (Partially Signed Bitcoin Transaction) package. It does not change any production code. The tests verify that WitnessUtxo fields are parsed strictly and correctly, including rejecting extra …

Strict parsing tests for WitnessUtxo transaction outputsRejection of trailing data after serialized txOutCorrect handling of multi-byte CompactSize script lengths
40ad9117by Boris Nagaev+79−01 file
No security note in commit
Informational 12 AI analysisMessage 60 · Adequate
BT btcsuitebtcd BitcoinNode implementations

musig2: test partial signature short reads

This commit only adds a new unit test that checks whether the MuSig2 partial signature decoder correctly rejects empty or too-short inputs. It does not change any production code, so by itself it cannot introduce or fix a security vulnerab…

4a7a9feaby Boris Nagaev+21−01 file
No security note in commit
Low 36 AI analysisMessage 45 · Thin
BT btcsuitebtcd BitcoinNode implementations

psbt: add reader exhaustion helper

This commit adds a new helper function to the PSBT (Partially Signed Bitcoin Transaction) package that checks whether a data reader still has leftover bytes after parsing. Leftover bytes could mean a malformed or malicious PSBT file was no…

New validation helper for trailing/leftover data in a binary parserLocated in PSBT parsing utilities, an area where malformed input handling mattersNo caller added in this commit, so defensive effect is not yet active
da5792a8by Boris Nagaev+25−01 file
No security note in commit
Low 28 AI analysisMessage 55 · Thin
BT btcsuitebtcd BitcoinNode implementations

psbt: test strict base64 packet decoding

This commit only adds new test code to check that the PSBT (Partially Signed Bitcoin Transaction) parser rejects malformed base64 input such as whitespace, bad padding, or extra bytes. It does not change the actual parser logic. The tests …

strict base64 decoding validationPSBT packet format hardeningrejection of non-canonical base64 input
0a33cceaby Boris Nagaev+56−01 file
No security note in commit
Low 46 AI analysisMessage 45 · Thin
BT btcsuitebtcd BitcoinNode implementations

psbt: parse witness utxo txouts strictly

This commit tightens how a Bitcoin-related library reads transaction outputs stored inside PSBT (Partially Signed Bitcoin Transaction) data. Previously, the code read the output value and script in a loose, hand-rolled way that ignored ext…

Strict canonical parsing of serialized transaction outputsRemoval of hand-rolled length handling that ignored script length byteAddition of full-consumption check on parsed witness UTXO data
b4c5cf16by Boris Nagaev+11−91 file
No security note in commit
Repository ledger

Explore captured commits

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

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

txscript: add initial awareness of new P2A output script

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Security candidatetxscript: support trivial signing for P2Aby Olaoluwa Osuntokun · 241bf7ca · May 12, 2026 · 1 fileMessage 45 · ThinLow 34Details
Commit message · Olaoluwa Osuntokun

txscript: support trivial signing for P2A

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

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

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

txscript: recognize P2A witness program during script execution

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

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritymempool: add p2a specific policyby Olaoluwa Osuntokun · 2682f2c1 · May 12, 2026 · 2 filesMessage 78 · AdequateTriage 0Details
Commit message · Olaoluwa Osuntokun

mempool: add p2a specific policy

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

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-prioritytxscript: add tests for new P2A awarenessby Olaoluwa Osuntokun · 053fb4c1 · May 12, 2026 · 1 fileMessage 55 · ThinTriage 0Details
Commit message · Olaoluwa Osuntokun

txscript: add tests for new P2A awareness

55/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification! No meaningful explanatory body
Lower-prioritybtcjson: add Warnings field to GetBlockChainInfoResultby Eric Grill · 63924193 · May 12, 2026 · 2 filesMessage 81 · StrongTriage 0Details
Commit message · Eric Grill

btcjson: add Warnings field to GetBlockChainInfoResult

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

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

Closes #2444

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

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Security candidatebtcjson: add tests for StringOrArray and Warnings fieldby Olaoluwa Osuntokun · 91cf7b24 · May 12, 2026 · 1 fileMessage 96 · StrongInformational 15Details
Commit message · Olaoluwa Osuntokun

btcjson: add tests for StringOrArray and Warnings field

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

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

96/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
memory safetyfuzzing or regression evidence
AI analysis · Informational 15/100

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

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

btcjson: fix infinite recursion in StringOrArray.MarshalJSON

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

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

Closes #2369

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

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

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

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

tests: fix stale regtest assumptions after #2467

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

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

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

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

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

98/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
AI review queuedmake fmtby Boris Nagaev · 51944b27 · May 6, 2026 · 3 filesMessage 0 · OpaqueTriage 0Details
Commit message · Boris Nagaev

make fmt

0/100 · OpaqueMessage clarity
! Very short subject! Too few words to establish purpose! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
Lower-priorityrpcclient: avoid double-resolving POST requests on shutdownby Boris Nagaev · 13ccec2c · May 6, 2026 · 2 filesMessage 83 · StrongTriage 5Details
Commit message · Boris Nagaev

rpcclient: avoid double-resolving POST requests on shutdown

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

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

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

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
Lower-priorityrpcclient: avoid duplicate batch POST handlersby Boris Nagaev · 1f00e1a3 · May 6, 2026 · 2 filesMessage 78 · AdequateTriage 5Details
Commit message · Boris Nagaev

rpcclient: avoid duplicate batch POST handlers

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

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

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
Lower-priorityrpcclient: support canceling in-flight http requestsby Matt Leon · 5b189f5f · May 6, 2026 · 2 filesMessage 83 · StrongTriage 5Details
Commit message · Matt Leon

rpcclient: support canceling in-flight http requests

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

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

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
Lower-priorityrpcclient: resolve all batch futures if Send failsby Boris Nagaev · fac1a225 · May 6, 2026 · 2 filesMessage 83 · StrongTriage 5Details
Commit message · Boris Nagaev

rpcclient: resolve all batch futures if Send fails

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

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

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Why it was queued
fuzzing or regression evidence
Lower-prioritytxscript: support latest Core tx_invalid semanticsby Olaoluwa Osuntokun · 4d03fb1e · Apr 29, 2026 · 1 fileMessage 65 · AdequateTriage 0Details
Commit message · Olaoluwa Osuntokun

txscript: support latest Core tx_invalid semantics

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

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
Lower-prioritytxscript: support latest Core tx_valid semanticsby Olaoluwa Osuntokun · 9d93e3d6 · Apr 29, 2026 · 1 fileMessage 68 · AdequateTriage 0Details
Commit message · Olaoluwa Osuntokun

txscript: support latest Core tx_valid semantics

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

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritytxscript: return ErrCleanStack for witness cleanstack failuresby Olaoluwa Osuntokun · 02358960 · Apr 29, 2026 · 1 fileMessage 83 · StrongTriage 0Details
Commit message · Olaoluwa Osuntokun

txscript: return ErrCleanStack for witness cleanstack failures

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

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-prioritytxscript: support latest Core script_tests formatby Olaoluwa Osuntokun · 53036fdb · Apr 29, 2026 · 1 fileMessage 78 · AdequateTriage 0Details
Commit message · Olaoluwa Osuntokun

txscript: support latest Core script_tests format

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

78/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-prioritytxscript: use finalOpcodeData for nested P2SH redeem script extractionby Olaoluwa Osuntokun · 63772e52 · Apr 29, 2026 · 2 filesMessage 73 · AdequateTriage 0Details
Commit message · Olaoluwa Osuntokun

txscript: use finalOpcodeData for nested P2SH redeem script extraction

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

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

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritytxscript: refactor CalcScriptInfo for nested P2SH analysisby Olaoluwa Osuntokun · ee91afcf · Apr 29, 2026 · 1 fileMessage 73 · AdequateTriage 0Details
Commit message · Olaoluwa Osuntokun

txscript: refactor CalcScriptInfo for nested P2SH analysis

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

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-prioritytxscript: align empty CHECKSIG pubkey validation with Coreby Olaoluwa Osuntokun · af7f3792 · Apr 29, 2026 · 1 fileMessage 83 · StrongTriage 0Details
Commit message · Olaoluwa Osuntokun

txscript: align empty CHECKSIG pubkey validation with Core

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

83/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
Lower-prioritytxscript: update script_tests.json from Bitcoin Coreby Olaoluwa Osuntokun · 44bfb2b7 · Apr 29, 2026 · 1 fileMessage 75 · AdequateTriage 0Details
Commit message · Olaoluwa Osuntokun

txscript: update script_tests.json from Bitcoin Core

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

75/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
Lower-prioritytxscript: update tx_invalid.json from Bitcoin Coreby Olaoluwa Osuntokun · 1b76fcb4 · Apr 29, 2026 · 1 fileMessage 75 · AdequateTriage 0Details
Commit message · Olaoluwa Osuntokun

txscript: update tx_invalid.json from Bitcoin Core

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

75/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
Lower-prioritytxscript: update tx_valid.json from Bitcoin Coreby Olaoluwa Osuntokun · 77a33163 · Apr 29, 2026 · 1 fileMessage 70 · AdequateTriage 0Details
Commit message · Olaoluwa Osuntokun

txscript: update tx_valid.json from Bitcoin Core

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

70/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Mentions testing or verification
Lower-prioritytxscript: reject OP_CODESEPARATOR in unexecuted branches for non-segwitby Olaoluwa Osuntokun · 8ee32c69 · Apr 29, 2026 · 3 filesMessage 73 · AdequateTriage 5Details
Commit message · Olaoluwa Osuntokun

txscript: reject OP_CODESEPARATOR in unexecuted branches for non-segwit

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

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

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

OP_FALSE OP_IF OP_CODESEPARATOR OP_ENDIF <validation>

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

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

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

Found via differential fuzzing by Bruno from bitcoinfuzz.

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