Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines ERC-6538, a proposal for a registry that associates account identifiers with stealth meta-addresses.

The explanation below translates, summarizes, and expands on the original proposal.

The original article recorded ERC-6538 as being in the Stagnant stage on January 7, 2024. The code below reflects the historical draft discussed in that article, not necessarily the current specification.

I also cover a range of other EIPs.

Overview

The standard defines a way for entities to manage stealth meta-addresses, which help protect identity and transaction privacy. It builds on the stealth address mechanism defined by ERC-5564.

A stealth meta-address provides the public information a sender needs to derive a separate stealth address for a recipient. This helps prevent observers from trivially associating a payment address with the recipient's usual account. The meta-address itself is not a secret private key, and stealth addresses do not guarantee complete anonymity.

ERC-5564 introduces mechanisms for stealth address generation and announcements. Together with a standardized registry, these mechanisms make it easier for users and applications to interact on Ethereum while improving recipient privacy.

For more on ERC-5564, see the following article.

[ERC-5564] Understanding Stealth Addresses

Motivation

Standardizing stealth addresses allows users to receive assets without publicly revealing the direct relationship between their ordinary account and the receiving address. It is somewhat like receiving a letter without displaying one's usual address to everyone observing its delivery. Each user registers their stealth meta-address in a shared smart contract. Individuals and contracts can then discover the information needed to interact with recipients using different stealth address schemes. The aim is to improve transaction privacy and usability on Ethereum.

Specification

The historical draft discussed here defines a shared registry called ERC5564Registry, where entities can register their stealth meta-addresses. Other parties can look up these values using identifiers such as Ethereum addresses or ENS names. The design aims to establish a single canonical registry deployment per chain rather than requiring each application to deploy its own registry.

javascript
pragma solidity ^0.8.17;

/// @notice Registry to map an address or other identifier to its stealth meta-address.
contract ERC5564Registry {
  /// @dev Emitted when a registrant updates their stealth meta-address.
  event StealthMetaAddressSet(
    bytes indexed registrant, uint256 indexed scheme, bytes stealthMetaAddress
  );

  /// @notice Maps a registrant's identifier to the scheme to the stealth meta-address.
  /// @dev Registrant may be a 160 bit address or other recipient identifier, such as an ENS name.
  /// @dev Scheme is an integer identifier for the stealth address scheme.
  /// @dev MUST return zero if a registrant has not registered keys for the given inputs.
  mapping(bytes => mapping(uint256 => bytes)) public stealthMetaAddressOf;

  /// @notice Sets the caller's stealth meta-address for the given stealth address scheme.
  /// @param scheme An integer identifier for the stealth address scheme.
  /// @param stealthMetaAddress The stealth meta-address to register.
  function registerKeys(uint256 scheme, bytes memory stealthMetaAddress) external {
    stealthMetaAddressOf[abi.encode(msg.sender)][scheme] = stealthMetaAddress;
  }

  /// @notice Sets the `registrant`s stealth meta-address for the given scheme.
  /// @param registrant Recipient identifier, such as an ENS name.
  /// @param scheme An integer identifier for the stealth address scheme.
  /// @param signature A signature from the `registrant` authorizing the registration.
  /// @param stealthMetaAddress The stealth meta-address to register.
  /// @dev MUST support both EOA signatures and EIP-1271 signatures.
  /// @dev MUST revert if the signature is invalid.
  function registerKeysOnBehalf(
    address registrant,
    uint256 scheme,
    bytes memory signature,
    bytes memory stealthMetaAddress
  ) external {
    // TODO If registrant has no code, spit signature into r, s, and v and call `ecrecover`.
    // TODO If registrant has code, call `isValidSignature` on the registrant.
  }

  /// @notice Sets the `registrant`s stealth meta-address for the given scheme.
  /// @param registrant Recipient identifier, such as an ENS name.
  /// @param scheme An integer identifier for the stealth address scheme.
  /// @param signature A signature from the `registrant` authorizing the registration.
  /// @param stealthMetaAddress The stealth meta-address to register.
  /// @dev MUST support both EOA signatures and EIP-1271 signatures.
  /// @dev MUST revert if the signature is invalid.
  function registerKeysOnBehalf(
    bytes memory registrant,
    uint256 scheme,
    bytes memory signature,
    bytes memory stealthMetaAddress
  ) external {
    // TODO How to best generically support any registrant identifier / name
    // system without e.g. hardcoding support just for ENS?
  }
}

StealthMetaAddressSet

javascript
event StealthMetaAddressSet(
  bytes indexed registrant, uint256 indexed scheme, bytes stealthMetaAddress
);

Overview An event intended to be emitted when a registrant updates their stealth meta-address.

Details The event records the registration of a new stealth meta-address or an update to an existing one on the blockchain. This makes registry updates observable and traceable.

Parameters

  • registrant
    • The registrant's identifier, such as an Ethereum address or ENS name.
  • scheme
    • An integer identifying the stealth address scheme.
  • stealthMetaAddress
    • The stealth meta-address registered by the registrant.

stealthMetaAddressOf

javascript
mapping(bytes => mapping(uint256 => bytes)) public stealthMetaAddressOf;

Overview A nested mapping from a registrant's identifier and stealth address scheme to the corresponding stealth meta-address.

Details The mapping records which meta-address a registrant uses for each supported stealth address scheme. If no keys have been registered for a given combination, the getter must return the empty or zero value.

Parameters

  • bytes
    • The byte representation of a registrant's identifier, such as a 160-bit address or another identifier.
  • uint256
    • An integer identifying the stealth address scheme.
  • bytes
    • The byte representation of the stealth meta-address.

registerKeys

javascript
function registerKeys(uint256 scheme, bytes memory stealthMetaAddress) external {
  stealthMetaAddressOf[abi.encode(msg.sender)][scheme] = stealthMetaAddress;
}

Overview

Allows the caller to set their own stealth meta-address for a particular stealth address scheme.

Details

Users call this function to register their own stealth meta-address. Other contracts and users can then retrieve the registered value and derive stealth addresses for privacy-preserving interactions.

Arguments

  • scheme
    • An integer identifying the stealth address scheme.
  • stealthMetaAddress
    • The stealth meta-address to register.

registerKeysOnBehalf

javascript
function registerKeysOnBehalf(
  address registrant,
  uint256 scheme,
  bytes memory signature,
  bytes memory stealthMetaAddress
) external {
  // TODO If registrant has no code, spit signature into r, s, and v and call `ecrecover`.
  // TODO If registrant has code, call `isValidSignature` on the registrant.
}

Overview

Sets a stealth meta-address for another user (registrant) under the specified scheme.

Details

This function is intended to allow someone to register a stealth meta-address on behalf of the registrant. An authorized intermediary can thus submit a registration without requiring the registrant to submit the transaction personally. A complete implementation must support both EOA signatures and ERC-1271 signatures and revert if the signature is invalid. The example above is an unfinished implementation.

For more on ERC-1271, see the following article.

[ERC-1271] Verifying Signatures with Smart Contracts

Arguments

  • registrant
    • The address of the user for whom the registration is being made.
  • scheme
    • An integer identifying the stealth address scheme.
  • signature
    • The registrant's signature authorizing the registration.
  • stealthMetaAddress
    • The stealth meta-address to register.

registerKeysOnBehalf

javascript
function registerKeysOnBehalf(
  bytes memory registrant,
  uint256 scheme,
  bytes memory signature,
  bytes memory stealthMetaAddress
) external {
  // TODO How to best generically support any registrant identifier / name
  // system without e.g. hardcoding support just for ENS?
}

Overview

Sets a stealth meta-address under the specified scheme for another registrant identified by an arbitrary byte sequence.

Details

This overload is intended to enable delegated registration for users identified in different ways. The goal is to support identifiers beyond ENS names. A complete implementation must support EOA and ERC-1271 signatures and revert when authorization is invalid; the historical example leaves identifier resolution and verification unfinished.

Arguments

  • registrant
    • The identifier of the user being registered.
    • The identifier is represented as a byte sequence.
  • scheme
    • An integer identifying the stealth address scheme.
  • signature
    • The registrant's signature authorizing the registration.
  • stealthMetaAddress
    • The stealth meta-address to register.

The contract uses numeric scheme identifiers to distinguish different stealth address schemes. Although the original explanation refers to a one-byte identifier, the displayed interface uses uint256. When a registrant updates a meta-address, the intended behavior is to emit a StealthMetaAddressSet event.

The nested mapping stealthMetaAddressOf tracks the meta-address registered for each scheme. Registrants can register their own values using registerKeys, while registerKeysOnBehalf is intended for delegated registration. Delegated registration requires signature verification and must reject invalid authorization. The illustrative code does not implement all of these requirements.

Finally, the registry is intended to be deployed using a deterministic technique known as Nick's method. The approach builds on deployment techniques used by standards such as ERC-1820 and ERC-2470.

For more on ERC-1820, see the following article.

[ERC-1820] Understanding the Universal Registry and the ERC-820 Fix

ERC-1820 and ERC-2470 are Ethereum standards that use standardized contract deployment techniques.

ERC-1820 - Universal Registry ERC-1820 defines a universal registry for discovering contracts that implement particular interfaces. It provides a shared location where contracts can discover the functionality associated with other accounts. For example, a token supporting ERC-20 and ERC-777 functionality can publish relevant interface information through the registry, enabling other contracts to interact with it appropriately.

ERC-2470 - Singleton Factory ERC-2470 uses a deployment technique known as Nick's method, or keyless deployment. Rather than requiring access to a particular deployer's private key, it uses a predetermined signed deployment transaction to establish a factory at a predictable address. Deployment still requires a transaction and gas. This makes deploying the shared factory consistently across chains possible.

These standards aim to improve interoperability and reliability on Ethereum through standardized discovery and deployment mechanisms. A registry such as the historical ERC5564Registry can similarly benefit from a shared, predictable deployment.

The registry provides a shared on-chain mechanism for managing and discovering stealth meta-addresses, supporting privacy-preserving interactions without storing the recipient's private keys.

Rationale

Registering stealth meta-addresses through a shared smart contract improves privacy-related usability and interoperability on Ethereum.

Interoperability

Other contracts can easily retrieve stealth meta-addresses. This makes it easier for applications such as ENS and Gnosis Safe to support stealth addresses and work together.

Reduced dependencies

Users and applications can retrieve registered stealth meta-addresses without depending on a separate external directory. This enables more direct and convenient privacy-preserving interactions.

A standardized way to participate

Registering a meta-address allows users to signal that they are prepared to receive assets through a supported stealth address scheme.

Shared access

A singleton registry gives multiple projects access to the same set of registered meta-addresses, allowing them to handle discovery consistently.

The registry acts as shared infrastructure that helps applications and services use stealth addresses efficiently while supporting greater recipient privacy on Ethereum.

Compatibility

The proposal is designed to be backward-compatible.

Citation

Matt Solomon (@mds1), Toni Wahrstätter (@nerolation), Ben DiFrancesco (@apbendi), Vitalik Buterin (@vbuterin), "ERC-6538: Stealth Meta-Address Registry [DRAFT]," Ethereum Improvement Proposals, no. 6538, January 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-6538.

Conclusion

This article covered ERC-6538, a proposal for registering and managing the association between account identifiers and stealth meta-addresses.

If you have questions, feel free to reach out via Twitter DM.

Twitter @cardene777

I also publish on the following platforms.

https://chaldene.net/