---
eip: 7734
label: ERC-7734
title: Decentralized Identity Verification (DID)
status: Final
type: Standards Track
category: ERC
created: 2024-06-26
official: https://eips.ethereum.org/EIPS/eip-7734
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7734.md
canonical: https://eips.huatuo.xyz/eip-7734/
lang: en
tldr: A minimal on-chain identity registry where each address stores only hashes of its identity data and verification proofs, with events for creation, verification and revocation.
tags: [identity, did, privacy, registry]
---

# ERC-7734: Decentralized Identity Verification (DID)

> A privacy-preserving method for decentralized identity verification, enabling secure integration of identity management in dApps.

**TL;DR:** A minimal on-chain identity registry where each address stores only hashes of its identity data and verification proofs, with events for creation, verification and revocation.

## What problem does it solve?

Many dApps need to know that a user has passed some identity check: KYC for a DeFi pool, age verification for a game, a "real human" check for an airdrop. Centralised identity providers hold raw personal data, are frequent breach targets, and leave users with little control. Existing decentralised identity standards can be heavy to integrate.

ERC-7734 proposes a deliberately small interface: keep personal data off-chain, store only cryptographic hashes on-chain, and emit events so anyone can trace when an identity was created, verified or revoked.

## How it works

Each address can hold one `Identity` record:

| Field | Meaning |
| --- | --- |
| `userAddress` | The owner's address (the identity itself) |
| `identityHash` | Hash of off-chain identity data |
| `verificationHashes` | Two hashes derived from off-chain proofs or attestations |
| `isVerified` | Current status |
| `timestamp` | When the identity was created |

The caller manages only their own record:

- `createIdentity(identityHash)` registers it (once per address) and emits `IdentityCreated`.
- `verifyIdentity(bytes32[2])` stores the two verification hashes, marks the record verified and emits `IdentityVerified`.
- `revokeIdentity()` sets `isVerified` back to false and emits `IdentityRevoked`.
- `getIdentity(user)` returns the record for anyone to read.

What the verification hashes mean, and how they are produced (third-party attestation, signed document, cryptographic challenge), is left to the implementer. Names, ages and other attributes stay off-chain.

## Sample code

The interface from the standard:

```solidity
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;

interface IDecentralizedIdentity {
    struct Identity {
        address userAddress;
        bytes32 identityHash;
        bytes32[2] verificationHashes;
        bool isVerified;
        uint256 timestamp;
    }

    event IdentityCreated(address indexed userAddress, bytes32 identityHash, uint256 timestamp);
    event IdentityVerified(address indexed userAddress, bytes32[2] verificationHashes, uint256 timestamp);
    event IdentityRevoked(address indexed userAddress, uint256 timestamp);

    function createIdentity(bytes32 identityHash) external;
    function verifyIdentity(bytes32[2] calldata verificationHashes) external;
    function revokeIdentity() external;
    function getIdentity(address userAddress) external view returns (Identity memory);
}
```

Checking a user's status from a dApp (ethers v6):

```ts
import { Contract, JsonRpcProvider } from "ethers";

const abi = [
  "function getIdentity(address) view returns (tuple(address userAddress, bytes32 identityHash, bytes32[2] verificationHashes, bool isVerified, uint256 timestamp))",
];
const registry = new Contract(REGISTRY_ADDRESS, abi, new JsonRpcProvider(RPC_URL));
const id = await registry.getIdentity(user);
console.log(id.isVerified ? "verified" : "not verified");
```

## Things to know

- Status is **Final**.
- In the reference implementation, `verifyIdentity` is called by the user on their own record and is not checked against any external verifier. On its own, `isVerified` therefore means "the owner submitted proofs", not "a trusted party approved them". Real deployments need to restrict who can verify, or have dApps check the hashes against a trusted attester.
- The spec recommends that verification hashes include nonces or timestamps to prevent replay, and that strong hash functions are used.
- Hashes of low-entropy personal data (a birth date, a passport number) can be brute-forced; salt them before hashing.
- For a different, older approach to on-chain identity, see [ERC-1056](/eip-1056/); for user profiles, see [ERC-7866](/eip-7866/).


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7734
