Repository navigation
fix(abstract-utxo): accept PoX-5 lockup descriptor in offline vault - #9961
Merged
Merged
Conversation
Contributor
Contributor
|
|
OttoAllmendinger
force-pushed
the
otto/WAL-2156-accept-pox-5-lockup
branch
2 times, most recently
from
October 14, 2026 10:57
b690fb4 to
50a1c48
Compare
Move the tbtcstx, tbtcstxprivate1 (tbtcreg) and tbtcstxsignet (tbtcsig) wasm-utxo coin name mapping from per-class wasmName overrides into toWasmUtxoCoinName, so callers that only have a UtxoCoinName (e.g. the offline vault) can use these coins with wasm-utxo. Refs: WAL-2156
Move POX5_MAX_UNLOCK_HEIGHT, assertPox5LocktimeSpend, assertPox5EarlyExitSpend, classifyPox5Spend and preparePox5EarlyExit into the pox5 namespace of utxo-descriptors. They only depend on the descriptor matching and preimage helpers that already live there, and this lets consumers such as abstract-utxo use the policy without importing the Babylon and CoreDAO staking code that the utxo-staking root export pulls in. utxo-staking keeps deprecated re-exports of the moved functions so existing consumers keep working; its PoX-5 finalizers call them through utxo-descriptors. Refs: WAL-2156
Add a PoX-5 lockup validator to the descriptor policy (offlineVault and prod getPolicyForEnv), accepting only canonical lockup descriptors whose staker keys are the wallet keys. Template validators now return false for descriptors they cannot parse instead of throwing. Half-signing applies the PoX-5 staking spend policy (nLockTime, non-final sequence, exactly one lockup input). The descriptor explanation now includes locktime. Refs: WAL-2156
OttoAllmendinger
force-pushed
the
otto/WAL-2156-accept-pox-5-lockup
branch
from
October 14, 2026 11:06
50a1c48 to
1afbaae
Compare
OttoAllmendinger
marked this pull request as ready for review
October 14, 2026 11:42
Doddanna17
approved these changes
Oct 14, 2026
Doddanna17
left a comment
Contributor
There was a problem hiding this comment.
LGTM — clean, security-conscious change with exactly the right tests.
What I checked:
- Lockup validator is correctly strict.
isCanonicalPox5Lockuprebuilds the descriptor from the wallet keys and accepts only whencanonical.toString() === descriptor.toString(), which binds the staker keys to the wallet keys and rejects non-canonical encodings.getValidatorPox5Wallet = eachOneOf(Wsh2Of3, pox5Lockup)cleanly lets a wallet carry both descriptor kinds. - Spend policy is right.
assertPox5SpendPolicyno-ops when there are no PoX-5 inputs; otherwise requires exactly one lockup input, branchlocktime(early-exit rejected),nLockTime ≥ max(unlockHeights), and a non-final sequence;getMatchedTransactionInputalso verifies the PSBT input'switnessUtxoscript equals the descriptor's scriptPubkey. - Template validators return false instead of throwing for unparseable descriptors — needed for the
eachOneOffallthrough and doesn't weaken acceptance (still rejects). Covered by a test. - Tests hit the real attack vectors: foreign/permuted staker keys, malformed + non-canonical encodings, nLockTime below unlock / as a timestamp, final sequence, >1 lockup input, plus
getPolicyForEnv(prod)accept/reject and a spend-policy compat test for the code moved fromutxo-staking.
Non-blocking:
names.tsmapstbtcstx/tbtcstxprivate1 → tbtcregandtbtcstxsignet → tbtcsig;btc/tbtcbgsigpass through (valid wasm names) — no gap.- API surface changed (new policy exports + deprecated
utxo-stakingre-exports) — downstream must pick up the matching SDK version. tryParseDescriptornow hides "not a template" vs "genuinely malformed" — fine here, just noting.
CI green on 1afbaaec. Approving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a PoX-5 lockup validator to the descriptor policy (offlineVault and
prod getPolicyForEnv), accepting only canonical lockup descriptors whose
staker keys are the wallet keys. Template validators now return false for
descriptors they cannot parse instead of throwing. Half-signing applies
the PoX-5 staking spend policy (nLockTime, non-final sequence, exactly
one lockup input). The descriptor explanation now includes locktime.