← Back to list

EIP-712: How to Verify Typed Data On Chain

Implementing EIP-712: Typed structured data hashing and signing

Leon Do in Coinmonks · 2022-12-24 04:44 · 49 claps · 1.5 min read
#solidity #eip-712 #712
Open on Medium ↗

EIP-712: How to Verify Typed Data On Chain

Implementing EIP-712: Typed structured data hashing and signing

Overview

The idea of EIP-712 is to standardize hashing and signing of typed structured data as instead to just byte strings. Below are the different ways of signing

Signing typed data allows the user to view human readable data before confirming instead of an arbitrary hexadecimal string.

Copy trading bots from the top traders. Try it for FREE.

Demo

https://leon-do.github.io/eip712-generator/

[embed]GitHub - leon-do/eip712-generator You can't perform that action at this time. You signed in with another tab or window. You signed out in another tab or…github.com

Signing

[embed]

The message params are divided into:

Domain: The below values are hashed to prevent others dapp from using the same signature.

  • name: Name of the dapp
  • version: Version of the dapp
  • chainId: To prevent replay attacks
  • verifyingContract: Address of the contract that will verify the signature

Message: The typed data (JSON) to sign. In the above example, the data is { "myValue": 123 }

Primary Type: Represents the top-level type of the object

Types: Defines all of the types

Verifying

[embed]

The smart contract function is divided into:

Defining types to match the signing (javascript) code.

Hashing the domain separator and the values.

Splitting the signature to r , s , v

ECRecover to verify the signature

Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing

Also, Read


메타데이터
post_id
4ea16548a45f
slug
eip-712-how-to-verify-typed-data-on-chain-4ea16548a45f
url
https://medium.com/coinmonks/eip-712-how-to-verify-typed-data-on-chain-4ea16548a45f
canonical_url
https://medium.com/coinmonks/eip-712-how-to-verify-typed-data-on-chain-4ea16548a45f
author_url
https://medium.com/@leondo
status
ok
fetched_at
2026-06-29 22:44:20