Sign message
Wander Injected API signMessage() function
Last updated
Was this helpful?
Wander Injected API signMessage() function
Last updated
Was this helpful?
This function allows creating a cryptographic signature for any piece of data for later validation.
data
ArrayBuffer
The data to generate the signature for
options?
Configuration for the signature
Note: This function should only be used to allow data validation. It cannot be used for on-chain transactions, interactions or bundles, for security reasons. Consider implementing , or .
Note: The function first hashes the input data for security reasons. We recommend using the built in function to validate the signature, or hashing the data the same way, before validation ().
Currently Wander allows you to customize the hash algorithm (SHA-256
by default):
You might encounter situations where you need to verify the signed message against an Wander generated signature, but the extension is not accessible or not installed (for e.g.: server side code, unsupported browser, etc.).
In these cases it is possible to validate the signature by hashing the message (with the algorithm you used when generating the signature through Wander) and verifying that against the Wander signature. This requires the message to be verified, the signature and the . Below is the JavaScript (TypeScript) example implementation with the , using SHA-256
hashing: