Repository navigation
Sign a Taproot commit and its reveal as one bundle - #8
Merged
Merged
Conversation
Core 11.5 returns an unsigned reveal the source key must sign. XCP Wallet 0.14.1 signs both halves in one xcp_signPsbts approval as a commit-and-reveal bundle. signCommitAndReveal sends that pair only to a wallet that lists the kind, refuses early what the wallet would refuse, binds the signed PSBTs to the request, and finalizeCommitAndReveal builds the reveal's script-path witness.
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.
Client support for XCP Wallet 0.14.1's
commit-and-revealbundle.src/provider/commit-reveal.ts:commitAndRevealRequest(params)buildsxcp_signPsbts[{ requests: [commit, reveal] }](same envelopesignPsbtsuses). Commit:signInputs: { [source]: every input }, ALL per input (or DEFAULT from a P2TR source), intent = caller's marketplace intent or{ standard: 'counterparty-reveal', version: 1, action: 'fund_commit' }. Reveal:signInputs: { [source]: [0] },[0x00](default) or[0x01], intent exactlysign_reveal. Refuses early (invalid_argument) a non-P2WPKH/P2TR source, a reveal that is not one input spending commit output 0 with one tapleaf, a missing CNTRPRTY marker, or out-of-contract sighashes. PSBT bytes are sent as given, not re-serialized.XcpWallet.signCommitAndReveal,WalletSession.signCommitAndReveal,useWallet().signCommitAndReveal: capability-gated onmarketplaceBundlesincludingcommit-and-reveal(capability/unsupportedotherwise, including wallets with no report); returns{ commit, reveal }signed PSBT hexes, each bound to its request (transaction_mismatch).finalizeCommitAndReveal: finalizes the commit and writes the reveal witness[sig, leaf, control block](btc-signer cannot finalize an envelope leaf), checking the signature's leaf hash and that the reveal spends the commit.assertProviderCanSignPsbtsrecognizes the pair (second intentsign_reveal): commit under the batch contract, reveal by its own rule, so a SegWit source's DEFAULT reveal is not refused by the batch sighash list.docs/commit-and-reveal.md, README, CHANGELOG.Tests (mocked provider, real PSBTs built with btc-signer): exact wire request, marketplace intent and sighash options, capability refusals, local refusals with no wallet call, answer binding, signPsbts path, finalization of a really signed pair.
Local gates: check (tsc + biome, pre-existing warnings only), 345 tests passed, build ok.