signMultipleMessages
This is an Xverse custom method. It can only be invoked for users using the Xverse wallet.
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
messages
an array of message objects to sign. Each message object supports:
addressmessageprotocol(βΉοΈ optional)
Message object format
Each item in the messages array must be a message object with the below properties:
address
addressA string representing the address to use to sign the message.
message
messageA string representing the message to be signed by the wallet.
protocol (optional)
protocol (optional)By default, signMultipleMessages will use two type of signatures depending on the Bitcoin address used for signing:
ECDSA signatures over the secp256k1 curve when signing with the Bitcoin payment (
p2sh) addressBIP322 signatures when signing with the Bitcoin Ordinals (
p2tr) address or a Ledger-based Bitcoin payment address (p2wpkh)
You have the option to specify your preferred signature type with the protocol parameter:
ECDSAto request ECDSA signatures over the secp256k1 curve Available for payment addresses only (p2shandp2wpkh)BIP322to request BIP322 signatures Available for all payment (p2shandp2wpkh) & ordinals addresses (p2tr)
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
signaturesAn 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 messagemessageHashβ a string representing the hash of the messageaddressβ a string representing the address used for signing
Last updated