Wander Docs
HomeGithub
  • 👋Welcome to Wander
  • ⚡Wander Connect
    • Intro - Wander Connect
    • Options
    • Properties
    • Methods
    • Event Callbacks
    • Custom UI
    • Advanced Customization
  • 🔭Examples
    • Playground
    • Applications
  • ❔How To
    • Subsidizing Payments
  • 🧪API
    • Intro - Wander Injected API
    • 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
  • ⛏️Developer tooling
    • Wander Devtools
    • ArLocal Devtools
  • 📚External libraries
    • Arweave Wallet Kit
    • arweave-js
  • 🌐Wander.app
Powered by GitBook
On this page
  • Alternatives
  • Example usage

Was this helpful?

Edit on GitHub
  1. API

Crypto signature

Wander Injected API signature() function

PreviousDecryptNextSubscriptions

Last updated 4 months ago

Was this helpful?

Deprecation warning: The signature() function is deprecated in ArConnect 1.0.0. Read about the alternatives below.

Alternatives

There are quite a few cases where you might need to generate a cryptographic signature for a piece of data or message so that you can verify them. The most common ones and their alternatives are the following:

  • Generating a signature for a transaction:

  • Generating a signature for a bundle data item: or

  • Signing a message to later validate ownership: combined with

The safety of our users' wallets is our top priority, so we've decided to deprecate our signature() function, following the example of Arweave.app and we expect other Arweave wallets now or in the future to do the same, so eventually, this should be a smooth transition to the new alternatives. We are sorry for any inconveniences caused by this change.

Often an application might need a piece of data that is created, authorized or confirmed by the owner of a wallet. The signature() function creates a cryptographical signature that allows applications to verify if a piece of data has been signed using a specific wallet. This function works similarly to the .

Argument
Type
Description

data

The encrypted data to be signed with the user's private key

algorithm

An object specifying the algorithm to be used and any extra parameters if required

Note: This function requires the permission.

Note: Not to be confused with the function that is created to sign Arweave transactions.

Example usage

// connect to the extension
await window.arweaveWallet.connect(["SIGNATURE"]);

// sign data
const signature = await window.arweaveWallet.signature(new TextEncoder().encode("Data to sign"), {
  name: 'RSA-PSS',
  saltLength: 0,
});

console.log("The signature is", signature);

, or

, AesCmacParams or

🧪
ArrayBuffer
TypedArray
DataView
RsaPssParams
EcdsaParams
sign()
signDataItem()
dispatch()
signMessage()
verifyMessage()
webcrypto sign API
sign()
SIGNATURE