Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sign message using schnor signatures from unisat wallet #75

Open
cloud6605 opened this issue Sep 18, 2024 · 2 comments
Open

sign message using schnor signatures from unisat wallet #75

cloud6605 opened this issue Sep 18, 2024 · 2 comments

Comments

@cloud6605
Copy link
Collaborator

Hi, is there a way to sign message using schnor signatures from unisat wallet? I've looking for a way to, given "message": string -> return schnorr signature signed by user's private key.
image

@slient-coder
Copy link
Contributor

When do you need to use sign message using schnorr signatures?
The signPsbt method can sign a P2TR transaction using the schnorr method.

@bombnp
Copy link

bombnp commented Sep 19, 2024

When do you need to use sign message using schnorr signatures? The signPsbt method can sign a P2TR transaction using the schnorr method.

Hi @slient-coder. I'm the one who submitted this issue.

I'm building a dApp for interfacing with CAT20 protocol. There's a logic in CAT20 smart contract lib that requires signing a custom sighash with user's tweaked private key and return the schnorr signature to use in the smart contract state verification. I'm not trying to sign a transaction to be broadcasted.

I tried to see if I can use signPsbt() and extract the signature from the witness, but it does not work for me because:

  1. I need to sign a custom sighash. I can't control sighash in signPsbt(), but I can control what is signed in signMessage.
  2. There are a lot of checks in signTaprootInput() function in bitcoinjs-lib used by your extension, which prevents me from signing it if some conditions are invalid (prevout public key does not match signing public key, tapleaf hash does not contain signing public key, etc.).

I looked around other wallets and none of them supports signing message as schnorr signature too. If you implement this, you would be the first wallet to support complex CAT20 operations that requires schnorr signatures from user's private key.

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

No branches or pull requests

3 participants