Signing

Sign messages on Aptos using OneKey

Learn how to sign messages for authentication or verification.


Sign Message

Sign arbitrary messages for authentication or verification:

const message = 'Welcome to MyApp!\n\nClick to sign in.\n\nNonce: abc123'

const response = await provider.signMessage({
  message,
  nonce: 'abc123',  // Optional nonce for replay protection
})

console.log({
  signature: response.signature,   // Hex-encoded signature
  fullMessage: response.fullMessage, // Full signed message
  prefix: response.prefix,         // Message prefix used
})

Sign Message Options


Verify Message (Off-chain)


Sign In (AIP Standard)

For standardized sign-in flow:


Error Handling

Last updated

Was this helpful?