Wander Docs
HomeGithub
  • ๐Ÿ‘‹Welcome to Wander
  • โ›๏ธDeveloper tooling
    • Wander Devtools
    • ArLocal Devtools
  • ๐Ÿ“šExternal libraries
    • Arweave Wallet Kit
    • arweave-js
  • ๐Ÿ”ญDemos
    • Applications
  • ๐ŸงชAPI
    • Intro
    • Events
    • Connect
    • Disconnect
    • Get active address
    • Get active public key
    • Get all addresses
    • Get wallet names
    • Sign Transaction
    • Dispatch Transaction
    • Sign DataItem
    • Batch Sign DataItem
    • Sign message
    • Verify message
    • Private hash
    • User Tokens
    • Token Balance
    • Encrypt
    • Decrypt
    • Crypto signature
    • Subscriptions
    • Retrive permissions
    • Retrive Gateway Config
  • ๐ŸŒWander.app
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. API

Verify message

Wander Injected API verifyMessage() function

PreviousSign messageNextPrivate hash

Last updated 3 months ago

Was this helpful?

This function allows verifying a cryptographic signature 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

Note: This function requires the permission.

Note: The publicKey argument is optional, if it is not provided, the extension will use the currently selected wallet's public key. You might only need this if the message to be verified was not made by the connected user.

Note: The options argument is optional, if it is not provided, the extension will use the default signature options (default hash algorithm) to sign the data.

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"}`);

Arweave wallet JWK.n field, transaction owner field or .

๐Ÿงช
public key from Wander
created by
SignMessageOptions
SIGNATURE