Verify message
Wander Injected API verifyMessage() function
This function allows verifying a cryptographic signature created by Wander.
Argument
Type
Description
data
ArrayBuffer
The data to verify the signature for
signature
ArrayBuffer | string
The signature to validate
publicKey?
string
options?
Configuration for the signature
Example usage
// connect to the extension
await window.arweaveWallet.connect(["SIGNATURE"]);
// data to be signed
const data = new TextEncoder().encode("The hash of this msg will be signed.");
// create signature
const signature = await window.arweaveWallet.signMessage(data);
// verify signature
const isValidSignature = await window.arweaveWallet.verifyMessage(data, signature);
console.log(`The signature is ${isValidSignature ? "valid" : "invalid"}`);
Last updated
Was this helpful?