Signing messages can be used for various method of authentication and off-chain operations, which can be put on-chain if necessary.

Prerequisite: Create Wallet

1

Obtain user pincode

In your app, ask the user for their wallet’s 6-digit pincode.

You must never store the user pin on your servers.

2

Sign Message

Fill in the message and sign. Message can be either string or byte array represented in hex string, a common case is to sign a hash.

  • Signing a string message

  • Signing a bytes array


const transaction = await wk.transactions.signMessage({
    network: Network.Base,
    signerWalletAddress: "<walelt address>",
    message: "hello world",
    userPin: "<user pin>",
});