Repository navigation
fix(abstract-utxo): explain and half-sign PoX-5 late exits in offlineVault - #9965
Closed
ralph-bitgo[bot] wants to merge 1 commit into
Closed
ralph-bitgo[bot] wants to merge 1 commit into
ralph-bitgo[bot] wants to merge 1 commit into
Conversation
Custodial PoX-5 late exits (post-CLTV 2-of-3 spends of a lockup output) could not be explained or co-signed by the Offline Vault Console: the descriptor transaction export fails policy validation and no policy guarded the CLTV spend itself. This blocks custodial unstake validation (WAL-2144 matrix, SI-1191 unstake rollout). - wire the PoX-5 lockup validator into the offline vault descriptor transaction policy alongside the wallet's regular descriptors. - enforce the BitGoJS staking policy (WAL-2022) before half-signing a PoX-5 lockup input: post-CLTV branch only, nLockTime >= unlock height and below 500000000, non-final sequence on the lockup input, exactly one lockup input. Early exits remain out of scope (WAL-2145). - include locktime in the descriptor transaction explanation so the OVC review screen can show the nLockTime an operator must verify before co-signing a CLTV spend. - map the Stacks PoX coin names to their wasm coins so explain works on tbtcstxsignet; the now-redundant wasmName overrides are removed. - add a @bitgo/utxo-staking dependency for the staking policy and unit tests for explain and half-sign over btc and tbtcstxsignet, policy and staking negatives, and Wsh2Of3/Wsh2Of3CltvDrop regressions. Ticket: WAL-2156 Session-Id: 0b46844d-1e64-4dae-af4a-42bb86eedda7 Task-Id: c6ecab00-ae0e-49dc-a2c0-a08cfb1522ec
Contributor
10 tasks done
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.
Description
Summary: make the
@bitgo/abstract-utxooffline vault explain and half-sign custodial PoX-5 late exits (post-CLTV 2-of-3 spend of a lockup output), and report the PSBTlocktimein the descriptor transaction explanation.Motivation and context: unstaking is a regular descriptor-wallet transaction in Wallet Platform, so the awaiting-signature export the Offline Vault Console receives is a descriptor transaction (PSBT + named wallet descriptors). With the policy fix from part 1 in place, the OVC still cannot verify a late exit: nothing enforces the PoX-5 CLTV spend rules before co-signing, and the explanation carries no
locktime, so the review screen cannot show the nLockTime the operator must verify against the unlock height. This blocks custodial unstake validation (WAL-2156; WAL-2144 matrix, SI-1191 unstake rollout).What changed:
getValidatorPox5Lockupinto the offline vault descriptor transaction policy (getDescriptorsFromDescriptorTransaction).classifyPox5Spend),nLockTime>= unlock height and below 500,000,000, non-final sequence on the lockup input (assertPox5LocktimeSpend), exactly one lockup input. Early exits (principal preimage branch) stay out of scope (WAL-2145) and are rejected.locktimein theTransactionExplanationof a descriptor transaction (previously onlyoutputs,changeOutputsandfee).toWasmUtxoCoinName(tbtcstx/tbtcstxprivate1→tbtcreg,tbtcstxsignet→tbtcsig) so explain works ontbtcstxsignet; the now-redundantwasmNameoverrides on the coin classes are removed.@bitgo/utxo-staking(the WAL-2022 staking policy).Issue Number
WAL-2156
Type of change
How Has This Been Tested?
@bitgo/abstract-utxounit tests:mocha --recursive test/unit/— 1682 passing across this stack (1660 on part 1).OfflineVault PoX-5 late exitunit tests over bothbtcandtbtcstxsignet: explain returns outputs/change/fee and thelocktime; half-sign produces a valid partial signature on the lockup input. Negatives: foreign staker keys, malformed and non-canonical lockup descriptors (explain and half-sign are rejected before any signature);nLockTimebelow the unlock height and timestamp locktime (explained withlocktimeshown, refused for half-signing); final sequence on the lockup input; early exit (principal preimage committed); two lockup inputs.OfflineVault descriptor transaction regressions: Wsh2Of3 and Wsh2Of3CltvDrop descriptor transactions still explain and half-sign; the existingWsh2Of3.buildAdmin.custodialfixture still signs (its explanation fixture is extended withlocktime).Checklist:
Stack
This PR is part 2 of 2 in a stack. Review and merge in order:
master)WAL-2156-pox5-offlinevault-late-exit-pt1) ← you are here