Closed aximili-dev closed 7 months ago
I have the following code in my frontend, how would I verify that the signature is correct in the backend?
import { signMessage, SignMessageOptions, } from "sats-connect"; async signMessage( address: string, msg: string, ): Promise<string> { return new Promise(async (resolve, reject) => { const signMessageOptions: SignMessageOptions = { payload: { message: "foobar", address, network: { type: "Mainnet", }, }, onFinish: (response) => resolve(response), onCancel: () => reject(new Error()), }; await signMessage(signMessageOptions); }); }
i'm also trying to figure out the same thing
@aximili-dev I found this library which seems to work perfectly out of the box to verify the signature: https://github.com/ACken2/bip322-js
I have the following code in my frontend, how would I verify that the signature is correct in the backend?