Design Your JSON structure

Decide the data structure

The JSON structure is the data you intend users to sign.

For the sake of this tutorial, we use the following structure for our data

let message = {
nonce: 2,
from: "0x256144a60f34288F7b03D345F8Cb256C502e0f2C"

nonce : It is a unique value chosen by an entity in a protocol which is used to protect the entity against replay attacks ​

from : Public key of the user signing the message.

For the sake of this tutorial, We use simple data structures. However, EIP712 also supports complex data structures. For more information, refer to EIP712 documentation​