secretkeylabs / sats-connect

Sats connect is a simple javascript library that connects apps to Bitcoin wallets
https://www.npmjs.com/package/sats-connect
107 stars 40 forks source link

MessageSign hash applied? #121

Closed elRaulito closed 3 months ago

elRaulito commented 5 months ago

Description

Hi to everyone I would like to ask how can I get the hash of the message I am signing starting from the message I put inside the function, since it seems is not exactly the hash of the message itself

Is there any algo or encoding applied?

Thanks

Solution

No response

victorkirov commented 4 months ago

Which address are you signing the message with? We use different hashes depending on the address since we use bip322 for the ordinals address and ECDSA signing for the payments address 👀

victorkirov commented 4 months ago

You can see the bip322 hash generation here: https://github.com/secretkeylabs/xverse-core/blob/develop/connect/bip322Signature.ts#L20