---
eip: 7231
label: ERC-7231
title: Identity-aggregated NFT
status: Final
type: Standards Track
category: ERC
created: 2023-06-25
requires: 165, 721, 1271
official: https://eips.ethereum.org/EIPS/eip-7231
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7231.md
canonical: https://eips.huatuo.xyz/eip-7231/
lang: en
tldr: "An ERC-721 extension that binds a hashed bundle of a user's Web2 and Web3 identities to an NFT, so apps can verify which accounts belong to the token's owner."
tags: [nft, identity, did, erc721]
---

# ERC-7231: Identity-aggregated NFT

> The aggregation of web2 & web3 identities to NFTs, authorized by individuals, gives attributes of ownerships, relationships, experiences.

**TL;DR:** An ERC-721 extension that binds a hashed bundle of a user's Web2 and Web3 identities to an NFT, so apps can verify which accounts belong to the token's owner.

## What problem does it solve?

People carry many identities: a wallet address, an ENS name, a DID, accounts on social networks and other Web2 services. Applications that want to know "this wallet also owns that account" have no common, verifiable way to ask. ENS gives names but no proof of off-chain accounts; soulbound tokens usually depend on a central attester.

ERC-7231 lets the owner of an NFT (or soulbound token) attach a list of their identities to it. The list lives in the token's metadata, and only a hash of it (the *identities root*) is stored on-chain, so anyone can check that the off-chain list has not been tampered with and was signed by the owner.

## How it works

1. **Metadata.** The token's JSON metadata gains a `MultiIdentities` array. Each entry has a `userID` (a Web2 account or a DID), a `verifierUri` describing how to verify it, an optional `memo`, and free-form `properties`.
2. **On-chain root.** The owner calls `setIdentitiesRoot(id, root)`, where `root` is a hash over the user IDs. The contract stores it and emits `SetIdentitiesRoot`.
3. **Verification.** Anyone can call `verifyIdentitiesBinding(id, owner, userIDs, root, signature)`. Per the spec it checks:
   - that `owner` actually owns NFT `id`,
   - that the user IDs are well formed,
   - that `root` matches what is stored for the token,
   - that `signature` over the root comes from the owner, using [ERC-1271](/eip-1271/) so smart-contract wallets can sign too.

The function returns `true` or `false` and must not change state. How each individual identity is proven (OAuth, OpenID, zk-based DID proofs, etc.) is left to the verifier named in `verifierUri`.

## Sample code

The interface defined by the standard:

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

interface IERC7231 {
    event SetIdentitiesRoot(uint256 id, bytes32 identitiesRoot);

    function setIdentitiesRoot(uint256 id, bytes32 identitiesRoot) external;

    function getIdentitiesRoot(uint256 id) external returns (bytes32);

    function verifyIdentitiesBinding(
        uint256 id,
        address nftOwnerAddress,
        string[] memory userIDs,
        bytes32 identitiesRoot,
        bytes calldata signature
    ) external returns (bool);
}
```

A metadata fragment carrying two identities (values are illustrative):

```json
{
  "name": "Profile #42",
  "image": "ipfs://.../42.png",
  "MultiIdentities": [
    { "userID": "did:example:alice", "verifierUri": "https://verifier.example/did", "memo": "main DID" },
    { "userID": "github:alice", "verifierUri": "https://verifier.example/github" }
  ]
}
```

## Things to know

- Status is **Final**. It requires [ERC-165](/eip-165/), [ERC-721](/eip-721/) and [ERC-1271](/eip-1271/).
- Only the hash is on-chain. The privacy of the identity list depends on where the metadata is hosted; anyone who can read the metadata can read the user IDs.
- The on-chain check proves the *owner signed this list*, not that each Web2 account really belongs to them. That second step depends on the off-chain verifier.
- Works with transferable NFTs and with soulbound tokens such as [ERC-5192](/eip-5192/). Because verification checks the signature against the current owner, a binding signed by a previous owner stops verifying after a transfer.


---

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