Skip to main content

Sign a message

Overview

This guide describes how to sign string messages using Lockbox. In the MPC's collaborative process, the user and the Sky Mavis backend both participate in signing messages, creating a unique signature prefixed with the standard \x19Ethereum Signed Message. Message signatures serve as irrefutable proof of identity, enabling you to build secure verification systems within your game.

Prerequisites

Complete the steps in Create a wallet.

Sign a message

info

Before signing a message, encode it to Base64.

const txHash = await walletProvider.getSigner().signMessage(message);

Example:

const encodedMessage =
"Sign this message to breed Axie #223495 with Axie #123232";
const txHash = await walletProvider.getSigner().signMessage(encodedMessage);
//...