Review report

core: PR #36409

2 suggestions

Optional improvements

Link

[suggestion] · Nondeterministic Taproot signing lacks a release note

Independent signing of the same unsigned Taproot input now produces different signatures, witnesses and wtxids, but the PR adds no release note explaining this user-visible change.

Location: src/script/sign.cpp:119 (head).

Details and suggested fix

The RPC, PSBT and wallet signing paths leave SignOptions::aux_rand unset, so newly generated single-key Taproot signatures now use fresh auxiliary randomness instead of zero. This affects both key-path and script-path signing: independent signing runs produce different witness bytes and wtxids, while the txid stays unchanged. ECDSA signing is unchanged. Existing signatures can still be reused, so processing an already-signed and verified PSBT does not itself regenerate its signatures. Add a short PR-specific release note describing the new default and its effect on reproducibility, consistent with doc/developer-notes.md. Deterministic Taproot output was not a documented guarantee, so maintainers may consider the note optional; this does not require an RPC opt-out.


Link

[suggestion] · value_or(GetRandHash()) draws randomness even with fixed auxiliary data

An engaged aux_rand still causes a discarded RNG draw, adding unnecessary work and advancing the shared RNG state in the BIP341 vector test.

Location: src/script/sign.cpp:119 (head).

Details and suggested fix

value_or evaluates its fallback argument before selecting the engaged value. Whenever the key and sighash checks succeed, GetRandHash() therefore runs even when aux_rand is set. The discarded draw performs RNG mixing under a mutex, updates shared state and advances the deterministic stream in test mode. The supplied auxiliary bytes still control the signature; the vector equality assertion does not check this unrelated side effect. The BIP341 vector test is the only current caller found that sets aux_rand, so no production occurrence of the unnecessary draw with fixed auxiliary data was found. Select lazily with const uint256 aux_rand{m_options.aux_rand ? *m_options.aux_rand : GetRandHash()}; to preserve fixed-value signatures and fresh default randomness without the discarded draw.


Coverage details