bitcoinsignMultipleMessages

circle-info

This is an Xverse custom method. It can only be invoked for users using the Xverse walletarrow-up-right.

You can request your user to sign multiple messages with their wallet's Bitcoin addresses, by invoking the signMultipleMessages method.

This enables your app to prompt users to sign batches of messages in a single step, instead of requiring multiple individual signMessage calls and multiple wallet popups.


Request parameters

Request parameters
Description

messages

an array of message objects to sign. Each message object supports:

  • address

  • message

  • protocol (ℹ️ optional)

Message object format

Each item in the messages array must be a message object with the below properties:

address

A string representing the address to use to sign the message.

message

A string representing the message to be signed by the wallet.

protocol (optional)

By default, signMultipleMessages will use two type of signatures depending on the Bitcoin address used for signing:

You have the option to specify your preferred signature type with the protocol parameter:


Usage example


Wallet prompt

The user will see a single message signing request prompt in the wallet, guiding them through the batch of messages to review and sign:


Response format

The signMultipleMessages method returns a Promise that resolves to the SignMultipleMessagesResult object.

signatures

An array of signed message results, returned in the same order as the request.

Each item in the signatures array is a SignMessageResult object with:

  • signature β€” a string representing the signed message

  • messageHash β€” a string representing the hash of the message

  • address β€” a string representing the address used for signing

Last updated