# Sign Typed Data

The method `signTypedData_v4` currently represents the latest version of the [EIP-712 spec](https://eips.ethereum.org/EIPS/eip-712)\
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 ](https://docs.novabloq.com/web3-metamask/elements-details/web3-and-metamask/sign)action.

{% hint style="info" %}
A detailed documentation about it can be found in the official [MetaMask documentation](https://docs.metamask.io/guide/signing-data.html#sign-typed-data-v4).
{% endhint %}

### &#x20;<mark style="background-color:blue;">Parameters</mark>&#x20;

<table><thead><tr><th width="189.33333333333331">Parameter name</th><th width="94">Type</th><th>Description</th></tr></thead><tbody><tr><td>Chain ID</td><td>Number</td><td>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: <a href="https://chainlist.org/">https://chainlist.org/</a></td></tr><tr><td>Name</td><td>Text</td><td>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.</td></tr><tr><td>Verifying Contract</td><td>Text</td><td>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.</td></tr><tr><td>Version</td><td>Text</td><td>This tell you the current version of the domain object.</td></tr><tr><td>Message</td><td>Text</td><td>JSON object in text format. Completely open to what you would like the structure of it to be.</td></tr><tr><td>Primary Type</td><td>Text</td><td>Refers to the keys of the <em>types</em> from the next parameter field</td></tr><tr><td>Types</td><td>Text</td><td>Refers to the keys of the <em>types</em> object. See <a href="https://docs.metamask.io/guide/signing-data.html#sign-typed-data-v4">MetaMask documentation</a> for details.</td></tr></tbody></table>

### &#x20;<mark style="background-color:blue;">Events</mark>&#x20;

<table><thead><tr><th width="217">Event name</th><th>Description</th></tr></thead><tbody><tr><td>Signed</td><td></td></tr><tr><td>User canceled action</td><td>Triggered if the user rejects signing</td></tr></tbody></table>

### &#x20;<mark style="background-color:blue;">States</mark>&#x20;

<table><thead><tr><th width="171.33333333333331">State name</th><th width="83">Type</th><th>Description</th></tr></thead><tbody><tr><td>Sign: Signature</td><td>Text</td><td>Signature is in same format as from regular Sign action</td></tr></tbody></table>

### [Demo](https://web3-demo.bubbleapps.io/version-test/web3)

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.
