Closed newbreedofgeek closed 1 year ago
As an update.
I tried Buffer.from(sig, 'hex')
which converted it 64 bytes but the signature verification still failed.
i.e. accessRequesterVerifier.verify(Buffer.from(message), Buffer.from(sig, 'hex'));
Hello @newbreedofgeek,
Furthermore, in the backend, the original message has to be serialized accordingly before being passed to the verifier.
For example,
message = new SignableMessage({ message: Buffer.from("hello") });
serializedMessage = message.serializeForSigning();
messageSignature = Buffer.from("561b...5d0f", "hex");
console.log(verifier.verify(serializedMessage, messageSignature));
Snippet extracted from: https://docs.multiversx.com/sdk-and-tools/sdk-js/sdk-js-cookbook/#verifying-signatures
Does this work on your side?
An update of the sdk-dapp will not automatically solve this - the change has to be applied on the backends using the new sdk-wallet. The migration notes do not include an explicit example for message verification, I am adding / linking one right now, thanks :pray:
Hi @andreibancioiu
Tnx for the super quick response.
It worked! 🙏
Noticed that mx-sdk-dapp is still using older SDK Wallet: https://github.com/multiversx/mx-sdk-dapp/blob/main/package.json#L151
This is causing us some issues in our front end when we sign some data and send it to backend (which uses latest SDK Wallet) to verify.
Raised this in MX dev chat on Telegram...
Tnx!