dag_signMessage

Creates a request to generate a safe signature of typed message data from the selected wallet. This method is intended to be used for general message signing use cases such as verifying the ownership of a wallet.

This method adds a standard "\u0019Constellation Signed Message:\n" + len(message) + "\n" prefix when calculating the signature hash. The addition of the prefix prevents users from being tricked into signing a valid token transaction with this method.

The final string looks like this: "\u0019Constellation Signed Message:\n" + len(message) + "\n" + message

Parameters

Name
Type
Description

Account

Address

Account to sign from.

Request

Base64<JSONEncoded<SignatureRequest>>

Signature Request.

Return Type

HexString - The constellation ecdsa signature.

Base64

/**
 * A base64 encoded string
 * */
type Base64 = string;

JSONEncoded

/**
 * A JSON encoded string
 * */
type JSONEncoded = string;

JSONScalarValue

SignatureRequest

Example

Verify

In order to verify the signature you can use the verify() method from dag4.js:

Last updated

Was this helpful?