#32857 wallet: allow skipping script paths

ReviewabilityReviewsAgreementSize
#32857 Sjors wallet: allow skipping script pathsAuthor silent 69d0 (+1)Strong66 + 177 tests
  • Allow wallet users spending Taproot outputs to restrict spending to key paths
  • Prevents fee waste and privacy leaks from exposing fallback scripts prematurely
  • Ready to review
  • Strong support with no open objections
  • Concept approval citing useful motivation and clear use cases (rkrux)
  • Concept approval without stated reasons (w0xlt)
  • Tested spending tests pass and script paths remain untouched (jeanpablojp)
  • 66 lines added or modified outside tests
  • 177 lines added or modified in tests
  • 27 lines removed in total
  • 13 files, 9 commits
Wallet#49 of 92
P3 · new feature
  • P3 because it lets Taproot users avoid fee waste and metadata leakage from unused script paths
  • Reduces risk of triggering firmware bugs in external signing devices
  • Prevents accidental broadcast of fallback recovery scripts during normal spends
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

This PR adds a `keypath_only` option (defaulting to `false`) to `send`, `sendall`, `walletcreatefundedpsbt`, `walletprocesspsbt`, and `descriptorprocesspsbt`. When enabled, the wallet and PSBT processing code avoid adding new Taproot script-path metadata, avoid generating script-path signatures, and refuse to finalize transactions via script paths even if valid script-path signatures are already present.

Problem: When spending from Taproot descriptors that include both key path and script path alternatives (such as MuSig2 aggregate keys with timelocked fallback scripts), the wallet routinely adds and signs script-path data. This wastes fees, harms privacy by unnecessarily exposing fallback scripts, can trigger firmware bugs in external signing devices, and risks accidental broadcast of fallback paths.

Reviewability

Stale · Author silent 69d

No author activity for 69 days; a review may wait a long time for a response.

Agreement

Strong

substantive support, no open objection (rkrux, jeanpablojp)

Thread notes: Initial record. rkrux and w0xlt Concept ACKed, and jeanpablojp tested ACKed; items from the previous assessment were review suggestions, naming discussions, and code questions rather than objections, so no claims were opened.

Objections, suggestions, and questions: none recorded.

Support:

  • rkrux (member) (Concept ACK, 2026-06-08): Seems like a useful feature to have, the example in the PR description is helpful for the motivation.
  • w0xlt (contributor) (Concept ACK, 2026-06-14): Concept ACK [not substantive]
  • jeanpablojp (contributor) (Tested ACK, 2026-08-18): Ran the 3 tests this PR touches, all pass. Skipping the fallback script path in the normal flow makes sense. Key path signing still works with the tweak, and script path fields already in the PSBT are left untouched.

Participants:

  • fanquake (member, question, 1 statements 2025-07-02 to 2025-07-02): asked about a Windows CI compilation failure
  • rkrux (member, support, 25 statements 2025-10-06 to 2026-06-29): Concept ACK, suggested extending keypath_only to other RPCs, improved test coverage, and unified naming
  • w0xlt (contributor, support, 1 statements 2026-06-14 to 2026-06-14): Concept ACK
  • jeanpablojp (contributor, support, 3 statements 2026-08-18 to 2026-08-18): Tested ACK, verified tests pass and script path fields remain untouched, asked about fundrawtransaction behavior
  • dangervslash (none, neutral, 1 statements 2026-08-25 to 2026-08-25): commented 'Resolved' without context

Files

195 lines under test/bench/ci.

  • test/functional/wallet_taproot.py +74/-13
  • test/functional/rpc_psbt.py +69/-0
  • test/functional/wallet_musig.py +32/-5
  • src/rpc/rawtransaction.cpp +17/-4
  • src/wallet/rpc/spend.cpp +17/-4
  • doc/release-notes-32857.md +8/-0
  • src/script/sign.cpp +8/-0
  • src/common/types.h +6/-0
  • src/rpc/client.cpp +5/-0
  • src/script/sign.h +3/-0
  • src/psbt.cpp +1/-1
  • test/functional/wallet_fundrawtransaction.py +2/-0
  • src/wallet/wallet.h +1/-0

Card

The short text the ranking pass compares across PRs.

This PR adds a keypath_only option to wallet and PSBT RPCs (send, sendall, walletcreatefundedpsbt, walletprocesspsbt, and descriptorprocesspsbt) to restrict Taproot spending to the key path. This avoids unnecessary script-path signature creation, prevents premature on-chain disclosure of fallback scripts in complex descriptors (such as MuSig2 wallets with recovery branches), and avoids triggering external signer bugs. The PR has strong review support with concept and tested ACKs, is fully rebased, and is ready for final review.

Data

dossier JSON · extract JSON · model ledger, generated 2026-09-18T03:44, confidence high, input hash 52b29d7d8a10275e
thread read through 2026-08-25 (67 statements), head 798522e048
Discussion read under schema 1 rules: suggestions and questions may be missing, and an objection may combine several harms (schema history).
labels: Wallet

Categories

Wallet

P3 · new feature

Allows Taproot users to prevent unnecessary script-path signing and metadata leakage. The PR description notes that default wallet behavior when spending from Taproot descriptors with fallback scripts "wastes fees, harms privacy by unnecessarily exposing fallback scripts, can trigger firmware bugs in external signing devices, and risks accidental broadcast of fallback paths."

Membership: Labeled Wallet and modifies wallet spend and PSBT signing logic across src/wallet/rpc/spend.cpp and src/psbt.cpp.

Factors: security/stability 1, bug 0, performance 0, user value 2, leverage 0