Nit from PR review, and add a tapminiscript preset
What changed, and why it matters
This commit only touches a developer playground helper script. It adds a small safety check when building test PSBTs and adds a new test preset for a Taproot miniscript wallet. There is no change to the actual Ledger Bitcoin app code that runs on the device or that users rely on for security.
No security action needed. This is a routine development tooling change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies dev-tools/playground/presets.py. It adds a validation that raises ValueError if a non-zero fee is set when a PSBT spec uses a sighash that does not commit to all amounts, and it adds a new POLICY_PRESET named ‘tr-miniscript-3key’ for testing a Taproot miniscript policy. The file is a development/testing utility, not part of the on-device firmware or production wallet logic.
Changed components
dev-tools/playground/presets.pyInspect captured patch +20 / −0
diff --git a/dev-tools/playground/presets.py b/dev-tools/playground/presets.py
index f109730..59430ab 100644
--- a/dev-tools/playground/presets.py
+++ b/dev-tools/playground/presets.py
@@ -212,6 +212,9 @@ def build_psbt_from_spec(policy, spec: PsbtSpec) -> PSBT:
explicit_total = sum(o.amount for o in spec.outputs if o.amount is not None)
if unbalanced:
+ if spec.fee != 0:
+ raise ValueError("fee must be 0 (or omitted) when a sighash doesn't commit to all amounts")
+
# No fee to spread around: such a sighash leaves the transaction open, so
# there is nothing for a remainder output to absorb.
if remainder_indices:
@@ -343,6 +346,23 @@ POLICY_PRESETS: List[PolicyPreset] = [
],
),
+ PolicyPreset(
+ name="tr-miniscript-3key",
+ description=(
+ "Taproot miniscript: internal keypath"
+ " + external single-key"
+ " + external timelocked single-sig"
+ ),
+ wallet_name="TR miniscript 3key",
+ template="tr(@0/**,{pk(@1/**),and_v(v:pk(@2/<0;1>/*),older(52560))})",
+ keys=[
+ KeySpec("m/86'/1'/0'"), # device: key-path spend
+ KeySpec("m/86'/1'/0'", external_index=0), # ext1: immediate script-path
+ KeySpec("m/86'/1'/0'", external_index=1), # ext2: timelock script-path
+ ],
+ ),
+
+
# --- musig2 -------------------------------------------------------------
PolicyPreset(
name="musig2-keypath",
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.