Message signing allows you to apply a unique cryptographic signature to verify your identity on EVM networks.
Using the CDP-SDK, developers can enable signing while presenting clear, meaningful messages to users, rather than unintelligible raw hexadecimal hashes.
The v2 Wallet API supports EIP-712 for typed structured data hashing and signing, providing a way to create human-readable messages that can be signed and verified onchain.
Type definitions describe the structure of your message. They include the required EIP712Domain type and your custom types. Each custom type is defined as an array of fields, where each field has a name and type.
EIP712Domain: required base type that defines the domain structure
name (string)
version (string)
chainId (uint256)
verifyingContract (address)
salt (bytes32)
Custom Types: your application-specific types (e.g., “Person”)
After running the above snippet, you should see output similar to the following:
Copy
Ask AI
Created account: 0x2Ae896e791c9596c7beDeCC3E06Fa6DA9aE2B193 Signature: 0xa8fdc11edcf120b116d34131159ca356af52b90732425ebec48cac125a449e7d2151d97ca8232bff43568da9ee2249cf1bc187c392f1d1e53c72fc0b5937f5b31b
To summarize, in the example above, we:
Created an EVM account
Signed a message using EIP-712 structured data, which includes: a domain separator, type definitions, primary type, and a message payload (a person named Alice who is 25 years old)
The EIP-712 structured data was used to create a human-readable message which we successfully signed cryptographically.