Skip to content

Implement Taproot key-path wallet signing#4009

Merged
mswilkison merged 3 commits into
feat/frost-schnorr-migration-scaffoldfrom
codex/taproot-key-path-wallet-signing
Jun 2, 2026
Merged

Implement Taproot key-path wallet signing#4009
mswilkison merged 3 commits into
feat/frost-schnorr-migration-scaffoldfrom
codex/taproot-key-path-wallet-signing

Conversation

@mswilkison

Copy link
Copy Markdown
Contributor

Summary

Stacked on #3866.

This PR implements Taproot-native key-path wallet signing for the FROST migration path. It adds P2TR script handling, BIP341 SIGHASH_DEFAULT computation, BIP340 Schnorr signature verification, and single-element Taproot witness application in the Bitcoin transaction builder.

The wallet transaction executor now routes all-P2TR transactions through the Schnorr/Taproot witness path. Mixed Taproot plus legacy inputs are rejected before signing, so this does not introduce a dual-signing model.

Details

  • Add P2TR script helpers and x-only output key extraction.
  • Add Taproot key-path sighash generation without a repo-wide btcd upgrade.
  • Add AddTaprootKeyPathSignatures for 64-byte BIP340 signatures.
  • Preserve canonical 32-byte FROST signing messages when big.Int strips leading zero bytes.
  • Add builder and wallet tests covering all-P2TR signing and mixed-input rejection.

Validation

  • go test ./pkg/bitcoin ./pkg/tbtc
  • go test -tags=frost_native ./pkg/frost/signing

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8b44ec32-10df-46c0-b927-402d1b891c7c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/taproot-key-path-wallet-signing

Comment @coderabbitai help to get the list of available commands and usage tips.

@mswilkison mswilkison changed the title [codex] Implement Taproot key-path wallet signing Implement Taproot key-path wallet signing Jun 2, 2026
@mswilkison mswilkison force-pushed the codex/taproot-key-path-wallet-signing branch from 0a394ce to 5438136 Compare June 2, 2026 22:14
@mswilkison mswilkison force-pushed the codex/taproot-key-path-wallet-signing branch from 5438136 to 8efa5c4 Compare June 2, 2026 22:25
@mswilkison mswilkison marked this pull request as ready for review June 2, 2026 23:08
@mswilkison mswilkison merged commit 029f0d3 into feat/frost-schnorr-migration-scaffold Jun 2, 2026
16 checks passed
@mswilkison mswilkison deleted the codex/taproot-key-path-wallet-signing branch June 2, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant