ERC-7866 Decentralized user profile (Decentralised User Profiles)
Review · Names & metadata · created 2025-01-22
A standard that creates a user profile with a token bound to a wallet address and non-transferable, sets different avatars per app, and allows the same identity to be used consistently across multiple blockchains.
Why it is needed
Currently there is no unified user profile usable across blockchains. Existing identity solutions lack cross-chain compatibility, lack the ability to customize profiles per app, and are not standardized. Ethereum Name Service (ENS) profiles are effectively tied to Ethereum, and services like Gravatar are centralized, so users cannot directly control their data. Also, building a profile with a general NFT (ERC-721) allows the token to be bought and sold, creating the risk that identity could be traded or stolen. This standard aims to bind profiles to non-transferable soulbound tokens and store metadata in decentralized storage such as IPFS or Arweave, providing a user-controlled, cross-chain compatible profile and app-specific custom avatars.
What to implement
event ProfileCreated(address indexed user, string did, string username);: Fires when a user creates a profile. Records the user address, the generated DID, and the username.event AvatarUpdated(address indexed user, string avatarURI, string visibility);: Fires when the default avatar or visibility setting changes.event DappAvatarUpdated( address indexed user, address indexed dApp, string avatarURI, string visibility );: Fires when an avatar for a specific dApp is set or changed.function createProfile(string calldata username) external;: Creates a new profile at the caller's address. Registers the username and emits a ProfileCreated event.function setDefaultAvatar(string calldata avatarURI, string calldata visibility) external;: Specifies the default avatar's URI and visibility setting (public or private).function setDappAvatar( address dApp, string calldata avatarURI, string calldata visibility ) external;: Specifies a dedicated avatar and visibility setting for a specific dApp address.function getDefaultAvatar(address user) external view returns (string memory, string memory);: Returns the given user's default avatar URI and visibility setting.function getDappAvatar(address user, address dApp) external view returns (string memory, string memory);: Returns the avatar URI and visibility setting the given user set for a specific dApp.
In depth
Profile identifier and DID format
Each profile has a human-readable identifier in the format <username>@<network_slug>.soul. username is a custom string unique within the chain, network_slug is a chain abbreviation such as eth, polygon, or xion, and the .soul suffix indicates it is a soulbound token (e.g., john@eth.soul). At the same time, each profile is bound to a decentralized identifier (DID) in the format did:<chain>:<address> (e.g., did:ethereum:0x123...). The reference implementation's generateDID function creates a string prefixed with did:ethereum: from the user's address and records it in the ProfileCreated event. Per the security considerations, a DID cannot be changed once created, preventing identity forgery or unauthorized modification.
Metadata schema and off-chain storage
Profile metadata is defined by a JSON schema, and all 7 fields are required: username, avatar (IPFS URI), bio, website, socials (twitter and github required), default_avatar_visibility, and dapp_avatars. dapp_avatars uses 40-character hexadecimal addresses starting with 0x as keys, and each entry must include avatar (IPFS URI) and visibility (public or private). The metadata body is stored off-chain in storage such as IPFS or Arweave to reduce gas costs, with only the URI and pointer stored on-chain. Pure on-chain storage was rejected due to gas costs and the limitations of handling large data such as high-resolution avatars.
Visibility logic
Both the default avatar and each dApp-specific avatar can be set to public or private. If public, any external caller can retrieve the avatar; if private, only the user themselves can retrieve it, and other callers receive an encoded response with an error message. Since the default avatar applies as a fallback when there is no dApp-specific setting, existing apps that have not implemented this standard's new features still work without issue.
Contract interface ISoulProfile
The interface defines a Metadata struct (username, avatar, bio, website, a socials mapping, defaultAvatarVisibility, and a dappAvatars mapping) and a DappAvatar struct (avatarURI, visibility). There are 3 state-changing functions: createProfile, setDefaultAvatar, and setDappAvatar, and 2 read functions: getDefaultAvatar and getDappAvatar. In the reference implementation SoulProfile, createProfile rejects empty usernames and duplicate profile creation and sets the default visibility to public, while setDappAvatar rejects the zero address. This standard requires ERC-165 interface detection (requires: 165).
Rationale for SBT and registry/resolver design
The reason profiles are implemented as soulbound tokens (SBTs) is that non-transferability enforces identity ownership. Since profiles cannot be sold or stolen, they are suited to reputation-based systems. A transferable ERC-721-based design was rejected as unsuitable for identity management. The structure that separates identifier management (registry) from metadata resolution (resolver) follows the approach proven in ENS, making extension and upgrades easy. Direct integration with ENS was also considered, but because ENS is effectively tied to Ethereum and has limits on cross-chain functionality, the design took a multi-chain approach inspired by ENS rather than integrating with it directly. The main contracts are designed to be upgradeable via a proxy structure such as TransparentUpgradeableProxy.
Proposal status: Review
This proposal's current status is Review. It is not yet a finalized standard and is still under review, so the specification and interface may change going forward.
Things to watch out for
- Access control: Avatar visibility settings are enforced on both the resolver and registry sides, so unauthorized parties cannot access private avatars. State-changing functions such as setDefaultAvatar and setDappAvatar are protected so that only the profile owner can call them.
- Data privacy: Sensitive metadata is encrypted before being stored on IPFS or Arweave. Visibility flags give users control over who can see which profile elements.
- Input validation: All inputs, such as username, visibility setting, and dApp address, are validated against criteria, and invalid or malicious inputs are rejected. Visibility values are restricted to two options: public and private.
- Reentrancy attack prevention: State-changing functions follow the checks-effects-interactions pattern or use ReentrancyGuard to prevent reentrancy attacks.
- Phishing caution: User-facing apps are recommended to clearly display on-chain interaction information. Users should be warned of possible phishing attacks and should only interact with verified dApps.