Sign Typed Data

Using the method called signTypedData_v4

The method signTypedData_v4 currently represents the latest version of the EIP-712 spec If you don't know what it is then most likely you don't need it, in that case, we recommend using the simpler Sign action.

A detailed documentation about it can be found in the official MetaMask documentation.

Parameters

Parameter name
Type
Description

Chain ID

Number

The EIP-155 chain id. Prevents a signature meant for one network, such as a testnet, from working on another, such as the mainnet. See all chains IDs here: https://chainlist.org/

Name

Text

This is primarily for UX(User Experience) purposes. For example, as a user, you're using an Ether Mail app and a dialog comes up for cryptokitties exchange, this would arouse suspicion due to what the name is on the signature.

Verifying Contract

Text

This is an extra layer of assurance. Even if two developers end up creating an app with the same name, they will never have the same contract address.

Version

Text

This tell you the current version of the domain object.

Message

Text

JSON object in text format. Completely open to what you would like the structure of it to be.

Primary Type

Text

Refers to the keys of the types from the next parameter field

Types

Text

Refers to the keys of the types object. See MetaMask documentation for details.

Events

Event name
Description

Signed

User canceled action

Triggered if the user rejects signing

States

State name
Type
Description

Sign: Signature

Text

Signature is in same format as from regular Sign action

This particular demo page contains many features combined in one page, see lower on the page the section "Sign data" and use the button "Sign Typed Data" to see how it looks.

Last updated