{"eip":5437,"title":"Security Contact Interface","description":"An interface for security notice using asymmetric encryption","authors":["Zainan Zhou (@xinbenlv)"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2022-08-09","requires":[165],"discussionsTo":"https://ethereum-magicians.org/t/erc-interface-for-security-contract/10303","repo":"ERCs","label":"ERC-5437","officialUrl":"https://eips.ethereum.org/EIPS/eip-5437","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5437.md","url":"https://eips.huatuo.xyz/eip-5437/","tldr":{"en":"A contract interface that publishes an official, encrypted security contact (a GPG public key plus email) so researchers know how to report vulnerabilities privately.","ja":"公式の暗号化されたセキュリティ連絡先（GPG 公開鍵とメールアドレス）を公開するコントラクトインターフェース。研究者が脆弱性を非公開で報告する方法を知ることができる。","ko":"공식적인 암호화 보안 연락처(GPG 공개 키와 이메일)를 게시하는 컨트랙트 인터페이스. 연구자가 취약점을 비공개로 신고하는 방법을 알 수 있다.","zh":"一种合约接口，用于发布官方的加密安全联系方式（GPG 公钥加电子邮件），让研究人员知道如何私下报告漏洞。"},"tags":["security","disclosure","interface","contact"],"explainers":{"en":{"lang":"en","tldr":"A contract interface that publishes an official, encrypted security contact (a GPG public key plus email) so researchers know how to report vulnerabilities privately.","tags":["security","disclosure","interface","contact"],"related":[165,5269],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-5437/","markdown":"## What problem does it solve?\n\nWhen a researcher finds a bug in a deployed contract, there is often no reliable way to tell who maintains it or how to reach them privately. The best existing convention is a NatSpec comment in the source, e.g. `/// @custom:security-contact someone@example.com`, which only helps if the source is verified and does not provide encryption.\n\nERC-5437 puts the contact on-chain: the contract itself returns a public key and a delivery address, so a report can be encrypted to the maintainers.\n\n## How it works\n\nRequired:\n\n- `getSecurityContact(type, data)` returns `(type, publicKey, extraData)`.\n- The contract must implement [ERC-165](/eip-165/).\n\n`type` is one byte. Valid values are `0x10`–`0x7f`; others are reserved. The spec defines one:\n\n| Type | Encryption scheme | `extraData` |\n| --- | --- | --- |\n| `0x10` | GnuPG RSA/3072 | Email address(es) in RFC 2822 format |\n\nOptional:\n\n- `setSecurityContact(type, publicKey, extraData)` plus a `SecurityContactChanged` event, for key rotation.\n- `securityNotify(type, data)`: a `payable` on-chain notification, emitting `OnSecurityNotification`. Being payable lets a project require a stake from reporters.\n- `bountyPolicy(id)`: returns a URI to a bug bounty policy; `id = 0` is the overview.\n\nFuture EIPs can add new `type` values for other schemes or channels.\n\n## Sample code\n\nFetching a contract's security contact (ethers v6):\n\n```ts\nimport { Contract, JsonRpcProvider, toUtf8String } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst target = new Contract(process.env.CONTRACT!, [\n  \"function getSecurityContact(uint8 t, bytes data) view returns (uint8, bytes, bytes)\",\n], provider);\n\nconst [type, publicKey, extraData] = await target.getSecurityContact(0x10, \"0x\");\nif (Number(type) === 0x10) {\n  console.log(\"GPG key:\\n\" + toUtf8String(publicKey));   // ASCII-armored key\n  console.log(\"send encrypted report to:\", toUtf8String(extraData));\n}\n```\n\nThen encrypt the report with that key (e.g. `gpg --encrypt --armor -r \u003ckey\u003e`) and email it.\n\n## Things to know\n\n- Status is **Stagnant**, and the interface still contains `TODO` notes (the optional setter and bounty function may be removed). Its signatures are written as `public` in an interface and use `type` as a parameter name, so they will not compile as-is.\n- The spec recommends keeping the `@custom:security-contact` comment as well.\n- Operators must keep the contact current, rotate keys on a sensible schedule and actually monitor the channel.\n- Do not send vulnerability details through `securityNotify` in clear text: on-chain data is public.\n"},"ja":{"lang":"ja","tldr":"公式の暗号化されたセキュリティ連絡先（GPG 公開鍵とメールアドレス）を公開するコントラクトインターフェース。研究者が脆弱性を非公開で報告する方法を知ることができる。","tags":["security","disclosure","interface","contact"],"related":[165,5269],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-5437/","markdown":"## 何を解決するのか\n\n研究者がデプロイ済みコントラクトのバグを見つけたとき、誰がそれを保守していて、どうすれば非公開で連絡できるのかを知る確実な方法がないことがよくあります。現在の最善の慣習は、ソース内の NatSpec コメント（例: `/// @custom:security-contact someone@example.com`）ですが、ソースが検証済みでなければ役に立たず、暗号化も提供しません。\n\nERC-5437 は連絡先をオンチェーンに置きます。コントラクト自身が公開鍵と送付先アドレスを返すため、報告を保守者宛てに暗号化できます。\n\n## 仕組み\n\n必須:\n\n- `getSecurityContact(type, data)` が `(type, publicKey, extraData)` を返す。\n- コントラクトは [ERC-165](/eip-165/) を実装しなければならない。\n\n`type` は 1 バイトです。有効な値は `0x10`〜`0x7f` で、それ以外は予約されています。仕様が定義しているのは 1 つです。\n\n| タイプ | 暗号化方式 | `extraData` |\n| --- | --- | --- |\n| `0x10` | GnuPG RSA/3072 | RFC 2822 形式のメールアドレス |\n\n任意:\n\n- 鍵のローテーションのための、`setSecurityContact(type, publicKey, extraData)` と `SecurityContactChanged` イベント。\n- `securityNotify(type, data)`: `payable` なオンチェーン通知で、`OnSecurityNotification` を発行する。payable であるため、プロジェクトは報告者にステークを求められる。\n- `bountyPolicy(id)`: バグバウンティポリシーへの URI を返す。`id = 0` は概要。\n\n将来の EIP が、他の方式やチャネル向けに新しい `type` の値を追加できます。\n\n## サンプルコード\n\nコントラクトのセキュリティ連絡先を取得する（ethers v6）:\n\n```ts\nimport { Contract, JsonRpcProvider, toUtf8String } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst target = new Contract(process.env.CONTRACT!, [\n  \"function getSecurityContact(uint8 t, bytes data) view returns (uint8, bytes, bytes)\",\n], provider);\n\nconst [type, publicKey, extraData] = await target.getSecurityContact(0x10, \"0x\");\nif (Number(type) === 0x10) {\n  console.log(\"GPG key:\\n\" + toUtf8String(publicKey));   // ASCII-armored key\n  console.log(\"send encrypted report to:\", toUtf8String(extraData));\n}\n```\n\nその鍵で報告を暗号化し（例: `gpg --encrypt --armor -r \u003ckey\u003e`）、メールで送ります。\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** で、インターフェースにはまだ `TODO` の注記が残っています（任意のセッターとバウンティ関数は削除される可能性があります）。シグネチャは、インターフェース内で `public` と書かれ、`type` をパラメーター名に使っているため、そのままではコンパイルできません。\n- 仕様は、`@custom:security-contact` コメントも併せて残すことを推奨しています。\n- 運用者は連絡先を最新に保ち、妥当なスケジュールで鍵をローテーションし、チャネルを実際に監視しなければなりません。\n- 脆弱性の詳細を `securityNotify` で平文のまま送らないでください。オンチェーンのデータは公開されています。\n"},"ko":{"lang":"ko","tldr":"공식적인 암호화 보안 연락처(GPG 공개 키와 이메일)를 게시하는 컨트랙트 인터페이스. 연구자가 취약점을 비공개로 신고하는 방법을 알 수 있다.","tags":["security","disclosure","interface","contact"],"related":[165,5269],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-5437/","markdown":"## 어떤 문제를 해결하나요?\n\n연구자가 배포된 컨트랙트에서 버그를 발견해도, 누가 이를 유지보수하는지, 어떻게 비공개로 연락해야 하는지 알 믿을 만한 방법이 없는 경우가 많습니다. 현재 가장 좋은 관례는 소스의 NatSpec 주석(예: `/// @custom:security-contact someone@example.com`)인데, 이는 소스가 검증되어 있어야만 도움이 되고 암호화는 제공하지 않습니다.\n\nERC-5437은 연락처를 온체인에 둡니다. 컨트랙트 자체가 공개 키와 전달 주소를 반환하므로 신고를 유지보수자에게 암호화해서 보낼 수 있습니다.\n\n## 어떻게 동작하나요?\n\n필수:\n\n- `getSecurityContact(type, data)`가 `(type, publicKey, extraData)`를 반환합니다.\n- 컨트랙트는 [ERC-165](/eip-165/)를 구현해야 합니다.\n\n`type`은 1바이트입니다. 유효한 값은 `0x10`–`0x7f`이고 나머지는 예약되어 있습니다. 명세는 하나를 정의합니다.\n\n| 타입 | 암호화 방식 | `extraData` |\n| --- | --- | --- |\n| `0x10` | GnuPG RSA/3072 | RFC 2822 형식의 이메일 주소 |\n\n선택:\n\n- 키 교체를 위한 `setSecurityContact(type, publicKey, extraData)`와 `SecurityContactChanged` 이벤트.\n- `securityNotify(type, data)`: `payable`인 온체인 알림으로, `OnSecurityNotification`을 발생시킵니다. payable이므로 프로젝트는 신고자에게 스테이크를 요구할 수 있습니다.\n- `bountyPolicy(id)`: 버그 바운티 정책의 URI를 반환합니다. `id = 0`은 개요입니다.\n\n향후 EIP가 다른 방식이나 채널을 위한 새로운 `type` 값을 추가할 수 있습니다.\n\n## 샘플 코드\n\n컨트랙트의 보안 연락처 가져오기(ethers v6):\n\n```ts\nimport { Contract, JsonRpcProvider, toUtf8String } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst target = new Contract(process.env.CONTRACT!, [\n  \"function getSecurityContact(uint8 t, bytes data) view returns (uint8, bytes, bytes)\",\n], provider);\n\nconst [type, publicKey, extraData] = await target.getSecurityContact(0x10, \"0x\");\nif (Number(type) === 0x10) {\n  console.log(\"GPG key:\\n\" + toUtf8String(publicKey));   // ASCII-armored key\n  console.log(\"send encrypted report to:\", toUtf8String(extraData));\n}\n```\n\n그런 다음 그 키로 신고 내용을 암호화(예: `gpg --encrypt --armor -r \u003ckey\u003e`)하고 이메일로 보냅니다.\n\n## 알아둘 점\n\n- 상태는 **Stagnant**이며, 인터페이스에 아직 `TODO` 메모가 남아 있습니다(선택적 setter와 바운티 함수는 제거될 수 있음). 시그니처가 interface 안에서 `public`으로 쓰여 있고 `type`을 파라미터 이름으로 사용하므로 그대로는 컴파일되지 않습니다.\n- 명세는 `@custom:security-contact` 주석도 함께 유지하길 권장합니다.\n- 운영자는 연락처를 최신으로 유지하고, 합리적인 주기로 키를 교체하며, 채널을 실제로 모니터링해야 합니다.\n- 취약점 세부 정보를 `securityNotify`로 평문 전송하지 마세요. 온체인 데이터는 공개되어 있습니다.\n"},"zh":{"lang":"zh","tldr":"一种合约接口，用于发布官方的加密安全联系方式（GPG 公钥加电子邮件），让研究人员知道如何私下报告漏洞。","tags":["security","disclosure","interface","contact"],"related":[165,5269],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-5437/","markdown":"## 它解决什么问题？\n\n当研究人员在已部署的合约中发现漏洞时，往往没有可靠的方法得知谁在维护它，或如何私下联系他们。目前最好的惯例是源码中的 NatSpec 注释，例如 `/// @custom:security-contact someone@example.com`，但这只有在源码已验证时才有用，而且不提供加密。\n\nERC-5437 把联系方式放到链上：合约本身返回公钥和投递地址，因此报告可以加密发送给维护者。\n\n## 它如何运作\n\n必需：\n\n- `getSecurityContact(type, data)` 返回 `(type, publicKey, extraData)`。\n- 合约必须实现 [ERC-165](/eip-165/)。\n\n`type` 为一个字节。有效值为 `0x10`–`0x7f`，其余保留。规范定义了其中一个：\n\n| 类型 | 加密方案 | `extraData` |\n| --- | --- | --- |\n| `0x10` | GnuPG RSA/3072 | RFC 2822 格式的电子邮件地址 |\n\n可选：\n\n- `setSecurityContact(type, publicKey, extraData)` 以及 `SecurityContactChanged` 事件，用于密钥轮换。\n- `securityNotify(type, data)`：一个 `payable` 的链上通知，会触发 `OnSecurityNotification`。由于是 payable，项目可以要求报告者质押。\n- `bountyPolicy(id)`：返回漏洞赏金政策的 URI；`id = 0` 为概览。\n\n未来的 EIP 可以为其他方案或渠道添加新的 `type` 值。\n\n## 示例代码\n\n获取合约的安全联系方式（ethers v6）：\n\n```ts\nimport { Contract, JsonRpcProvider, toUtf8String } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst target = new Contract(process.env.CONTRACT!, [\n  \"function getSecurityContact(uint8 t, bytes data) view returns (uint8, bytes, bytes)\",\n], provider);\n\nconst [type, publicKey, extraData] = await target.getSecurityContact(0x10, \"0x\");\nif (Number(type) === 0x10) {\n  console.log(\"GPG key:\\n\" + toUtf8String(publicKey));   // ASCII-armored key\n  console.log(\"send encrypted report to:\", toUtf8String(extraData));\n}\n```\n\n然后用该密钥加密报告（例如 `gpg --encrypt --armor -r \u003ckey\u003e`）并通过电子邮件发送。\n\n## 需要注意\n\n- 状态为 **Stagnant**，接口中仍有 `TODO` 备注（可选的 setter 和赏金函数可能被删除）。其签名在 interface 中写成了 `public`，并且使用 `type` 作为参数名，因此无法原样编译。\n- 规范建议同时保留 `@custom:security-contact` 注释。\n- 运营方必须保持联系方式最新，按合理的周期轮换密钥，并真正监控该渠道。\n- 不要通过 `securityNotify` 以明文发送漏洞细节：链上数据是公开的。\n"}}}
