{"eip":6538,"title":"Stealth Meta-Address Registry","description":"A canonical contract for entities to register stealth meta-addresses directly or through a third party using signatures.","authors":["Matt Solomon (@mds1)","Toni Wahrstätter (@nerolation)","Ben DiFrancesco (@apbendi)","Vitalik Buterin (@vbuterin)","Gary Ghayrat (@garyghayrat)"],"status":"Final","type":"Standards Track","category":"ERC","created":"2023-01-24","requires":[712,1271,5564],"discussionsTo":"https://ethereum-magicians.org/t/stealth-meta-address-registry/12888","repo":"ERCs","label":"ERC-6538","officialUrl":"https://eips.ethereum.org/EIPS/eip-6538","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6538.md","url":"https://eips.huatuo.xyz/eip-6538/","tldr":{"en":"A singleton registry contract where anyone can publish their stealth meta-address, so senders can look it up and pay them privately using ERC-5564 stealth addresses.","ja":"誰でもステルスメタアドレスを公開できるシングルトンのレジストリコントラクト。送信者はそれを検索し、ERC-5564 のステルスアドレスを使ってプライベートに支払える。","ko":"누구나 스텔스 메타 주소를 게시할 수 있는 싱글톤 레지스트리 컨트랙트. 송신자는 이를 조회해 ERC-5564 스텔스 주소로 비공개 결제를 할 수 있다.","zh":"一个单例注册表合约，任何人都可以发布自己的隐身元地址，让发送方查询后用 ERC-5564 隐身地址向其私密付款。"},"tags":["privacy","stealth-address","registry","signatures"],"explainers":{"en":{"lang":"en","tldr":"A singleton registry contract where anyone can publish their stealth meta-address, so senders can look it up and pay them privately using ERC-5564 stealth addresses.","tags":["privacy","stealth-address","registry","signatures"],"related":[5564,712,1271,3770],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-6538/","markdown":"## What problem does it solve?\n\n[ERC-5564](/eip-5564/) stealth addresses let a sender derive a fresh, one-time address for a recipient so observers cannot link payments to the recipient's public identity. To do that, the sender first needs the recipient's **stealth meta-address** (a spending public key plus a viewing public key).\n\nWithout a standard place to publish it, meta-addresses would be scattered across websites, ENS text records and off-chain services, and contracts could not look them up at all. ERC-6538 defines one canonical on-chain registry for them.\n\n## How it works\n\n`ERC6538Registry` is a **singleton**: one instance per chain. It stores:\n\n```text\nstealthMetaAddressOf[registrant][schemeId] -\u003e bytes\n```\n\n- `schemeId` selects the stealth address scheme. `1` is secp256k1 with view tags, as defined in ERC-5564.\n- The stored bytes are the spending and viewing public keys concatenated. The chain prefix used in the text form `st:\u003cshortName\u003e:0x...` is implied by which chain the registry is on.\n\nWays to register:\n\n- `registerKeys(schemeId, stealthMetaAddress)`: register for yourself (`msg.sender`).\n- `registerKeysOnBehalf(registrant, schemeId, signature, stealthMetaAddress)`: a third party (for example a relayer paying gas) submits it with the registrant's **[EIP-712](/eip-712/)** signature over `Erc6538RegistryEntry(uint256 schemeId,bytes stealthMetaAddress,uint256 nonce)`. Smart accounts are supported through **[ERC-1271](/eip-1271/)** signature checks.\n- `incrementNonce()`: invalidate any signatures you handed out but that have not been used yet.\n\nEvery change emits `StealthMetaAddressSet(registrant, schemeId, stealthMetaAddress)`.\n\nThe spec specifies a deterministic deployment through the standard `CREATE2` deployer so the registry has the same address on every chain; that address is given in the ERC.\n\n## Sample code\n\nLooking up a recipient and registering your own meta-address (ethers v6):\n\n```ts\nimport { Contract } from \"ethers\";\n\nconst abi = [\n  \"function stealthMetaAddressOf(address registrant, uint256 schemeId) view returns (bytes)\",\n  \"function registerKeys(uint256 schemeId, bytes stealthMetaAddress)\",\n  \"event StealthMetaAddressSet(address indexed registrant, uint256 indexed schemeId, bytes stealthMetaAddress)\",\n];\nconst registry = new Contract(REGISTRY_ADDRESS /* from the ERC */, abi, signer);\n\n// Sender: fetch recipient's meta-address for scheme 1 (secp256k1)\nconst meta: string = await registry.stealthMetaAddressOf(recipient, 1n);\nif (meta === \"0x\") throw new Error(\"recipient has not registered\");\n// ...then derive a one-time stealth address with ERC-5564 `generateStealthAddress`\n\n// Recipient: publish your own spending+viewing public keys\nawait registry.registerKeys(1n, spendingPubKey + viewingPubKey.slice(2));\n```\n\n## Things to know\n\n- **Status: Final.**\n- The registry only publishes **public** keys. Funds are received at addresses derived from them, and the recipient scans ERC-5564 announcements with their viewing key to find payments.\n- Registration itself is public: it reveals that an address uses stealth payments, though not which payments it receives.\n- If your spending or viewing key is compromised, update or clear your registration immediately so new senders stop deriving addresses from it.\n- Signed registrations include a per-registrant nonce, so a signature can be used only once; use `incrementNonce` to cancel outstanding ones.\n"},"ja":{"lang":"ja","tldr":"誰でもステルスメタアドレスを公開できるシングルトンのレジストリコントラクト。送信者はそれを検索し、ERC-5564 のステルスアドレスを使ってプライベートに支払える。","tags":["privacy","stealth-address","registry","signatures"],"related":[5564,712,1271,3770],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-6538/","markdown":"## 何を解決するのか\n\n[ERC-5564](/eip-5564/) のステルスアドレスにより、送信者は受信者のために新しい使い捨てのアドレスを導出でき、第三者が支払いを受信者の公開されたアイデンティティに結びつけられなくなります。そのために、送信者はまず受信者の**ステルスメタアドレス**（支払い用公開鍵と閲覧用公開鍵のペア）を必要とします。\n\nこれを公開する標準的な場所がなければ、メタアドレスはウェブサイト、ENS のテキストレコード、オフチェーンのサービスに散らばってしまい、コントラクトはそれを検索することすらできません。ERC-6538 は、そのための唯一の正規オンチェーンレジストリを定義します。\n\n## 仕組み\n\n`ERC6538Registry` は**シングルトン**で、チェーンごとに 1 つのインスタンスです。次を保存します。\n\n```text\nstealthMetaAddressOf[registrant][schemeId] -\u003e bytes\n```\n\n- `schemeId` はステルスアドレスのスキームを選びます。`1` は、ERC-5564 で定義された、ビュータグ付きの secp256k1 です。\n- 保存されるバイト列は、支払い用と閲覧用の公開鍵を連結したものです。テキスト形式 `st:\u003cshortName\u003e:0x...` で使われるチェーンのプレフィックスは、レジストリがどのチェーン上にあるかで暗黙的に決まります。\n\n登録方法:\n\n- `registerKeys(schemeId, stealthMetaAddress)`: 自分自身（`msg.sender`）のために登録します。\n- `registerKeysOnBehalf(registrant, schemeId, signature, stealthMetaAddress)`: 第三者（たとえばガス代を支払うリレイヤー）が、登録者による `Erc6538RegistryEntry(uint256 schemeId,bytes stealthMetaAddress,uint256 nonce)` への **[EIP-712](/eip-712/)** 署名を付けて送信します。スマートアカウントは **[ERC-1271](/eip-1271/)** の署名検証によりサポートされます。\n- `incrementNonce()`: 渡したがまだ使われていない署名をすべて無効化します。\n\nすべての変更で `StealthMetaAddressSet(registrant, schemeId, stealthMetaAddress)` が発行されます。\n\n仕様は、標準の `CREATE2` デプロイヤー経由の決定論的なデプロイを規定しており、レジストリはどのチェーンでも同じアドレスになります。そのアドレスは ERC に記載されています。\n\n## サンプルコード\n\n受信者を検索し、自分のメタアドレスを登録する例（ethers v6）:\n\n```ts\nimport { Contract } from \"ethers\";\n\nconst abi = [\n  \"function stealthMetaAddressOf(address registrant, uint256 schemeId) view returns (bytes)\",\n  \"function registerKeys(uint256 schemeId, bytes stealthMetaAddress)\",\n  \"event StealthMetaAddressSet(address indexed registrant, uint256 indexed schemeId, bytes stealthMetaAddress)\",\n];\nconst registry = new Contract(REGISTRY_ADDRESS /* from the ERC */, abi, signer);\n\n// Sender: fetch recipient's meta-address for scheme 1 (secp256k1)\nconst meta: string = await registry.stealthMetaAddressOf(recipient, 1n);\nif (meta === \"0x\") throw new Error(\"recipient has not registered\");\n// ...then derive a one-time stealth address with ERC-5564 `generateStealthAddress`\n\n// Recipient: publish your own spending+viewing public keys\nawait registry.registerKeys(1n, spendingPubKey + viewingPubKey.slice(2));\n```\n\n## 知っておくべきこと\n\n- **ステータス: Final。**\n- レジストリが公開するのは**公開**鍵だけです。資金はそこから導出されたアドレスで受け取られ、受信者は閲覧用の鍵で ERC-5564 のアナウンスをスキャンして支払いを見つけます。\n- 登録そのものは公開されます。あるアドレスがステルス支払いを使っていることは分かりますが、どの支払いを受け取っているかは分かりません。\n- 支払い用または閲覧用の鍵が漏えいした場合は、すぐに登録を更新または削除して、新しい送信者がその鍵からアドレスを導出しないようにしてください。\n- 署名付きの登録には登録者ごとの nonce が含まれるため、署名は 1 回しか使えません。未使用のものを取り消すには `incrementNonce` を使ってください。\n"},"ko":{"lang":"ko","tldr":"누구나 스텔스 메타 주소를 게시할 수 있는 싱글톤 레지스트리 컨트랙트. 송신자는 이를 조회해 ERC-5564 스텔스 주소로 비공개 결제를 할 수 있다.","tags":["privacy","stealth-address","registry","signatures"],"related":[5564,712,1271,3770],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-6538/","markdown":"## 어떤 문제를 해결하나요?\n\n[ERC-5564](/eip-5564/) 스텔스 주소를 쓰면 송신자가 수신자를 위해 새로운 일회용 주소를 도출할 수 있어, 관찰자가 결제를 수신자의 공개 신원과 연결할 수 없습니다. 이를 위해 송신자는 먼저 수신자의 **스텔스 메타 주소**(지출용 공개키와 조회용 공개키)가 필요합니다.\n\n이를 게시할 표준적인 장소가 없으면 메타 주소는 웹사이트, ENS 텍스트 레코드, 오프체인 서비스에 흩어지게 되고, 컨트랙트는 아예 조회할 수 없습니다. ERC-6538은 이를 위한 하나의 표준 온체인 레지스트리를 정의합니다.\n\n## 어떻게 동작하나요?\n\n`ERC6538Registry`는 **싱글톤**으로, 체인당 하나의 인스턴스입니다. 다음을 저장합니다.\n\n```text\nstealthMetaAddressOf[registrant][schemeId] -\u003e bytes\n```\n\n- `schemeId`는 스텔스 주소 방식을 선택합니다. `1`은 ERC-5564에서 정의한, 뷰 태그가 있는 secp256k1입니다.\n- 저장되는 바이트는 지출용 공개키와 조회용 공개키를 이어 붙인 것입니다. 텍스트 형식 `st:\u003cshortName\u003e:0x...`에 쓰이는 체인 접두사는 레지스트리가 어느 체인에 있는지에 따라 암묵적으로 정해집니다.\n\n등록 방법:\n\n- `registerKeys(schemeId, stealthMetaAddress)`: 자기 자신(`msg.sender`)을 위해 등록합니다.\n- `registerKeysOnBehalf(registrant, schemeId, signature, stealthMetaAddress)`: 제3자(예: 가스비를 내는 릴레이어)가 등록자의 `Erc6538RegistryEntry(uint256 schemeId,bytes stealthMetaAddress,uint256 nonce)`에 대한 **[EIP-712](/eip-712/)** 서명과 함께 제출합니다. 스마트 계정은 **[ERC-1271](/eip-1271/)** 서명 검증으로 지원됩니다.\n- `incrementNonce()`: 건네주었지만 아직 사용되지 않은 서명을 모두 무효화합니다.\n\n모든 변경은 `StealthMetaAddressSet(registrant, schemeId, stealthMetaAddress)`를 발생시킵니다.\n\n사양은 표준 `CREATE2` 배포자를 통한 결정적 배포를 규정하여, 레지스트리가 모든 체인에서 같은 주소를 갖도록 합니다. 그 주소는 ERC에 나와 있습니다.\n\n## 샘플 코드\n\n수신자를 조회하고 자신의 메타 주소를 등록하는 예시입니다(ethers v6).\n\n```ts\nimport { Contract } from \"ethers\";\n\nconst abi = [\n  \"function stealthMetaAddressOf(address registrant, uint256 schemeId) view returns (bytes)\",\n  \"function registerKeys(uint256 schemeId, bytes stealthMetaAddress)\",\n  \"event StealthMetaAddressSet(address indexed registrant, uint256 indexed schemeId, bytes stealthMetaAddress)\",\n];\nconst registry = new Contract(REGISTRY_ADDRESS /* from the ERC */, abi, signer);\n\n// Sender: fetch recipient's meta-address for scheme 1 (secp256k1)\nconst meta: string = await registry.stealthMetaAddressOf(recipient, 1n);\nif (meta === \"0x\") throw new Error(\"recipient has not registered\");\n// ...then derive a one-time stealth address with ERC-5564 `generateStealthAddress`\n\n// Recipient: publish your own spending+viewing public keys\nawait registry.registerKeys(1n, spendingPubKey + viewingPubKey.slice(2));\n```\n\n## 알아둘 점\n\n- **상태: Final.**\n- 레지스트리는 **공개**키만 게시합니다. 자금은 그 키에서 도출된 주소로 받으며, 수신자는 조회용 키로 ERC-5564 공지를 스캔해 결제를 찾습니다.\n- 등록 자체는 공개됩니다. 어떤 주소가 스텔스 결제를 사용한다는 사실은 드러나지만, 어떤 결제를 받는지는 드러나지 않습니다.\n- 지출용 키나 조회용 키가 유출되면 즉시 등록을 갱신하거나 지워서, 새 송신자가 그 키로 주소를 도출하지 않도록 하세요.\n- 서명된 등록에는 등록자별 nonce가 포함되므로 서명은 한 번만 사용할 수 있습니다. 미사용 서명을 취소하려면 `incrementNonce`를 사용하세요.\n"},"zh":{"lang":"zh","tldr":"一个单例注册表合约，任何人都可以发布自己的隐身元地址，让发送方查询后用 ERC-5564 隐身地址向其私密付款。","tags":["privacy","stealth-address","registry","signatures"],"related":[5564,712,1271,3770],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-6538/","markdown":"## 它解决什么问题？\n\n[ERC-5564](/eip-5564/) 隐身地址让发送方可以为接收方派生出一个全新的一次性地址，这样观察者就无法把付款与接收方的公开身份关联起来。为此，发送方首先需要接收方的**隐身元地址**（一个花费公钥加一个查看公钥）。\n\n如果没有一个标准的发布位置，元地址就会散落在各个网站、ENS 文本记录和链下服务中，合约则根本无法查询它们。ERC-6538 为此定义了一个唯一的、规范的链上注册表。\n\n## 它如何运作\n\n`ERC6538Registry` 是一个**单例**：每条链一个实例。它存储：\n\n```text\nstealthMetaAddressOf[registrant][schemeId] -\u003e bytes\n```\n\n- `schemeId` 选择隐身地址方案。`1` 是 ERC-5564 中定义的带 view tag 的 secp256k1。\n- 存储的字节是花费公钥和查看公钥的拼接。文本形式 `st:\u003cshortName\u003e:0x...` 中使用的链前缀，由注册表所在的链隐含决定。\n\n注册方式：\n\n- `registerKeys(schemeId, stealthMetaAddress)`：为自己（`msg.sender`）注册。\n- `registerKeysOnBehalf(registrant, schemeId, signature, stealthMetaAddress)`：第三方（例如支付 gas 的中继方）连同登记者对 `Erc6538RegistryEntry(uint256 schemeId,bytes stealthMetaAddress,uint256 nonce)` 的 **[EIP-712](/eip-712/)** 签名一起提交。智能账户通过 **[ERC-1271](/eip-1271/)** 签名检查获得支持。\n- `incrementNonce()`：使你已经发出但尚未使用的任何签名失效。\n\n每次变更都会触发 `StealthMetaAddressSet(registrant, schemeId, stealthMetaAddress)`。\n\n规范规定通过标准的 `CREATE2` 部署器进行确定性部署，使注册表在每条链上具有相同的地址；该地址在 ERC 中给出。\n\n## 示例代码\n\n查询接收方并注册你自己的元地址（ethers v6）：\n\n```ts\nimport { Contract } from \"ethers\";\n\nconst abi = [\n  \"function stealthMetaAddressOf(address registrant, uint256 schemeId) view returns (bytes)\",\n  \"function registerKeys(uint256 schemeId, bytes stealthMetaAddress)\",\n  \"event StealthMetaAddressSet(address indexed registrant, uint256 indexed schemeId, bytes stealthMetaAddress)\",\n];\nconst registry = new Contract(REGISTRY_ADDRESS /* from the ERC */, abi, signer);\n\n// Sender: fetch recipient's meta-address for scheme 1 (secp256k1)\nconst meta: string = await registry.stealthMetaAddressOf(recipient, 1n);\nif (meta === \"0x\") throw new Error(\"recipient has not registered\");\n// ...then derive a one-time stealth address with ERC-5564 `generateStealthAddress`\n\n// Recipient: publish your own spending+viewing public keys\nawait registry.registerKeys(1n, spendingPubKey + viewingPubKey.slice(2));\n```\n\n## 需要注意\n\n- **状态：Final。**\n- 注册表只发布**公**钥。资金在由它们派生的地址上接收，接收方用其查看密钥扫描 ERC-5564 公告来找到付款。\n- 注册本身是公开的：它会暴露某个地址使用隐身支付，但不会暴露它收到了哪些付款。\n- 如果你的花费密钥或查看密钥泄露，请立即更新或清除你的注册，这样新的发送方就不会再基于它派生地址。\n- 签名注册包含每个登记者独立的 nonce，因此一个签名只能使用一次；使用 `incrementNonce` 可以取消尚未使用的签名。\n"}}}
