Smart Deals - promotions, discount codes and sales

EIP-712 Hash Calculator

Calculate the EIP712Domain type hash and domain separator for your data.

Secure (SSL)
Client-Side Processing
100% Free
Instructions
  • 1
    Enter data
    Enter content, paste text or load a file from disk.
  • 2
    Click the button
    The tool will immediately process your data in the browser.
  • 3
    Get the result
    Copy the finished text or save the file to your device.
function runTool() {
  return "Result ready in 0.1s";
}

Rate this tool:

Related tools

Other tools you may find useful

How to Use the EIP-712 Hash Calculator

The EIP-712 hash calculator derives two values useful when working with signatures that follow the EIP-712 standard: the domain type hash and the domain separator. Everything is calculated in your browser, and the result appears as soon as you enter the data.

Here is how to do it step by step:

  1. Enter the domain Name. The default value is Ether Mail.
  2. Enter the Version - by default it is 1.
  3. Provide the Chain ID, which is the network number. The default is 1.
  4. Enter the Contract address that verifies the signature. The default is 0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC.
  5. Click Calculate Domain Separator. The calculation also runs automatically on load, so you usually do not need to click anything.

In the results you will see two items: the EIP712Domain Type Hash and the Domain Separator. Both have the form 0x followed by a hex string. You can select and copy them anywhere.

For the default values, the result is as follows:

  • EIP712Domain Type Hash: 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f
  • Domain Separator: 0xf2cee375fa42b42143804025fc449deafd50cc031ca257e0b194a650a912090f

If you want to check compatibility with a tool you use every day, enter exactly the same values and compare both results.

What Is domainSeparator and the EIP712Domain Type

EIP-712 is a way to sign data so you can see exactly what you are signing. To keep the same signature from being valid in every application and every network, the concept of a domain was introduced.

The domain is a set of information describing the signing context: the application name, its version, the network number, and the address of the contract that checks the signature. The EIP712Domain type is the template for that domain - it says which elements it consists of and in what order they are combined.

The domain separator, or domainSeparator, is the hash of the entire domain. It is created by first hashing the type description itself, then appending the hashes of the name and version along with the network and contract information. The whole thing is finally turned into a single fixed-length hash.

Why is this needed? Because of the separator, a signature made in one network will not work in another, and a signature intended for one contract will not work in another. This protects against reusing the same signature somewhere else.

How the Name, Version, Chain ID, and Address Fields Are ABI-Encoded

Each domain element must be converted to a byte string in a defined way before the final hash can be created from them. It works like this:

  • Name - text encoded in UTF-8 and then converted to a 32-byte hash.
  • Version - treated exactly like the name: first text, then a 32-byte hash. The value 1 is also text, not a number.
  • Chain ID - a number stored in 32 bytes, from the most significant byte to the least significant byte. For the value 1, this is a number with a single one at the end, padded with leading zeros.
  • Contract address - the 20 bytes of the address padded with zeros on the left to 32 bytes.

Then all parts are combined in one order: the type description hash, the name hash, the version hash, the network number, and the contract address. From this combined data, one final hash is produced - that is the domain separator.

The hash is the result of the one-way keccak-256 transformation: the same data always produces the same value, and the input data cannot be reconstructed from the result. It is written as 0x followed by 64 hex characters, or 32 bytes.

Example for the default values: name Ether Mail, version 1, Chain ID 1, and address 0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC. The type description alone gives the hash 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f, and after the remaining elements are appended, the domain separator is 0xf2cee375fa42b42143804025fc449deafd50cc031ca257e0b194a650a912090f.

DomainSeparator, hashStruct, and Signature Digest: How They Differ

These three concepts are often confused, but they mean different things.

TermWhat It Covers
EIP712Domain Type HashThe description of which elements the domain consists of. It does not depend on the values entered - it changes only if the set of domain elements itself changes.
Domain SeparatorThe type description together with specific values: name, version, network number, and contract address.
Struct Hash (hashStruct)A general term for the hash of any data structure made up of a type description and values. The domain separator is the struct hash for the domain.
Signature DigestThe value that the wallet actually signs. It is created by combining the EIP-712 prefix, the domain separator, and the hash of the actual message.

The most important takeaway is this: the domain separator is only half the job. The calculator computes the type description and separator, but it does not create the message hash or the final value to be signed. If you want to sign a specific message, you still need its own structure and values.

Limitations of the EIP-712 Hash Calculator

This is a simple tool for one job. It is worth knowing what not to expect from it.

  • No additional domain salt. Some domains include a randomizing value. The calculator supports four elements: name, version, network number, and contract address. If your domain uses a salt, the separator produced here will not match your application.
  • No message hash and no signature digest. The tool does not accept the content of the message being signed, so it will not compute its struct hash or the value signed by the wallet.
  • No Chain ID validation. You enter the Chain ID yourself. The calculator does not know which network a given number belongs to and does not compare it with anything.
  • No file import or export. You enter values manually and copy the results manually.
  • The result depends solely on your data. A different name, version, network number, or address produces a completely different separator. Before using the result, make sure the values match character for character what your application uses.
  • The tool does not sign anything or connect to a wallet. It also does not check whether a contract actually exists at the address you provide.

Enter the contract address in full form, with the 0x prefix and 40 hex characters. All calculations run locally in your browser, and the values you enter are not sent anywhere.

Frequently Asked Questions

How do I calculate domainSeparator for EIP-712?

Enter the domain name, version, network number, and contract address, then click Calculate Domain Separator. The calculation also runs automatically on load, so usually you only need to fill in the data. The result appears under Domain Separator as 0x followed by a hex string.

What is the domain separator in EIP-712?

It is the hash of the information describing the signing context: the application name, its version, the network number, and the contract address. Thanks to it, a signature made for one application or one network is not valid somewhere else.

How does the EIP712Domain type hash differ from the domain separator?

The type hash describes only the domain structure, meaning the list of its elements, and does not depend on the values entered. The domain separator is that same description enriched with the specific name, version, network number, and contract address.

Will the calculator compute the signature digest or the hash of the entire message?

No. The tool provides the domain type hash and the domain separator. The message hash and the value that the wallet signs are determined separately in your application.

Does the calculator support a domain with a salt field?

No, it supports four elements: name, version, network number, and contract address. If your domain includes an additional salt, the separator obtained here will be different from the one in your application.

Is the data entered in the calculator sent anywhere?

No. Calculations run locally in your browser and nothing is sent externally. You can enter values without worry.

The result is calculated locally and covers only the domain separator; before using it in a signature, verify the domain type and parameters against the contract.

Install Webp.pl Have the tools in your own pocket!