Skip to content

feat(frontend): add taproot PSBT signing utility for browser wallets#2432

Draft
joelklabo wants to merge 3 commits intoRoboSats:mainfrom
joelklabo:max/run15-taproot-psbt-utils
Draft

feat(frontend): add taproot PSBT signing utility for browser wallets#2432
joelklabo wants to merge 3 commits intoRoboSats:mainfrom
joelklabo:max/run15-taproot-psbt-utils

Conversation

@joelklabo
Copy link
Copy Markdown

Summary

Adds a frontend utility module for the Taproot escrow workstream in #230, focused on the two integration pieces discussed in the issue thread:

  • keypair generation for Taproot-compatible x-only pubkeys
  • browser wallet PSBT signing adapter with provider detection and encoding normalization

What Changed

  • Added frontend/src/utils/taproot.ts:
    • generateTaprootKeypair() for deterministic/generated secret -> x-only pubkey
    • isLikelyPsbt() and normalizePsbt() for base64/hex PSBT handling
    • getBrowserPsbtSigner() for browser provider detection (unisat, okxwallet.bitcoin)
    • signPsbtWithBrowserWallet() wrapper that signs via browser wallet and returns normalized base64 PSBT
  • Added tests: frontend/src/utils/taproot.test.ts
  • Exported helpers from frontend/src/utils/index.ts

Validation

  • npm run lint -- src/utils/taproot.ts src/utils/taproot.test.ts src/utils/index.ts
  • npm test -- src/utils/taproot.test.ts --runInBand
  • npm run build

Notes

  • This is intentionally scoped as a utility layer to unblock frontend integration work for Taptrade paths without coupling to backend order-state changes in this PR.

@joelklabo
Copy link
Copy Markdown
Author

Hi @ReneSmeets @cryptosharks - checking in on this PR. It's ready to merge and implements the PSBT signer utilities for the bounty (600k sats). Let me know if any changes are needed!

@joelklabo
Copy link
Copy Markdown
Author

Hi @ReneSmeets @cryptosharks - just checking in again. This PR is ready to merge and implements the PSBT signer utilities for the 600k sats bounty. Is there anything else needed from my side? Thanks!

@joelklabo
Copy link
Copy Markdown
Author

Hi @ReneSmeets @cryptosharks - checking in again. This PR is mergeable and implements the PSBT signer utilities for the 600k sats bounty. Is there anything else needed to move this forward? Thanks!

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