BC
← All projectsBitcoin Core

libsecp256k1

High-assurance secp256k1 elliptic-curve library used throughout the Bitcoin ecosystem.

BitcoinCryptographic librariesNormal
Repository coverage

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

85security candidates7second-pass queue215AI analyses
28commits · 30 days
53commits · 60 days
152commits · 180 days
206commits · 365 days
Backfill bands
Aug 5 → Feb 682 seen1 candidatesComplete
Feb 6 → Jun 625 seen2 candidatesComplete
Jun 6 → Jul 619 seen1 candidatesComplete
Jul 6 → Aug 548 seen1 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.

72/100 average clarity
100Strong · 80–100
89Adequate · 60–79
64Thin · 40–59
4Opaque · 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.
merge-script482426193
Sebastian Falbesoner502145068
Hennadii Stepanov51746064
Tim Ruffing22622055
furszy13413087
josibake949066
Lőrinc13313077
kevkevinpal626064
Ferdinando Ametrano522074
John Moffett424069
copilot-swe-agent[bot]323074
Bruno Garcia322090
Analysis record

Published AI watches

Last scanned 35 minutes ago

Informational 21 AI analysisMessage 81 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1980: examples: randomize the context in musig, erase the keypair in schnorr

This change improves two example programs in the secp256k1 cryptographic library. It adds a recommended side-channel protection step to the multi-signature example (musig.c) and ensures the single-signature example (schnorr.c) also wipes a…

Context randomization added to protect against side-channel leakageSecret key material explicitly erased from keypair object after useChanges are confined to example code, not the core library
5959bed6by merge-script+14−12 files
No security note in commit
Low 36 AI analysisMessage 98 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1998: Avoid unsequenced accesses to volatile variables

This change fixes a subtle compiler-warning/undefined-behavior issue in the code that performs secret math inside Bitcoin's cryptographic library. The code uses 'volatile' variables to prevent the compiler from turning certain operations i…

Touches constant-time arithmetic paths (modular inversion normalization)Fixes undefined behavior involving volatile-qualified variablesCompiler warning (-Wunsequenced) treated as a correctness defect
a0e2e23aby merge-script+42−362 files
Vendor flagged security relevance
Low 32 AI analysisMessage 80 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Avoid unsequenced accesses to volatile variables

This commit fixes a subtle C language rule violation in Bitcoin Core's libsecp256k1 cryptographic library. The code was reading a special 'volatile' variable multiple times within the same expression, which modern C standards treat as unde…

Undefined behavior in cryptographic constant-time codeCompiler warning (-Wunsequenced) in security-critical pathVolatile variable used as constant-time execution barrier
e7a34ba3by Hennadii Stepanov+20−142 files
No security note in commit
Informational 16 AI analysisMessage 100 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1898: tests: Silent Payments ctime test never reaches a match or label lookup

This commit fixes a flawed test in the libsecp256k1 cryptographic library. The test was supposed to exercise the Silent Payments constant-time scanning code, but due to a bug in how the test was written, it never actually verified that the…

Test-only change in ctime_tests.cFixes incorrect test key mutation that prevented matching outputAdds label callback to exercise label-candidate serialization/batching path
5d2ff536by merge-script+27−131 file
No security note in commit
Informational 15 AI analysisMessage 98 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

ci: Run the Wine jobs on ubuntu-24.04

This is a routine continuous-integration (CI) maintenance change. It pins a Windows cross-compilation test job to an older Ubuntu version because the newer GitHub-hosted runner image breaks Wine's networking syscalls. There is no change to…

ecfe7ab8by Ferdinando Ametrano+2−11 file
No security note in commit
Informational 23 AI analysisMessage 96 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1986: examples: exit with failure if signature verification fails

This change fixes two example programs so they return a failure code when a signature check fails. Previously, the examples always reported success even if verification failed, which meant automated tests would pass even when the underlyin…

Incorrect return status masked verification failures in example/test programsAutomated tests would pass despite cryptographic verification failingFix aligns ECDSA and Schnorr examples with existing MuSig example behavior
b97f7f5fby merge-script+2−22 files
No security note in commit
Informational 18 AI analysisMessage 88 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

examples: exit with failure if signature verification fails

This is a small hardening fix to two example programs. Previously, the example programs for ECDSA and Schnorr signatures would print whether a signature was valid but always report success to the operating system. Because the project's bui…

Test/example code silently succeeded on verification failureRegression-test gap for signature verification behaviorFix hardens CI/test signal without changing cryptographic logic
900613a7by Amartya Singh+2−22 files
No security note in commit
Low 35 AI analysisMessage 96 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1974: silentpayments: reject label tweaks that overflow the group order

This change fixes a silent handling problem in Bitcoin's silent payments feature. When a user-supplied label tweak value was larger than the cryptographic group order, the code previously reduced it silently, which could lead to incorrect …

silent modular reduction of attacker/caller-controlled scalarAPI misuse now rejected via ARG_CHECKsensitive scalar clearing before early return to avoid leaking transaction indistinguishability data
1c088b64by merge-script+13−22 files
Vendor flagged security relevance
High 76 AI analysisMessage 86 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1983: silentpayments: return 0 instead of `ARG_CHECK`ing for empty inputs/outputs

This update fixes a crash risk in Bitcoin's silent payments scanning code. Before the change, if a transaction had no suitable inputs or no taproot outputs, the library treated that as an illegal argument and could call abort(), killing th…

Denial-of-service vector: maliciously crafted transaction could trigger abort() in a scanning/indexing processAPI contract violation: documented return-0 behavior was not implemented for empty inputs/outputsARG_CHECK removal in two public silentpayments functions
a3a5cd45by merge-script+46−334 files
Vendor flagged security relevance
Low 30 AI analysisMessage 73 · Adequate
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

silentpayments: allow NULL arrays in scan_outputs if n_tx_outputs is 0

This commit fixes a minor API usability issue in the experimental silent payments module. Previously, a function that scans transaction outputs for silent payments would crash if given empty arrays represented as NULL pointers, even though…

NULL pointer argument check relaxed for empty arraysSECP256K1_ARG_NONNULL attributes removed for two parametersNew API test verifying NULL-with-zero-length behavior
e7bb0112by Sebastian Falbesoner+18−113 files
No security note in commit
Moderate 60 AI analysisMessage 78 · Adequate
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

silentpayments: return 0 instead of `ARG_CHECK`ing for empty inputs/outputs

This change fixes two functions in the Silent Payments module so they return a normal failure value (0) instead of triggering an internal abort when given a transaction with no eligible inputs or no taproot outputs. Previously, callers sca…

ARG_CHECK default behavior is abort(), turning an expected non-Silent-Payments transaction into a potential DoS crashAPI contract promised return 0 for non-Silent-Payments transactions, but implementation violated it for empty input/output edge casesCallers scanning blocks would need special-case handling before the fix to avoid crashes
d7821f4aby Sebastian Falbesoner+27−223 files
Vendor flagged security relevance
Low 31 AI analysisMessage 100 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

silentpayments: reject label tweaks that overflow the group order

This change tightens error handling in the silent payments scanning code. Previously, if a caller-supplied label tweak was as large as or larger than the elliptic curve group order, it was silently wrapped around (reduced modulo the order)…

silent reduction modulo group order replaced with explicit overflow rejectionsensitive scalars and shared secret explicitly cleared before aborting on invalid inputoutput assignment reordered to avoid partial state update on failure path
95552e16by Sebastian Falbesoner+13−22 files
No security note in commit
Informational 15 AI analysisMessage 35 · Opaque
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

remove unused SECP256K1_GE_CONST_INFINITY

This commit simply deletes an unused macro named SECP256K1_GE_CONST_INFINITY from a header file. A macro is a shorthand definition for code, and this one was no longer referenced anywhere in the project. Removing dead code has no functiona…

7b59e1fcby fanquake+0−11 file
No security note in commit
Low 26 AI analysisMessage 100 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1929: silentpayments: perform tweak addition with actual scalars

This change simplifies how Silent Payments scanning adds a small tweak value to a secret-derived value. It replaces a function meant for secret-key tweaking with plain scalar (modular number) addition. The old code had a special case that …

Behavior change: zero-result tweak addition is no longer forced to zero; scalar addition allows zeroBehavior change: label tweaks >= group order N are no longer rejected by the secret-key APIRemoval of defensive comment explaining failure modes of secret-key tweak addition
04b91ce2by merge-script+7−161 file
No security note in commit
Informational 15 AI analysisMessage 86 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1963: doc: say the sha256 compression callback processes secrets

This commit only adds a documentation comment to a public header file. It reminds developers that a special callback function used for SHA256 hashing may receive secret data such as private keys, so any custom implementation must be consta…

31716e4bby merge-script+3−01 file
No security note in commit
Informational 18 AI analysisMessage 81 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

doc: say the sha256 compression callback processes secrets

This is a documentation-only change. It adds a warning to the public header file telling developers that the optional SHA256 compression callback may receive secret key material, and therefore any custom implementation must run in constant…

Documentation clarifies that a pluggable cryptographic callback receives secret materialDocumentation imposes constant-time and no-logging requirements on callback implementersReferences RFC 6979 nonce derivation as an example of secret-key processing
494d3053by Ferdinando Ametrano+3−01 file
Vendor flagged security relevance
Informational 15 AI analysisMessage 96 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1946: doc: clean up lingering ECMULT_WINDOW_SIZE comment

This is a documentation-only cleanup. It moves a comment about the ECMULT_WINDOW_SIZE setting to a better location and fixes an outdated formula in the comment. No code behavior changes.

6f065e9aby merge-script+10−112 files
No security note in commit
Low 37 AI analysisMessage 100 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1933: refactor: introduce `ecmult_const_ge` helper (preventing accidential gej leaks)

This commit is a defensive code cleanup in Bitcoin Core's secp256k1 cryptography library. It introduces a helper function that automatically clears temporary secret data after a constant-time elliptic curve multiplication, and switches exi…

Defensive refactoring to prevent accidental leakage of secret scalar information from Jacobian coordinatesNew helper enforces memory clearing of intermediate group element after constant-time scalar multiplicationAdoption in ECDH and silentpayments modules, which process secret keys
2365dc64by merge-script+35−427 files
Vendor flagged security relevance
Informational 15 AI analysisMessage 93 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1949: ecdsa: Clarify derivation of the r check in `_sig_verify`

This commit only rewrites comments in the source code to make the mathematical explanation clearer. It does not change any actual code instructions, function behavior, or security properties. There is no vulnerability or fix here.

4a264a93by merge-script+21−151 file
No security note in commit
Informational 12 AI analysisMessage 100 · Strong
BC Bitcoin Corelibsecp256k1 BitcoinCryptographic libraries

Merge bitcoin-core/secp256k1#1948: tests: add ECDSA verify case where r + n overflows p

This commit only adds a new test case to the project's test suite. It does not change any production cryptographic code. The new test verifies that the ECDSA signature verification function correctly rejects a crafted invalid signature in …

Adds test coverage for ECDSA verification edge case involving r + n overflow against field order pReferences a surviving mutant where the early-rejection check in secp256k1_ecdsa_sig_verify is removedDoes not modify production code; purely a test-suite enhancement
e23e9201by merge-script+28−01 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.

Security candidateMerge bitcoin-core/secp256k1#1980: examples: randomize the context in musig, erase the keypair in schnorrby merge-script · 5959bed6 · Nov 21, 2026 · 2 filesMessage 81 · StrongInformational 21Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1980: examples: randomize the context in musig, erase the keypair in schnorr

608d12faa157e9185b843a2669d0f9e9a7554305 examples: randomize the context in musig, erase the keypair in schnorr (Ferdinando Ametrano)

Pull request description:

examples/musig.c is the only example that handles secret keys without
randomizing the context, which secp256k1.h highly recommends. Randomize
it as schnorr.c does.

schnorr.c erases the secret key buffer after use, but the keypair holds
a copy of the secret key and stayed on the stack. Erase it too.

ACKs for top commit:
theStack:
re-ACK 608d12faa157e9185b843a2669d0f9e9a7554305

Tree-SHA512: ec1de541687c121663469848ae82af02c2bd87f8b0a5037017ed1f8927f72a48ae8ddd76544aba66941b80ef35053fc232c8d7c4887541dbe6199fa3e05d5a13

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
secret or key materialaccess controlmerge-commit duplicate discount
AI analysis · Informational 21/100

This change improves two example programs in the secp256k1 cryptographic library. It adds a recommended side-channel protection step to the multi-signature example (musig.c) and ensures the single-signature example (schnorr.c) also wipes a second copy of the secret key from memory. These are hardening fixes in demonstration code, not the library itself, so they do not directly fix an exploitable vulnerability in production use.

Lower-priorityMerge bitcoin-core/secp256k1#1996: cmake: Avoid use of non-target directivesby merge-script · 659f03b0 · Nov 20, 2026 · 4 filesMessage 86 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1996: cmake: Avoid use of non-target directives

f6394a0738a9cd908af646b00ccac9a11ca53a1f cmake: Switch `add_compile_options` -> `target_compile_options` (Hennadii Stepanov)
1b6ab424d44c5dbcef36f782f26044b7a6949016 cmake: Switch `include_directories` -> `target_include_directories` (Hennadii Stepanov)
827661a2ab13aa8555f105e7d5b172f50fa1a3a4 cmake: Switch `add_compile_definitions` -> `target_compile_definitions` (Hennadii Stepanov)
664cd159e6e468c93f3bf21699a19498cad37e39 cmake: Introduce `secp256k1_common` interface library (Hennadii Stepanov)

Pull request description:

Use of non-target directives, such as `add_compile_definitions()`, `include_directories()` or `add_compile_options()`, is not recommended. As of CMake 4.5.0, it triggers `-Wnon-target-directive` warnings.

For example:
```console
$ cmake -B build -Wnon-target-directive
-- The C compiler identification is GNU 16.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib64/ccache/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning (non-target-directive) at CMakeLists.txt:66 (add_compile_definitions):
Use of non-target directives is not recommended. Consider
target_compile_definitions instead.
This warning is for project developers. Use -Wno-author or
-Wno-non-target-directive to suppress it.

CMake Warning (non-target-directive) at CMakeLists.txt:78 (add_compile_definitions):
Use of non-target directives is not recommended. Consider
target_compile_definitions instead.
This warning is for project developers. Use -Wno-author or
-Wno-non-target-directive to suppress it.

CMake Warning (non-target-directive) at CMakeLists.txt:79 (add_compile_definitions):
Use of non-target directives is not recommended. Consider
target_compile_definitions instead.
This warning is for project developers. Use -Wno-author or
-Wno-non-target-directive to suppress it.
...
```

This issue affects downstream projects. For example, Bitcoin Core sets `"errors": {"dev": true}` in its "dev-mode" preset, which makes the configuration step fail.

This PR introduces a project-wide interface library, following the approach used in Bitcoin Core.

ACKs for top commit:
real-or-random:
ACK f6394a0738a9cd908af646b00ccac9a11ca53a1f

Tree-SHA512: 462b07bfe2289401cdeda20f2c04cf030cf39227a6c69e164cc1900cc4132bb5ec29bad71d276584093f228a5de8d189467f98c5dffc9b43fe36bb208d4cc8f1

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
merge-commit duplicate discount
Lower-prioritycmake: Switch `add_compile_definitions` -> `target_compile_definitions`by Hennadii Stepanov · 827661a2 · Nov 19, 2026 · 2 filesMessage 55 · ThinTriage 0Details
Commit message · Hennadii Stepanov

cmake: Switch `add_compile_definitions` -> `target_compile_definitions`

Use of non-target directives is not recommended. It triggers
`-Wnon-target-directive` warnings since CMake 4.5.0.

55/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Provides an explanatory body
Why it was queued
documentation-only discount
Lower-prioritycmake: Switch `add_compile_options` -> `target_compile_options`by Hennadii Stepanov · f6394a07 · Nov 19, 2026 · 2 filesMessage 55 · ThinTriage 0Details
Commit message · Hennadii Stepanov

cmake: Switch `add_compile_options` -> `target_compile_options`

Use of non-target directives is not recommended. It triggers
`-Wnon-target-directive` warnings since CMake 4.5.0.

55/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Provides an explanatory body
Lower-prioritycmake: Switch `include_directories` -> `target_include_directories`by Hennadii Stepanov · 1b6ab424 · Nov 19, 2026 · 1 fileMessage 55 · ThinTriage 0Details
Commit message · Hennadii Stepanov

cmake: Switch `include_directories` -> `target_include_directories`

Use of non-target directives is not recommended. It triggers
`-Wnon-target-directive` warnings since CMake 4.5.0.

55/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Provides an explanatory body
Why it was queued
documentation-only discount
Lower-prioritycmake: Introduce `secp256k1_common` interface libraryby Hennadii Stepanov · 664cd159 · Nov 19, 2026 · 3 filesMessage 73 · AdequateTriage 0Details
Commit message · Hennadii Stepanov

cmake: Introduce `secp256k1_common` interface library

The new `secp256k1_common` interface library encapsulates usage
requirements shared by all buildable targets. It is empty for
now, so this change has no effect on the build. The following commits
populate it.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
documentation-only discount
Security candidateMerge bitcoin-core/secp256k1#1998: Avoid unsequenced accesses to volatile variablesby merge-script · a0e2e23a · Nov 16, 2026 · 2 filesMessage 98 · StrongLow 36Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1998: Avoid unsequenced accesses to volatile variables

e7a34ba3ecee49421404994eeeeb0383f3e2fbbf Avoid unsequenced accesses to volatile variables (Hennadii Stepanov)
709e39c2fb2bcc36d8eda0b04c2d4669d6fd00b2 refactor: Prefix volatile variable names with "v" (Hennadii Stepanov)

Pull request description:

Since C11, if a side effect on a scalar object is unsequenced relative to another side effect on the same scalar object, the behavior is undefined (see https://en.cppreference.com/c/language/eval_order). Although this code targets C89, where the order of volatile reads is merely unspecified, this is exactly what happens with the volatile `cond_negate` in the master branch, because a read of such a variable is a side effect. Clang 24 [warns](https://github.com/llvm/llvm-project/pull/180955) about it with `-Wunsequenced` regardless of the language standard:
```console
$ cmake -B build -DCMAKE_C_COMPILER=clang-24
$ cmake --build build
[5/19] Building C object src/CMakeFiles/exhaustive_tests.dir/tests_exhaustive.c.o
In file included from /home/hebasto/dev/secp256k1/secp256k1/src/tests_exhaustive.c:23:
In file included from /home/hebasto/dev/secp256k1/secp256k1/src/secp256k1.c:27:
In file included from /home/hebasto/dev/secp256k1/secp256k1/src/field_impl.h:14:
In file included from /home/hebasto/dev/secp256k1/secp256k1/src/field_5x52_impl.h:13:
/home/hebasto/dev/secp256k1/secp256k1/src/modinv64_impl.h:116:31: warning: unsequenced accesses to volatile qualified 'cond_negate' [-Wunsequenced]
116 | r0 = (r0 ^ cond_negate) - cond_negate;
| ~~~~~~~~~~~ ^
/home/hebasto/dev/secp256k1/secp256k1/src/modinv64_impl.h:117:31: warning: unsequenced accesses to volatile qualified 'cond_negate' [-Wunsequenced]
117 | r1 = (r1 ^ cond_negate) - cond_negate;
| ~~~~~~~~~~~ ^
/home/hebasto/dev/secp256k1/secp256k1/src/modinv64_impl.h:118:31: warning: unsequenced accesses to volatile qualified 'cond_negate' [-Wunsequenced]
118 | r2 = (r2 ^ cond_negate) - cond_negate;
| ~~~~~~~~~~~ ^
/home/hebasto/dev/secp256k1/secp256k1/src/modinv64_impl.h:119:31: warning: unsequenced accesses to volatile qualified 'cond_negate' [-Wunsequenced]
119 | r3 = (r3 ^ cond_negate) - cond_negate;
| ~~~~~~~~~~~ ^
/home/hebasto/dev/secp256k1/secp256k1/src/modinv64_impl.h:120:31: warning: unsequenced accesses to volatile qualified 'cond_negate' [-Wunsequenced]
120 | r4 = (r4 ^ cond_negate) - cond_negate;
| ~~~~~~~~~~~ ^
5 warnings generated.
<snip>
```

Avoid such behavior by separating the access to a volatile variable, which still prevents compilers from generating branching, non-constant-time machine code, from the actual use of its value in expressions where the evaluation order is unspecified.

ACKs for top commit:
real-or-random:
utACK e7a34ba3ecee49421404994eeeeb0383f3e2fbbf
theStack:
re-ACK e7a34ba3ecee49421404994eeeeb0383f3e2fbbf

Tree-SHA512: eb047f0eab822322402024e883c154b7e4985cc6fe018ef347db39afdd3edf64f4885f28cffd0f2e7f975c646f662e82ffa2ac74f28bde90020cece8435abb6f

98/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
Why it was queued
constant-time or timing behaviormerge-commit duplicate discount
AI analysis · Low 36/100

This change fixes a subtle compiler-warning/undefined-behavior issue in the code that performs secret math inside Bitcoin's cryptographic library. The code uses 'volatile' variables to prevent the compiler from turning certain operations into branches that could leak secrets through timing. However, reading the same volatile variable twice in one expression (for example, '(x ^ v) - v') is technically undefined behavior in modern C and triggers a new Clang warning. The patch copies the volatile value into a regular variable first, then uses that value in the math. It is a defensive, correctness fix rather than a confirmed exploitable bug, but because it touches constant-time code paths it has security relevance.

Security candidateAvoid unsequenced accesses to volatile variablesby Hennadii Stepanov · e7a34ba3 · Nov 16, 2026 · 2 filesMessage 80 · StrongLow 32Details
Commit message · Hennadii Stepanov

Avoid unsequenced accesses to volatile variables

Since C11, if a side effect on a scalar object is unsequenced relative
to another side effect on the same scalar object, the behavior is
undefined. Although this code targets C89, where the order of volatile
reads is merely unspecified, this is exactly what happens with the
volatile `cond_negate` in the master branch, because a read of such a
variable is a side effect. Clang 24 warns about it with `-Wunsequenced`
regardless of the language standard.

Avoid such behavior by separating the access to a volatile variable,
which still prevents compilers from generating branching,
non-constant-time machine code, from the actual use of its value in
expressions where the evaluation order is unspecified.

80/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queued
constant-time or timing behavior
AI analysis · Low 32/100

This commit fixes a subtle C language rule violation in Bitcoin Core's libsecp256k1 cryptographic library. The code was reading a special 'volatile' variable multiple times within the same expression, which modern C standards treat as undefined behavior. The fix copies the value to a regular variable first, then uses it. This is a defensive, code-correctness fix in a security-critical constant-time algorithm, but the commit itself does not demonstrate any actual exploit or real-world vulnerability.

Lower-priorityrefactor: Prefix volatile variable names with "v"by Hennadii Stepanov · 709e39c2 · Nov 16, 2026 · 2 filesMessage 72 · AdequateTriage 0Details
Commit message · Hennadii Stepanov

refactor: Prefix volatile variable names with "v"

This follow the convention used for volatile variable elsewhere in this
project.

No behavior change.

72/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides an explanatory body
Security candidateMerge bitcoin-core/secp256k1#1898: tests: Silent Payments ctime test never reaches a match or label lookupby merge-script · 5d2ff536 · Nov 16, 2026 · 1 fileMessage 100 · StrongInformational 16Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1898: tests: Silent Payments ctime test never reaches a match or label lookup

f391539a3b2d16059883dbd281bee33e1f995423 tests: cover Silent Payments label scanning (Lőrinc)
078f67f86bd07a25c2dbff2398965738f1f594ad tests: make Silent Payments ctime scan find output (Lőrinc)

Pull request description:

**Problem:** The constant-time test generates an output for one scan key, then mutates the key before scanning, so the scan cannot find it.
It also passes no label callback, so label-candidate serialization and batching never run.
The test still passes because it never checks the scan result.
Nothing verifies the match path, or that the label callback only receives public data, while the scan key is marked undefined.

**Fix:** Regenerate the output for the actual scan key, prepend a nonmatching output, and require one direct, unlabeled match.
Pass a label callback that verifies each serialized 33-byte candidate is defined and counts the misses.

ACKs for top commit:
fametrano:
ACK f391539a3b2d16059883dbd281bee33e1f995423
theStack:
re-ACK f391539a3b2d16059883dbd281bee33e1f995423

Tree-SHA512: 49b00182214cf910e94704c212750c3ba07de2ad33ea6ca0051e10dd5a6949b4825127574c439e61f07d81d88159cfc807e738b0bdc64a4ea8875f73e10a9aa4

100/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✓ Links an issue, advisory, or supporting reference
Why it was queued
constant-time or timing behaviormerge-commit duplicate discount
AI analysis · Informational 16/100

This commit fixes a flawed test in the libsecp256k1 cryptographic library. The test was supposed to exercise the Silent Payments constant-time scanning code, but due to a bug in how the test was written, it never actually verified that the scanner found a matching output or exercised the label-lookup code path. The fix makes the test generate the output with the correct key, adds a non-matching output, supplies a label callback, and checks that exactly one unlabeled match is found. This is a test-only improvement; no production code behavior changes and no vulnerability is introduced or fixed in shipped software.

Lower-priorityMerge bitcoin-core/secp256k1#1999: modinv64: name mask1, not c1, in divsteps commentby merge-script · a5cb9a3a · Nov 16, 2026 · 1 fileMessage 81 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1999: modinv64: name mask1, not c1, in divsteps comment

9b4c3a8676cbb1b3e6d0c18641949b664dc6ab50 modinv64: name mask1, not c1, in divsteps comment (Ferdinando Ametrano)

Pull request description:

Since 17fa217 the code uses `mask1`, not `c1`; the same comment in `modinv32_impl.h` was already updated. This fix is redundant if/when #1197 is merged.

ACKs for top commit:
theStack:
ACK 9b4c3a8676cbb1b3e6d0c18641949b664dc6ab50

Tree-SHA512: b04feee38754d9eb9da3a79abd3bbe5f40ebd46b768fc6ac02ab00ff6beff005e26fd8ac4be6e5c7088515232ff441f35a98a42a154142f48b20f0851a01ea4f

81/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
Why it was queued
merge-commit duplicate discount
Lower-prioritymodinv64: name mask1, not c1, in divsteps commentby Ferdinando Ametrano · 9b4c3a86 · Nov 15, 2026 · 1 fileMessage 68 · AdequateTriage 0Details
Commit message · Ferdinando Ametrano

modinv64: name mask1, not c1, in divsteps comment

Since commit 17fa217 the code after this comment uses mask1, not c1.
That commit updated the same comment in modinv32_impl.h only.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Lower-priorityMerge bitcoin-core/secp256k1#1995: ci: Run the Wine jobs on ubuntu-24.04by merge-script · 2e1e6c60 · Nov 13, 2026 · 1 fileMessage 96 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1995: ci: Run the Wine jobs on ubuntu-24.04

ecfe7ab8e406553cf88eff6f65955d61b29b4c5e ci: Run the Wine jobs on ubuntu-24.04 (Ferdinando Ametrano)

Pull request description:

The two Wine jobs fail: `ubuntu-latest` now runs ubuntu-26.04, whose Docker 29.4.2 blocks the `socketcall` syscall, and every test exits with `wine: socket : Function not implemented` (actions/runner-images#14790).

This runs `mingw_debian` on `ubuntu-24.04`, as suggested in https://github.com/bitcoin-core/secp256k1/pull/1992#issuecomment-6828018736. It is a stopgap: revert it once actions/runner-images#15205, which updates Docker on ubuntu-26.04, or another fix reaches the runner image.

ACKs for top commit:
real-or-random:
utACK ecfe7ab8e406553cf88eff6f65955d61b29b4c5e (but let's wait for CI to complete)

Tree-SHA512: e8d04d61c9b1780d61d13d6af513e688a134cbc24a875bbf4e4998eaf80c0f1841140fa55b15f1771f3f5fb0d4f5766a9b7fa4162629093938ff3aa0ff23cc40

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
documentation-only discountmerge-commit duplicate discount
Security candidateci: Run the Wine jobs on ubuntu-24.04by Ferdinando Ametrano · ecfe7ab8 · Nov 13, 2026 · 1 fileMessage 98 · StrongInformational 15Details
Commit message · Ferdinando Ametrano

ci: Run the Wine jobs on ubuntu-24.04

ubuntu-latest now runs ubuntu-26.04, whose Docker 29.4.2 blocks the
socketcall syscall. Every test under Wine then fails with "wine:
socket : Function not implemented". Pin mingw_debian to ubuntu-24.04
until actions/runner-images#14790 is fixed, then revert this.

98/100 · StrongMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
Why it was queued
access controldocumentation-only discount
AI analysis · Informational 15/100

This is a routine continuous-integration (CI) maintenance change. It pins a Windows cross-compilation test job to an older Ubuntu version because the newer GitHub-hosted runner image breaks Wine's networking syscalls. There is no change to cryptographic code, no change to how Bitcoin or libsecp256k1 behaves when built or run by users, and no security-relevant behavior change.

Lower-priorityMerge bitcoin-core/secp256k1#1972: tests: silentpayments: deduplicate setup codeby merge-script · f43a3453 · Nov 12, 2026 · 1 fileMessage 91 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1972: tests: silentpayments: deduplicate setup code

70f321c334dd0cfa0d8e074bc436094785bc3477 tests: silentpayments: deduplicate prevouts summary setup (ViniciusCestarii)
67916d9bbca4e85d6811817d08b26e90af1a4166 tests: silentpayments: deduplicate label cache setup (ViniciusCestarii)
9c6ece8bdd90a4cebb1bc9cef4fdcc88007957b6 tests: silentpayments: deduplicate output tweak (ViniciusCestarii)

Pull request description:

Deduplicates code in silent payments as suggested by @theStack at https://github.com/bitcoin-core/secp256k1/pull/1943#pullrequestreview-5578778611.

- Turns `output_tweak` into a reusable constant.
- Adds function `labels_cache_set_neg_output_tweak` for setting the cache for negated `OUTPUT_TWEAK`.
- Adds function `prevouts_summary_create_bob` for creating `secp256k1_silentpayments_prevouts_summary` with bob's first address key.

ACKs for top commit:
theStack:
ACK 70f321c334dd0cfa0d8e074bc436094785bc3477

Tree-SHA512: e5bb0f49279107c241796d15ee0567fdd15a5e7ac779f1458d577c00e795a8a41f83c46341e8758d1a9f343babc5fcef692ce3837ba5378203bccceeeb8d4ab7

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
merge-commit duplicate discount
Lower-priorityMerge bitcoin-core/secp256k1#1992: doc: pass M, not Mi, to normalize in modinv_varby merge-script · bf3160c8 · Nov 9, 2026 · 1 fileMessage 86 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1992: doc: pass M, not Mi, to normalize in modinv_var

f901165097fb527ef46138ebe8108cccad3a1088 doc: pass M, not Mi, to normalize in modinv_var (Ferdinando Ametrano)

Pull request description:

`modinv_var` in section 7 of doc/safegcd_implementation.md calls `normalize(f, d, Mi)`, but `normalize` takes the modulus `M`. As written it returns the right inverse for 1 of 2008 inputs; with `M`, for all 2008.

ACKs for top commit:
real-or-random:
ACK f901165097fb527ef46138ebe8108cccad3a1088

Tree-SHA512: 90b7835beef235bfdf60af62c9dcc5671715444986603b715b7b3e9c1e1f7a6dd307eb24e3df8041a9d2bb6bfc6db46ae0a7aaaf0e9aef2da58c06ffc95d5a7f

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
documentation-only discountmerge-commit duplicate discount
Lower-prioritydoc: pass M, not Mi, to normalize in modinv_varby Ferdinando Ametrano · f9011650 · Nov 8, 2026 · 1 fileMessage 45 · ThinTriage 0Details
Commit message · Ferdinando Ametrano

doc: pass M, not Mi, to normalize in modinv_var

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
documentation-only discount
Security candidateMerge bitcoin-core/secp256k1#1986: examples: exit with failure if signature verification failsby merge-script · b97f7f5f · Nov 4, 2026 · 2 filesMessage 96 · StrongInformational 23Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1986: examples: exit with failure if signature verification fails

900613a742f8b08fe8ce2511488e777c235214c1 examples: exit with failure if signature verification fails (Amartya Singh)

Pull request description:

The ecdsa and schnorr examples print whether the signature verified, but return `EXIT_SUCCESS` either way. Both build systems run the examples as tests, so if verification broke, those test runs would still pass.

I checked this by flipping a byte of the signature (schnorr) and of the message hash (ecdsa) right before verification: both examples printed "Is the signature valid? false" and `ctest -R "example\.(schnorr|ecdsa)"` still reported them as passed. With this change the same experiment makes both tests fail.

This matches what the musig example already does when `secp256k1_schnorrsig_verify` fails. The return stays at the end of `main`, so the context destroy and secret key erasure still happen first.

ACKs for top commit:
real-or-random:
utACK 900613a742f8b08fe8ce2511488e777c235214c1 It will ultimately depend on the application how to handle an invalid sig but a) it's good to keep this in sync with the musig example, and b) the examples are supposed to generate valid sigs, so returning EXIT_FAILURE is better for testing the examples in CI

Tree-SHA512: 2c053adcde327cd20bd9447794ad0e8042618dd489b8640361ea5cfc6cf9760719e92bdd5700c7d3c280646b599ae7b1b8773dc45bbdc65a0da9c424703c1f84

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
secret or key materialsigning boundarydefensive validationcryptography-sensitive pathmerge-commit duplicate discount
AI analysis · Informational 23/100

This change fixes two example programs so they return a failure code when a signature check fails. Previously, the examples always reported success even if verification failed, which meant automated tests would pass even when the underlying cryptographic code was broken. This is a test-quality and example-correctness fix, not a vulnerability in the library itself.

Security candidateexamples: exit with failure if signature verification failsby Amartya Singh · 900613a7 · Nov 3, 2026 · 2 filesMessage 88 · StrongInformational 18Details
Commit message · Amartya Singh

examples: exit with failure if signature verification fails

The ecdsa and schnorr examples print whether the signature is valid
but return EXIT_SUCCESS either way. Since the examples are run as tests
by both build systems, a regression that broke verification would go
unnoticed there. The musig example already fails in this case.

88/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
Why it was queued
signing boundarydefensive validationcryptography-sensitive path
AI analysis · Informational 18/100

This is a small hardening fix to two example programs. Previously, the example programs for ECDSA and Schnorr signatures would print whether a signature was valid but always report success to the operating system. Because the project's build systems run these examples as automated tests, a future bug that broke signature verification could have been hidden. Now the examples return a failure code when verification fails, so the test harness will notice.

Security candidateMerge bitcoin-core/secp256k1#1974: silentpayments: reject label tweaks that overflow the group orderby merge-script · 1c088b64 · Nov 3, 2026 · 2 filesMessage 96 · StrongLow 35Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1974: silentpayments: reject label tweaks that overflow the group order

95552e1654bfd3d34facfcf64e7ca3b0a52594c0 silentpayments: reject label tweaks that overflow the group order (Sebastian Falbesoner)

Pull request description:

Label tweaks returned by the `label_lookup` callback that overflow the group order were silently reduced. `recipient_label_create` never produces such tweaks, so an overflowing one means the caller's label cache is broken. As suggested in https://github.com/bitcoin-core/secp256k1/pull/1929#issuecomment-6310143782, this PR treats it as API misuse using `ARG_CHECK` (illegal callback, return 0), documents the requirement. It also adds a test and a changelog entry.

ACKs for top commit:
fametrano:
tACK 95552e1654bfd3d34facfcf64e7ca3b0a52594c0
real-or-random:
utACK 95552e1654bfd3d34facfcf64e7ca3b0a52594c0

Tree-SHA512: 3530e3887d4b3c1a7b083eb3e8c743d860499fb68f5395b2d5b04b7c13d1bab88bd1180517015d0f08e1b48c92dde68a5a367a808416d609ef5372742ed129a3

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 safetymerge-commit duplicate discount
AI analysis · Low 35/100

This change fixes a silent handling problem in Bitcoin's silent payments feature. When a user-supplied label tweak value was larger than the cryptographic group order, the code previously reduced it silently, which could lead to incorrect payment scanning results. Now the code rejects such oversized values as API misuse. This is a defensive correctness fix rather than an active remote exploit.

Security candidateMerge bitcoin-core/secp256k1#1983: silentpayments: return 0 instead of `ARG_CHECK`ing for empty inputs/outputsby merge-script · a3a5cd45 · Nov 1, 2026 · 4 filesMessage 86 · StrongHigh 76Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1983: silentpayments: return 0 instead of `ARG_CHECK`ing for empty inputs/outputs

160590d1922914ddabe7c4d39fe14846b009212e changelog: mention silentpayments returning 0 for empty inputs/outputs (Sebastian Falbesoner)
e7bb01121ffbd2bd8ea66c1e09d2dbd287aabdf6 silentpayments: allow NULL arrays in scan_outputs if n_tx_outputs is 0 (Sebastian Falbesoner)
d7821f4adbe7d13925bf670a720618a52a890d6e silentpayments: return 0 instead of `ARG_CHECK`ing for empty inputs/outputs (Sebastian Falbesoner)

Pull request description:

`secp256k1_silentpayments_recipient_prevouts_summary_create` and `secp256k1_silentpayments_recipient_scan_outputs` treated a transaction with no eligible inputs, or no taproot outputs, as an illegal argument. With the default illegal callback, that calls abort().

That contradicts the API documentation. Both functions are documented to return 0 if the transaction is not a Silent Payments transaction, and a transaction with no eligible inputs or no taproot outputs is exactly that case. It also puts the burden on callers. Anyone scanning a block or building an index has to filter these transactions out before calling the library. If they forget, a transaction someone else created can crash their process.

This PR makes both functions return 0 in these cases:

- `prevouts_summary_create`: drops the `ARG_CHECK((n_pubkeys > 0) || (n_xonly_pubkeys > 0))`. With no public keys, the sum is the point at infinity, so the existing "sum is infinity" check already returns 0. No new code path is needed.
- `scan_outputs`: drops the `ARG_CHECK(n_tx_outputs > 0)`. It returns 0 after all other arguments have been validated and before the scan key is loaded. `*n_found_outputs` is still set to 0.
- `scan_outputs`: tx_outputs and found_outputs are now only checked for NULL if `n_tx_outputs > 0`, and their `SECP256K1_ARG_NONNULL` attributes are removed. This lets callers pass an empty array as NULL (e.g., data() of an empty std::vector). It matches how prevouts_summary_create and sender_create_outputs already treat empty key arrays (see the [previous "Fixed" entry in the CHANGELOG](https://github.com/bitcoin-core/secp256k1/blob/b88cbc7a65ab7629e13368c6c46468fc96d0d3da/CHANGELOG.md?plain=1#L11) added in PR #1932).

ACKs for top commit:
fametrano:
ACK 160590d1922914ddabe7c4d39fe14846b009212e
real-or-random:
utACK 160590d1922914ddabe7c4d39fe14846b009212e

Tree-SHA512: 5ae2f7515356ad4eb0d7499a3705f1e03dac8532e26601603d415d0ba4bc01410cdef4e123b5deecdd0b2f0b395d623c934fc1ce16a7f9d364f6108393be36dc

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
defensive validationcryptography-sensitive pathmerge-commit duplicate discount
AI analysis · High 76/100

This update fixes a crash risk in Bitcoin's silent payments scanning code. Before the change, if a transaction had no suitable inputs or no taproot outputs, the library treated that as an illegal argument and could call abort(), killing the program. Now it calmly returns 0, matching its own documentation. This matters because a stranger could craft a transaction that crashes a wallet or indexing service that forgot to filter these cases first.

Lower-prioritychangelog: mention silentpayments returning 0 for empty inputs/outputsby Sebastian Falbesoner · 160590d1 · Oct 31, 2026 · 1 fileMessage 50 · ThinTriage 0Details
Commit message · Sebastian Falbesoner

changelog: mention silentpayments returning 0 for empty inputs/outputs

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
documentation-only discount
Security candidatesilentpayments: allow NULL arrays in scan_outputs if n_tx_outputs is 0by Sebastian Falbesoner · e7bb0112 · Oct 31, 2026 · 3 filesMessage 73 · AdequateLow 30Details
Commit message · Sebastian Falbesoner

silentpayments: allow NULL arrays in scan_outputs if n_tx_outputs is 0

Since the previous commit, scan_outputs accepts a transaction without
taproot outputs and returns 0. It still required tx_outputs and
found_outputs to be non-NULL, so a caller passing an empty array as
NULL (e.g., data() of an empty std::vector in C++) would still abort.

Neither array is dereferenced if n_tx_outputs is 0, so only check them
for NULL if n_tx_outputs > 0, and drop their SECP256K1_ARG_NONNULL
attributes. This matches how prevouts_summary_create and
sender_create_outputs treat empty key arrays.

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
Why it was queued
cryptography-sensitive path
AI analysis · Low 30/100

This commit fixes a minor API usability issue in the experimental silent payments module. Previously, a function that scans transaction outputs for silent payments would crash if given empty arrays represented as NULL pointers, even though it did not actually need to read any data. The change allows NULL pointers when the number of outputs is zero, matching how similar functions already behave. It is a defensive hardening fix rather than an active security vulnerability.

Security candidatesilentpayments: return 0 instead of `ARG_CHECK`ing for empty inputs/outputsby Sebastian Falbesoner · d7821f4a · Oct 31, 2026 · 3 filesMessage 78 · AdequateModerate 60Details
Commit message · Sebastian Falbesoner

silentpayments: return 0 instead of `ARG_CHECK`ing for empty inputs/outputs

secp256k1_silentpayments_recipient_prevouts_summary_create and
secp256k1_silentpayments_recipient_scan_outputs treated a transaction
without eligible inputs or without taproot outputs as an illegal
argument, which calls abort() by default. The API documentation says
they return 0 if the transaction is not a Silent Payments transaction,
and callers scanning a block would have to special-case such
transactions.

With no public keys, the sum in prevouts_summary_create is the point at
infinity, so the existing check already returns 0. scan_outputs returns
0 after argument validation and before the scan key is loaded.

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-25O0CNV8.

78/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
Why it was queued
explicit security languagecryptography-sensitive path
AI analysis · Moderate 60/100

This change fixes two functions in the Silent Payments module so they return a normal failure value (0) instead of triggering an internal abort when given a transaction with no eligible inputs or no taproot outputs. Previously, callers scanning many transactions could have their program crash if they passed such a transaction to these functions. The patch aligns behavior with the documented API and prevents denial-of-service crashes in normal scanning workflows.

Lower-priorityMerge bitcoin-core/secp256k1#1937: tests: silentpayments: cover rejection of invalid keypair alongside a valid oneby merge-script · b88cbc7a · Oct 31, 2026 · 1 fileMessage 91 · StrongTriage 0Details
Commit message · merge-script

Merge bitcoin-core/secp256k1#1937: tests: silentpayments: cover rejection of invalid keypair alongside a valid one

d6ec1ab4dad253b1e5715404d84cfe3c4f5e097b tests: silentpayments: cover rejection of invalid keypair alongside a valid one (Yudis-bit)

Pull request description:

Add coverage for an invalid Taproot keypair passed alongside a valid one in `secp256k1_silentpayments_sender_create_outputs`.

Both orderings are tested. Testing the invalid keypair first, followed by a valid one, ensures that if the nested early `return 0;` in the keypair loop is dropped, the subsequent valid keypair leaves a nonzero sum so the failure is not masked by the zero-sum check.

ACKs for top commit:
fametrano:
ACK d6ec1ab4dad253b1e5715404d84cfe3c4f5e097b
brunoerg:
ACK d6ec1ab4dad253b1e5715404d84cfe3c4f5e097b
theStack:
ACK d6ec1ab4dad253b1e5715404d84cfe3c4f5e097b

Tree-SHA512: 7df298ac78a7cc5de91bcedca357a0fa703de95f94e9c4f05da7f8dc242d4b313072f542f04532691145f91e74a01aac1687d6ef1b1770f48ff087f1fc7d9d57

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
merge-commit duplicate discount