{"eip":627,"title":"Whisper Specification","description":"This EIP describes the format of Whisper messages within the ÐΞVp2p Wire Protocol. This EIP should substitute the existing specification. More detailed documentation on Whisper could be found here.","authors":["Vlad Gluhovsky \u003cgluk256@gmail.com\u003e"],"status":"Final","type":"Standards Track","category":"Networking","created":"2017-05-05","repo":"EIPs","label":"EIP-627","officialUrl":"https://eips.ethereum.org/EIPS/eip-627","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-627.md","url":"https://eips.huatuo.xyz/eip-627/","tldr":{"en":"Specifies the wire format of Whisper v6, Ethereum's early peer-to-peer messaging protocol: packet codes, encrypted envelopes, proof-of-work and topic bloom filters.","ja":"Ethereum の初期の P2P メッセージングプロトコル Whisper v6 のワイヤーフォーマットを定める。パケットコード、暗号化されたエンベロープ、プルーフ・オブ・ワーク、トピックのブルームフィルターを扱う。","ko":"이더리움 초기의 P2P 메시징 프로토콜인 Whisper v6의 와이어 포맷을 규정한다. 패킷 코드, 암호화된 엔벨로프, 작업 증명, 토픽 블룸 필터를 다룬다.","zh":"规定 Whisper v6 的线路格式。Whisper 是以太坊早期的点对点消息协议，涉及数据包代码、加密信封、工作量证明和主题布隆过滤器。"},"tags":["networking","p2p","messaging","devp2p","whisper"],"explainers":{"en":{"lang":"en","tldr":"Specifies the wire format of Whisper v6, Ethereum's early peer-to-peer messaging protocol: packet codes, encrypted envelopes, proof-of-work and topic bloom filters.","tags":["networking","p2p","messaging","devp2p","whisper"],"related":[8,778],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-627/","markdown":"## What problem does it solve?\n\nIn the original \"Web3\" vision, Ethereum had three pillars: the blockchain for consensus, Swarm for storage, and **Whisper** for messaging. Whisper let dapps send small, encrypted, short-lived messages to each other over the same peer-to-peer network that nodes already used, without a central server.\n\nDifferent clients (go-ethereum, Parity) were building Whisper, so they needed one written spec to stay compatible. EIP-627 is that spec for **Whisper v6**. It runs as a sub-protocol of the devp2p (ÐΞVp2p) wire protocol.\n\n## How it works\n\nEvery packet is an RLP list: `[packet_code, payload]`. Codes 0–127 are reserved for Whisper, and a node **must ignore** unknown codes so that newer versions do not break older peers.\n\n| Code | Packet | Payload |\n| --- | --- | --- |\n| 0 | Status | version, PoW requirement, optional bloom filter (sent first after the handshake) |\n| 1 | Messages | list of envelopes |\n| 2 | PoW Requirement | 64-bit float, the minimum PoW this node accepts |\n| 3 | Bloom Filter | 512-bit filter of topics this node wants |\n| 126 | P2P Request (optional) | one envelope, e.g. a mail-client request |\n| 127 | P2P Message (optional) | one envelope that should not be forwarded further |\n\nAn **envelope** is `[Expiry, TTL, Topic, Data, Nonce]`. `Topic` is 4 bytes that peers can filter on. `Data` is the encrypted message: ECIES with a secp256k1 key, or AES-GCM with a shared key. Inside the plaintext are flags, the payload, random padding (to hide the length), and an optional signature.\n\nTo slow down spam, the sender must search for a `Nonce` that gives the envelope's hash enough leading zero bits. Bigger or longer-lived messages need more work:\n\n```\nPoW = 2**leading_zero_bits(hash) / (size * TTL)\n```\n\nNodes can raise or lower their minimum at runtime with packet 2, and can limit what they receive with packet 3.\n\n## Sample code\n\nHow a 4-byte topic is folded into the 512-bit bloom filter, as given in the spec (pseudocode):\n\n```python\ndef topic_to_bloom(topic: bytes) -\u003e int:      # topic is 4 bytes\n    bloom = 0\n    for i in range(3):\n        n = topic[i]\n        if topic[3] \u0026 (1 \u003c\u003c i):\n            n += 256                           # use the upper half of the 512 bits\n        bloom |= 1 \u003c\u003c n                        # sets at most 3 bits per topic\n    return bloom\n\n# A node's filter is the OR of the blooms of all its topics\nmy_filter = topic_to_bloom(b\"\\xde\\xad\\xbe\\xef\") | topic_to_bloom(b\"\\x01\\x02\\x03\\x04\")\n```\n\n## Things to know\n\n- Whisper never saw wide adoption, and go-ethereum later deprecated and removed it. The Status team's **Waku** protocol grew out of Whisper v6 and is maintained outside the EIP process.\n- The spec says the Data field layout is \"optional\": nodes forward envelopes they cannot decrypt. Only the recipient needs to understand the plaintext format.\n- Codes 126 and 127 exist so that a \"mail server\" can deliver expired messages directly to one peer, which normal forwarding rules would not allow.\n- For the general devp2p forward-compatibility rule, ignoring what you do not understand, see [EIP-8](/eip-8/).\n"},"ja":{"lang":"ja","tldr":"Ethereum の初期の P2P メッセージングプロトコル Whisper v6 のワイヤーフォーマットを定める。パケットコード、暗号化されたエンベロープ、プルーフ・オブ・ワーク、トピックのブルームフィルターを扱う。","tags":["networking","p2p","messaging","devp2p","whisper"],"related":[8,778],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-627/","markdown":"## 何を解決するのか\n\n当初の「Web3」構想では、Ethereum には 3 本の柱がありました。コンセンサスのためのブロックチェーン、ストレージのための Swarm、そしてメッセージングのための **Whisper** です。Whisper は、ノードがすでに使っている同じ P2P ネットワーク上で、中央サーバーなしに、dapp 同士が小さな暗号化された短命のメッセージを送り合えるようにするものでした。\n\n複数のクライアント（go-ethereum、Parity）が Whisper を開発していたため、互換性を保つための文書化された仕様が必要でした。EIP-627 は **Whisper v6** のその仕様です。devp2p（ÐΞVp2p）ワイヤープロトコルのサブプロトコルとして動作します。\n\n## 仕組み\n\nすべてのパケットは RLP リスト `[packet_code, payload]` です。コード 0〜127 は Whisper 用に予約されており、新しいバージョンが古いピアを壊さないよう、ノードは未知のコードを**無視しなければなりません**。\n\n| コード | パケット | ペイロード |\n| --- | --- | --- |\n| 0 | Status | バージョン、PoW 要件、任意のブルームフィルター（ハンドシェイク後に最初に送る） |\n| 1 | Messages | エンベロープのリスト |\n| 2 | PoW Requirement | 64 ビット浮動小数点数。このノードが受け付ける最小の PoW |\n| 3 | Bloom Filter | このノードが欲しいトピックの 512 ビットフィルター |\n| 126 | P2P Request（任意） | エンベロープ 1 つ。例: メールクライアントのリクエスト |\n| 127 | P2P Message（任意） | それ以上転送してはならないエンベロープ 1 つ |\n\n**エンベロープ**は `[Expiry, TTL, Topic, Data, Nonce]` です。`Topic` はピアがフィルタリングに使える 4 バイトです。`Data` は暗号化されたメッセージで、secp256k1 鍵による ECIES、または共有鍵による AES-GCM が使われます。平文の中には、フラグ、ペイロード、（長さを隠すための）ランダムなパディング、任意の署名が入ります。\n\nスパムを抑えるため、送信者はエンベロープのハッシュに十分な数の先頭ゼロビットが現れるような `Nonce` を探さなければなりません。大きいメッセージや寿命の長いメッセージほど、多くの作業が必要です。\n\n```\nPoW = 2**leading_zero_bits(hash) / (size * TTL)\n```\n\nノードはパケット 2 で実行時に最小値を上げ下げでき、パケット 3 で受信するものを制限できます。\n\n## サンプルコード\n\n仕様に示されている、4 バイトのトピックを 512 ビットのブルームフィルターに折りたたむ方法（擬似コード）:\n\n```python\ndef topic_to_bloom(topic: bytes) -\u003e int:      # topic is 4 bytes\n    bloom = 0\n    for i in range(3):\n        n = topic[i]\n        if topic[3] \u0026 (1 \u003c\u003c i):\n            n += 256                           # use the upper half of the 512 bits\n        bloom |= 1 \u003c\u003c n                        # sets at most 3 bits per topic\n    return bloom\n\n# A node's filter is the OR of the blooms of all its topics\nmy_filter = topic_to_bloom(b\"\\xde\\xad\\xbe\\xef\") | topic_to_bloom(b\"\\x01\\x02\\x03\\x04\")\n```\n\n## 知っておくべきこと\n\n- Whisper は広く採用されることはなく、go-ethereum は後にこれを非推奨とし、削除しました。Status チームの **Waku** プロトコルは Whisper v6 から発展したもので、EIP プロセスの外で保守されています。\n- 仕様では、Data フィールドのレイアウトは「任意」とされています。ノードは復号できないエンベロープも転送します。平文の形式を理解する必要があるのは受信者だけです。\n- コード 126 と 127 は、「メールサーバー」が期限切れのメッセージを 1 つのピアに直接届けられるようにするためのもので、通常の転送ルールでは許されません。\n- 理解できないものは無視するという、devp2p 全般の前方互換性ルールについては [EIP-8](/eip-8/) を参照してください。\n"},"ko":{"lang":"ko","tldr":"이더리움 초기의 P2P 메시징 프로토콜인 Whisper v6의 와이어 포맷을 규정한다. 패킷 코드, 암호화된 엔벨로프, 작업 증명, 토픽 블룸 필터를 다룬다.","tags":["networking","p2p","messaging","devp2p","whisper"],"related":[8,778],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-627/","markdown":"## 어떤 문제를 해결하나요?\n\n처음의 \"Web3\" 구상에서 이더리움에는 세 개의 기둥이 있었습니다. 합의를 위한 블록체인, 저장을 위한 Swarm, 그리고 메시징을 위한 **Whisper**입니다. Whisper는 노드들이 이미 쓰고 있는 같은 P2P 네트워크를 통해, 중앙 서버 없이 dapp끼리 작고 암호화된 단명 메시지를 주고받게 해 주는 것이었습니다.\n\n여러 클라이언트(go-ethereum, Parity)가 Whisper를 만들고 있었기 때문에, 호환성을 유지하려면 문서화된 하나의 명세가 필요했습니다. EIP-627이 바로 **Whisper v6**의 그 명세입니다. devp2p(ÐΞVp2p) 와이어 프로토콜의 하위 프로토콜로 동작합니다.\n\n## 어떻게 동작하나요?\n\n모든 패킷은 RLP 리스트 `[packet_code, payload]`입니다. 코드 0–127은 Whisper용으로 예약되어 있으며, 새 버전이 오래된 피어를 깨뜨리지 않도록 노드는 알 수 없는 코드를 **무시해야 합니다**.\n\n| 코드 | 패킷 | 페이로드 |\n| --- | --- | --- |\n| 0 | Status | 버전, PoW 요구 사항, 선택적 블룸 필터(핸드셰이크 직후 가장 먼저 전송) |\n| 1 | Messages | 엔벨로프 목록 |\n| 2 | PoW Requirement | 64비트 부동소수점 수. 이 노드가 받아들이는 최소 PoW |\n| 3 | Bloom Filter | 이 노드가 원하는 토픽의 512비트 필터 |\n| 126 | P2P Request(선택) | 엔벨로프 하나. 예: 메일 클라이언트 요청 |\n| 127 | P2P Message(선택) | 더 이상 전달하면 안 되는 엔벨로프 하나 |\n\n**엔벨로프**는 `[Expiry, TTL, Topic, Data, Nonce]`입니다. `Topic`은 피어가 필터링에 쓸 수 있는 4바이트입니다. `Data`는 암호화된 메시지로, secp256k1 키를 쓰는 ECIES 또는 공유 키를 쓰는 AES-GCM이 사용됩니다. 평문 안에는 플래그, 페이로드, (길이를 숨기기 위한) 랜덤 패딩, 선택적 서명이 들어갑니다.\n\n스팸을 늦추기 위해 발신자는 엔벨로프 해시에 충분한 수의 선행 0 비트가 나오도록 하는 `Nonce`를 찾아야 합니다. 더 크거나 더 오래 유지되는 메시지일수록 더 많은 작업이 필요합니다.\n\n```\nPoW = 2**leading_zero_bits(hash) / (size * TTL)\n```\n\n노드는 패킷 2로 실행 중에 최소값을 올리거나 내릴 수 있고, 패킷 3으로 수신할 내용을 제한할 수 있습니다.\n\n## 샘플 코드\n\n명세에 나온 대로 4바이트 토픽을 512비트 블룸 필터로 접어 넣는 방법(의사 코드):\n\n```python\ndef topic_to_bloom(topic: bytes) -\u003e int:      # topic is 4 bytes\n    bloom = 0\n    for i in range(3):\n        n = topic[i]\n        if topic[3] \u0026 (1 \u003c\u003c i):\n            n += 256                           # use the upper half of the 512 bits\n        bloom |= 1 \u003c\u003c n                        # sets at most 3 bits per topic\n    return bloom\n\n# A node's filter is the OR of the blooms of all its topics\nmy_filter = topic_to_bloom(b\"\\xde\\xad\\xbe\\xef\") | topic_to_bloom(b\"\\x01\\x02\\x03\\x04\")\n```\n\n## 알아둘 점\n\n- Whisper는 널리 채택된 적이 없으며, go-ethereum은 이후 이를 지원 중단하고 제거했습니다. Status 팀의 **Waku** 프로토콜은 Whisper v6에서 발전한 것으로, EIP 프로세스 밖에서 유지됩니다.\n- 명세는 Data 필드의 레이아웃이 \"선택적\"이라고 말합니다. 노드는 복호화할 수 없는 엔벨로프도 전달합니다. 평문 형식을 이해해야 하는 것은 수신자뿐입니다.\n- 코드 126과 127은 \"메일 서버\"가 만료된 메시지를 한 피어에게 직접 전달할 수 있도록 존재하며, 일반적인 전달 규칙으로는 허용되지 않는 동작입니다.\n- 이해하지 못하는 것은 무시한다는 devp2p의 일반적인 전방 호환성 규칙은 [EIP-8](/eip-8/)을 참고하세요.\n"},"zh":{"lang":"zh","tldr":"规定 Whisper v6 的线路格式。Whisper 是以太坊早期的点对点消息协议，涉及数据包代码、加密信封、工作量证明和主题布隆过滤器。","tags":["networking","p2p","messaging","devp2p","whisper"],"related":[8,778],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-627/","markdown":"## 它解决什么问题？\n\n在最初的“Web3”构想中，以太坊有三大支柱：用于共识的区块链、用于存储的 Swarm，以及用于消息传递的 **Whisper**。Whisper 让 dapp 之间可以通过节点已在使用的同一个点对点网络，发送小型的、加密的、短期有效的消息，而无需中心化服务器。\n\n不同的客户端（go-ethereum、Parity）都在开发 Whisper，因此需要一份书面规范来保持兼容。EIP-627 就是 **Whisper v6** 的这份规范。它作为 devp2p（ÐΞVp2p）线路协议的子协议运行。\n\n## 它如何运作\n\n每个数据包都是一个 RLP 列表：`[packet_code, payload]`。代码 0–127 为 Whisper 保留，节点**必须忽略**未知的代码，以免新版本破坏旧的对等节点。\n\n| 代码 | 数据包 | 载荷 |\n| --- | --- | --- |\n| 0 | Status | 版本、PoW 要求、可选的布隆过滤器（握手后最先发送） |\n| 1 | Messages | 信封列表 |\n| 2 | PoW Requirement | 64 位浮点数，即该节点接受的最低 PoW |\n| 3 | Bloom Filter | 该节点所需主题的 512 位过滤器 |\n| 126 | P2P Request（可选） | 一个信封，例如邮件客户端请求 |\n| 127 | P2P Message（可选） | 一个不应再被继续转发的信封 |\n\n**信封**为 `[Expiry, TTL, Topic, Data, Nonce]`。`Topic` 是对等节点可以用来过滤的 4 个字节。`Data` 是加密后的消息：使用 secp256k1 密钥的 ECIES，或使用共享密钥的 AES-GCM。明文内部包含标志位、载荷、随机填充（用于隐藏长度）以及可选的签名。\n\n为了抑制垃圾信息，发送者必须搜索一个 `Nonce`，使信封的哈希具有足够多的前导零比特。消息越大或存活时间越长，需要的工作量越多：\n\n```\nPoW = 2**leading_zero_bits(hash) / (size * TTL)\n```\n\n节点可以通过数据包 2 在运行时提高或降低自己的最低要求，并可以通过数据包 3 限制自己接收的内容。\n\n## 示例代码\n\n按规范给出的方法，将 4 字节主题折叠进 512 位布隆过滤器（伪代码）：\n\n```python\ndef topic_to_bloom(topic: bytes) -\u003e int:      # topic is 4 bytes\n    bloom = 0\n    for i in range(3):\n        n = topic[i]\n        if topic[3] \u0026 (1 \u003c\u003c i):\n            n += 256                           # use the upper half of the 512 bits\n        bloom |= 1 \u003c\u003c n                        # sets at most 3 bits per topic\n    return bloom\n\n# A node's filter is the OR of the blooms of all its topics\nmy_filter = topic_to_bloom(b\"\\xde\\xad\\xbe\\xef\") | topic_to_bloom(b\"\\x01\\x02\\x03\\x04\")\n```\n\n## 需要注意\n\n- Whisper 从未得到广泛采用，go-ethereum 后来弃用并移除了它。Status 团队的 **Waku** 协议由 Whisper v6 发展而来，在 EIP 流程之外维护。\n- 规范说 Data 字段的布局是“可选的”：节点会转发自己无法解密的信封。只有接收者需要理解明文格式。\n- 代码 126 和 127 的存在，是为了让“邮件服务器”可以把已过期的消息直接投递给某个对等节点，而正常的转发规则不允许这样做。\n- 关于 devp2p 通用的前向兼容规则，即忽略自己不理解的内容，请参阅 [EIP-8](/eip-8/)。\n"}}}
