stacks-network / sbtc-bridge-web

Web tool to facilitage peg operations for sBTC
https://sbtc.world
GNU Affero General Public License v3.0
14 stars 5 forks source link

Can't have secp pubkeys in taproot script paths #130

Closed radicleart closed 1 year ago

radicleart commented 1 year ago

Not sure if this is just a limitation of btc-signer but attempting to spend to an secp derived 33 byte pubkey on the reclaim script path causes this error to be thrown;

Uncaught (in promise) Error: P2TR: invalid leaf script=pk
    at checkTaprootScript (index.ts:1103:11)
    at taprootHashTree (index.ts:1119:5)
    at taprootHashTree (index.ts:1134:17)
    at Module.p2tr (index.ts:1209:42)
    at PegInTransaction.getOpDropPeginRequest (PegInTransaction.ts:248:22)
    at BuildTransaction.svelte:164:23
radicleart commented 1 year ago

This is a pretty big limitation on the reclaim feature.

It means we either need the user to provide a Schnorr pubkey for their reclaim or we can use the internal Schnorr pubkey from the Stacks Web Wallet - but balances of the corresponding bech32m address are not currently visible / easily spendable.