Sign Message

When a web application interfaces with Panda Wallet, it gains the ability to request users to sign specific messages. Applications can compose their own messages, which are then presented to users through Panda's signature prompt interface.

To transmit a message for user signing you must pass an object that contains a message. You can also pass an optional encoding param for more advanced signings:

{
  message: string;
  encoding?: "utf8" | "hex" | "base64" ;
};

Message signings use the user's identity keys. Derivation m/0'/236'/0'/0/0

It may look something like:

const wallet = initProvider(); // see "Detecting the Provider"

try {
    const message = { message: "Panda Wallet Is Awesome!" };
    const response = await panda.signMessage(message);
    console.log(response);
// {
//    address: "1EfhNiJUVPGEQdKjWUJB9XCEW69Sxctfn2",
//    pubKey: "0350a6af311b5eb69a666d241e1f0781b71352de01d54665fcb6aa1eac32a05515",
//    sig: "3045022100a315fe73b56fe50872595f0ea92169d141d6566c3ca52e19e134d3d63858321d02204670fa31b5d3a4dcf4c0e8bcea5bb40180ba9148a98e108450f1524309f8b187",
//    message: "Panda Wallet Is Awesome!"
// }
} catch (err) {
    console.log(err);
}

Last updated