fungible-systems / micro-stacks

Tiny libraries for building the next generation of Stacks apps.
https://micro-stacks.dev
MIT License
82 stars 15 forks source link

getPublicKeyFromSignature should allow compressed=true to be passed. #173

Open radicleart opened 1 year ago

radicleart commented 1 year ago

Using: "micro-stacks": "^1.1.4", "@noble/secp256k1": "^1.7.1"

Comparing getPublicKeyFromSignature from "micro-stacks/connect" to recoverPublicKey from '@noble/secp256k1'

The latter allows the flag compressed=true to be passed whereas the former hard codes it to false.

The recoverPublicKey recovers the correct pubkey / stxAddress from a signature signed with getOpenSignMessage from '@micro-stacks/svelte whereas incorrect pubkey returned from getPublicKeyFromSignature .

radicleart commented 1 year ago

Linked issue - needed to remove ref. to common js modules in api as this is not supported in Scure/btc-signer. See https://github.com/paulmillr/scure-btc-signer/issues/32

aulneau commented 1 year ago

sorry, can you be more specific -- I have a PR here that will let you pass it. is this what you need? https://github.com/fungible-systems/micro-stacks/pull/176

radicleart commented 1 year ago

Yes believe 176 is all that's needed.