Signing Messages

Sign arbitrary messages without creating a transaction

Glow gives you the ability to prompt the user to sign an arbitrary message, thereby proving their ownership of the wallet. For the safety of our users, the message is shown to the user before they approve or reject the request.

We highly recommend checking out the Signing In with Glow functionality and using it wherever possible. It is a clearer, easier and more secure way to verify the identity of the user.

To prompt the user to sign a message, use the window.glow.signMessage function. It takes one argument, messageBase64, which is your message in base-64 encoding.

const { signedMessageBase64 } = await window.glow.signMessage({
  messageBase64: btoa("Hello World"),
})

The returned value is an object with one field, signedMessageBase64, which is the base-64 encoded signature.

Please note that Ledger doesn't allow signing arbitrary messages. If you use the signMessage function, users won't be able to interact with your site with their Ledger wallets.