{"eip":8,"title":"devp2p Forward Compatibility Requirements for Homestead","description":"This EIP introduces new forward-compatibility requirements for implementations of the devp2p Wire Protocol, the RLPx Discovery Protocol and the RLPx TCP Transport Protocol. Clients which implement EIP-8 behave according to Postel's Law:","authors":["Felix Lange \u003cfelix@ethdev.com\u003e"],"status":"Final","type":"Standards Track","category":"Networking","created":"2015-12-18","repo":"EIPs","label":"EIP-8","officialUrl":"https://eips.ethereum.org/EIPS/eip-8","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8.md","url":"https://eips.huatuo.xyz/eip-8/","tldr":{"en":"Made Ethereum's peer-to-peer protocols tolerant of newer versions and extra fields, so future network upgrades would not split old and new nodes.","ja":"Ethereum の P2P プロトコルが新しいバージョンや追加フィールドを許容するようにし、将来のネットワークアップグレードで新旧ノードが分断されないようにした。","ko":"이더리움의 P2P 프로토콜이 더 새로운 버전과 추가 필드를 허용하도록 만들어, 이후 네트워크 업그레이드에서 새 노드와 옛 노드가 갈라지지 않게 했다.","zh":"让以太坊的点对点协议能够容忍更新的版本和额外字段，使未来的网络升级不会让新旧节点分裂。"},"tags":["networking","devp2p","rlpx","homestead"],"explainers":{"en":{"lang":"en","tldr":"Made Ethereum's peer-to-peer protocols tolerant of newer versions and extra fields, so future network upgrades would not split old and new nodes.","tags":["networking","devp2p","rlpx","homestead"],"related":[1,606],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8/","markdown":"## What problem does it solve?\n\nEthereum nodes talk to each other over devp2p: a discovery protocol to find peers, an encrypted TCP transport (RLPx) and a \"hello\" handshake. In 2015 clients checked version numbers and packet layouts strictly. If a peer sent a higher version or one extra field, the connection was dropped.\n\nThat made every networking change a flag day: either everyone upgrades at once, or the network fragments. EIP-8 removed that trap by requiring clients to follow Postel's Law: \"be conservative in what you do, be liberal in what you accept from others.\" It shipped with the Homestead upgrade ([EIP-606](/eip-606/)).\n\n## How it works\n\nThe rules apply to three protocol layers:\n\n- **devp2p wire protocol (hello packet).** Ignore the peer's version number, send your own highest supported version, and ignore any extra list elements at the end.\n- **RLPx discovery.** Do not validate the ping version, ignore extra list elements and trailing data, and silently drop unknown packet types. The 1280-byte packet size limit stays.\n- **RLPx TCP handshake.** A new handshake encoding is introduced:\n  - a 2-byte plaintext length prefix in front of the encrypted body,\n  - the body encoded as an RLP list,\n  - a version number (`4`) inside both auth and ack packets, replacing an unused flag,\n  - removal of a redundant hash of the ephemeral key.\n\n  Receivers ignore version mismatches, extra list elements and trailing bytes. During the transition, senders pad the auth body with 100 to 300 random bytes so new-format packets are distinguishable from the fixed-size old ones and are harder to fingerprint.\n\nWith these rules, a newer client can bump its version and append fields. An older node simply ignores what it does not understand and keeps talking with the old feature set.\n\n## Sample code\n\nThe new handshake layout, from the spec:\n\n```text\nauth-vsn      = 4\nauth-size     = size of enc-auth-body, big-endian 16-bit integer\nauth-body     = rlp.list(sig, initiator-pubk, initiator-nonce, auth-vsn)\nenc-auth-body = ecies.encrypt(recipient-pubk, auth-body, auth-size)\nauth-packet   = auth-size || enc-auth-body\n\nack-body      = rlp.list(recipient-ephemeral-pubk, recipient-nonce, ack-vsn)\nack-packet    = ack-size || ecies.encrypt(initiator-pubk, ack-body, ack-size)\n```\n\nHow a receiver can accept both the old and new formats (pseudocode):\n\n```go\npacket = read(307, conn)          // old format has a fixed size\nif decrypt(packet) {\n    // legacy handshake\n} else {\n    size := bigEndianUint16(packet[:2])\n    packet += read(size - 307 + 2, conn)\n    if !decrypt(packet) { /* error */ }\n    // EIP-8 handshake\n}\n```\n\nThe length prefix is also passed to ECIES as authenticated data, so it cannot be tampered with.\n\n## Things to know\n\n- This is a networking change, not a consensus change. It does not alter blocks or transactions, but all clients needed it to keep future upgrades smooth.\n- The plaintext size prefix was the most debated part, because it can help someone identify RLPx traffic. The spec argues that randomized padding limits that risk.\n- The EIP is backwards compatible: all valid version-4 packets are still accepted.\n- The spec includes test vectors for hello, ping, pong, findnode, neighbours and handshake packets. Client authors should run them.\n- The same \"ignore what you don't know\" principle is why later protocol versions could be rolled out gradually.\n"},"ja":{"lang":"ja","tldr":"Ethereum の P2P プロトコルが新しいバージョンや追加フィールドを許容するようにし、将来のネットワークアップグレードで新旧ノードが分断されないようにした。","tags":["networking","devp2p","rlpx","homestead"],"related":[1,606],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8/","markdown":"## 何を解決するのか\n\nEthereum のノード同士は devp2p で通信します。ピアを見つけるディスカバリープロトコル、暗号化された TCP トランスポート（RLPx）、そして「hello」ハンドシェイクで構成されています。2015 年当時、クライアントはバージョン番号とパケットのレイアウトを厳密にチェックしていました。ピアがより高いバージョンや 1 つ多いフィールドを送ってくると、接続は切断されました。\n\nそのためネットワークの変更はすべてフラグデー（全員が同時に切り替える日）になり、全員が一斉にアップグレードするか、ネットワークが分断されるかのどちらかでした。EIP-8 は、クライアントにポステルの法則（「送信するものには保守的に、受信するものには寛容に」）に従うことを求めて、この罠を取り除きました。Homestead アップグレード（[EIP-606](/eip-606/)）で導入されました。\n\n## 仕組み\n\nルールは 3 つのプロトコル層に適用されます。\n\n- **devp2p ワイヤプロトコル（hello パケット）。** 相手のバージョン番号は無視し、自分がサポートする最高バージョンを送り、末尾の余分なリスト要素は無視します。\n- **RLPx ディスカバリー。** ping のバージョンは検証せず、余分なリスト要素と末尾のデータは無視し、未知のパケットタイプは黙って破棄します。1280 バイトのパケットサイズ上限は変わりません。\n- **RLPx TCP ハンドシェイク。** 新しいハンドシェイクのエンコーディングが導入されます。\n  - 暗号化された本体の前に、平文の 2 バイト長プレフィックスを置く\n  - 本体を RLP リストとしてエンコードする\n  - 未使用だったフラグに代えて、auth パケットと ack パケットの両方にバージョン番号（`4`）を入れる\n  - 冗長な一時鍵のハッシュを削除する\n\n  受信側はバージョンの不一致、余分なリスト要素、末尾のバイトを無視します。移行期間中、送信側は auth 本体に 100〜300 バイトのランダムなバイト列を付加します。これにより、新形式のパケットを固定サイズの旧形式と区別でき、フィンガープリンティングもされにくくなります。\n\nこれらのルールにより、新しいクライアントはバージョンを上げてフィールドを追加できます。古いノードは理解できない部分を単に無視し、従来の機能セットのまま通信を続けます。\n\n## サンプルコード\n\n仕様にある新しいハンドシェイクのレイアウト:\n\n```text\nauth-vsn      = 4\nauth-size     = size of enc-auth-body, big-endian 16-bit integer\nauth-body     = rlp.list(sig, initiator-pubk, initiator-nonce, auth-vsn)\nenc-auth-body = ecies.encrypt(recipient-pubk, auth-body, auth-size)\nauth-packet   = auth-size || enc-auth-body\n\nack-body      = rlp.list(recipient-ephemeral-pubk, recipient-nonce, ack-vsn)\nack-packet    = ack-size || ecies.encrypt(initiator-pubk, ack-body, ack-size)\n```\n\n受信側が旧形式と新形式の両方を受け付ける方法（擬似コード）:\n\n```go\npacket = read(307, conn)          // old format has a fixed size\nif decrypt(packet) {\n    // legacy handshake\n} else {\n    size := bigEndianUint16(packet[:2])\n    packet += read(size - 307 + 2, conn)\n    if !decrypt(packet) { /* error */ }\n    // EIP-8 handshake\n}\n```\n\n長さプレフィックスは認証付きデータとして ECIES にも渡されるため、改ざんできません。\n\n## 知っておくべきこと\n\n- これはネットワークの変更であり、コンセンサスの変更ではありません。ブロックやトランザクションは変わりませんが、将来のアップグレードを円滑にするため、すべてのクライアントが対応する必要がありました。\n- 平文のサイズプレフィックスは最も議論を呼んだ部分でした。RLPx のトラフィックを識別する手がかりになり得るためです。仕様は、ランダムなパディングによってそのリスクが抑えられると主張しています。\n- この EIP は後方互換性があります。有効なバージョン 4 のパケットはすべて引き続き受け付けられます。\n- 仕様には hello、ping、pong、findnode、neighbours、ハンドシェイクの各パケットのテストベクターが含まれています。クライアント開発者は必ず実行してください。\n- 「知らないものは無視する」という同じ原則があるからこそ、後のプロトコルバージョンを段階的に展開できました。\n"},"ko":{"lang":"ko","tldr":"이더리움의 P2P 프로토콜이 더 새로운 버전과 추가 필드를 허용하도록 만들어, 이후 네트워크 업그레이드에서 새 노드와 옛 노드가 갈라지지 않게 했다.","tags":["networking","devp2p","rlpx","homestead"],"related":[1,606],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8/","markdown":"## 어떤 문제를 해결하나요?\n\n이더리움 노드는 devp2p로 서로 통신합니다. 피어를 찾는 디스커버리 프로토콜, 암호화된 TCP 전송 계층(RLPx), 그리고 \"hello\" 핸드셰이크로 이루어져 있습니다. 2015년에는 클라이언트가 버전 번호와 패킷 레이아웃을 엄격하게 검사했습니다. 피어가 더 높은 버전이나 필드 하나를 더 보내면 연결이 끊겼습니다.\n\n그래서 네트워크 변경은 모두 플래그 데이(모두가 동시에 전환해야 하는 날)가 되었습니다. 모두가 한꺼번에 업그레이드하거나, 아니면 네트워크가 분열되는 것입니다. EIP-8은 클라이언트가 포스텔의 법칙(\"자신이 하는 일에는 보수적으로, 남에게서 받아들이는 것에는 관대하게\")을 따르도록 요구해 이 함정을 없앴습니다. Homestead 업그레이드([EIP-606](/eip-606/))와 함께 적용되었습니다.\n\n## 어떻게 동작하나요?\n\n규칙은 세 개의 프로토콜 계층에 적용됩니다.\n\n- **devp2p 와이어 프로토콜(hello 패킷).** 상대의 버전 번호는 무시하고, 자신이 지원하는 가장 높은 버전을 보내며, 끝에 붙은 추가 리스트 요소는 무시합니다.\n- **RLPx 디스커버리.** ping 버전을 검증하지 않고, 추가 리스트 요소와 뒤따르는 데이터를 무시하며, 알 수 없는 패킷 타입은 조용히 버립니다. 1280바이트 패킷 크기 제한은 그대로입니다.\n- **RLPx TCP 핸드셰이크.** 새로운 핸드셰이크 인코딩이 도입됩니다.\n  - 암호화된 본문 앞에 평문 2바이트 길이 접두사를 둡니다.\n  - 본문을 RLP 리스트로 인코딩합니다.\n  - 사용되지 않던 플래그 대신 auth 패킷과 ack 패킷 모두에 버전 번호(`4`)를 넣습니다.\n  - 임시 키의 중복된 해시를 제거합니다.\n\n  수신 측은 버전 불일치, 추가 리스트 요소, 뒤따르는 바이트를 무시합니다. 전환 기간 동안 송신 측은 auth 본문에 100~300바이트의 무작위 바이트를 덧붙입니다. 그러면 새 형식 패킷을 고정 크기의 옛 형식과 구분할 수 있고, 핑거프린팅도 더 어려워집니다.\n\n이 규칙 덕분에 새 클라이언트는 버전을 올리고 필드를 덧붙일 수 있습니다. 옛 노드는 이해하지 못하는 부분을 그냥 무시하고 기존 기능 세트로 계속 통신합니다.\n\n## 샘플 코드\n\n명세에 나오는 새 핸드셰이크 레이아웃:\n\n```text\nauth-vsn      = 4\nauth-size     = size of enc-auth-body, big-endian 16-bit integer\nauth-body     = rlp.list(sig, initiator-pubk, initiator-nonce, auth-vsn)\nenc-auth-body = ecies.encrypt(recipient-pubk, auth-body, auth-size)\nauth-packet   = auth-size || enc-auth-body\n\nack-body      = rlp.list(recipient-ephemeral-pubk, recipient-nonce, ack-vsn)\nack-packet    = ack-size || ecies.encrypt(initiator-pubk, ack-body, ack-size)\n```\n\n수신 측이 옛 형식과 새 형식을 모두 받아들이는 방법(의사 코드):\n\n```go\npacket = read(307, conn)          // old format has a fixed size\nif decrypt(packet) {\n    // legacy handshake\n} else {\n    size := bigEndianUint16(packet[:2])\n    packet += read(size - 307 + 2, conn)\n    if !decrypt(packet) { /* error */ }\n    // EIP-8 handshake\n}\n```\n\n길이 접두사는 인증 데이터로도 ECIES에 전달되므로 변조할 수 없습니다.\n\n## 알아둘 점\n\n- 이것은 네트워킹 변경이지 합의 변경이 아닙니다. 블록이나 트랜잭션은 바뀌지 않지만, 앞으로의 업그레이드를 원활하게 하려면 모든 클라이언트가 필요로 했습니다.\n- 평문 크기 접두사가 가장 논쟁이 많았던 부분입니다. RLPx 트래픽을 식별하는 데 도움이 될 수 있기 때문입니다. 명세는 무작위 패딩이 그 위험을 제한한다고 주장합니다.\n- 이 EIP는 하위 호환됩니다. 유효한 버전 4 패킷은 모두 계속 허용됩니다.\n- 명세에는 hello, ping, pong, findnode, neighbours, 핸드셰이크 패킷의 테스트 벡터가 포함되어 있습니다. 클라이언트 개발자는 반드시 실행해야 합니다.\n- \"모르는 것은 무시한다\"는 같은 원칙 덕분에 이후 프로토콜 버전을 점진적으로 배포할 수 있었습니다.\n"},"zh":{"lang":"zh","tldr":"让以太坊的点对点协议能够容忍更新的版本和额外字段，使未来的网络升级不会让新旧节点分裂。","tags":["networking","devp2p","rlpx","homestead"],"related":[1,606],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8/","markdown":"## 它解决什么问题？\n\n以太坊节点之间通过 devp2p 通信：包括用于发现对等节点的发现协议、加密的 TCP 传输层（RLPx）以及\"hello\"握手。2015 年时，客户端会严格检查版本号和数据包布局。只要对等节点发送了更高的版本或多出一个字段，连接就会被断开。\n\n这使得每一次网络层改动都变成一个\"旗日\"（flag day）：要么所有人同时升级，要么网络分裂。EIP-8 要求客户端遵循波斯特法则（Postel's Law）：\"对自己所做的保持保守，对从别人那里接受的保持宽容\"，从而消除了这个陷阱。它随 Homestead 升级（[EIP-606](/eip-606/)）上线。\n\n## 它如何运作\n\n这些规则适用于三个协议层：\n\n- **devp2p 线路协议（hello 数据包）。** 忽略对方的版本号，发送自己支持的最高版本，并忽略末尾多余的列表元素。\n- **RLPx 发现。** 不校验 ping 的版本，忽略多余的列表元素和尾部数据，并静默丢弃未知的数据包类型。1280 字节的数据包大小上限保持不变。\n- **RLPx TCP 握手。** 引入了新的握手编码：\n  - 在加密正文之前加上 2 字节的明文长度前缀，\n  - 正文编码为 RLP 列表，\n  - auth 和 ack 数据包内都带有版本号（`4`），取代原先未使用的标志位，\n  - 移除对临时密钥的冗余哈希。\n\n  接收方忽略版本不匹配、多余的列表元素和尾部字节。过渡期间，发送方在 auth 正文后填充 100 到 300 个随机字节，使新格式数据包可以与固定大小的旧格式区分开来，也更难被指纹识别。\n\n有了这些规则，较新的客户端可以提升版本号并追加字段。较旧的节点只需忽略它不理解的部分，继续使用旧的功能集通信。\n\n## 示例代码\n\n规范中的新握手布局：\n\n```text\nauth-vsn      = 4\nauth-size     = size of enc-auth-body, big-endian 16-bit integer\nauth-body     = rlp.list(sig, initiator-pubk, initiator-nonce, auth-vsn)\nenc-auth-body = ecies.encrypt(recipient-pubk, auth-body, auth-size)\nauth-packet   = auth-size || enc-auth-body\n\nack-body      = rlp.list(recipient-ephemeral-pubk, recipient-nonce, ack-vsn)\nack-packet    = ack-size || ecies.encrypt(initiator-pubk, ack-body, ack-size)\n```\n\n接收方如何同时接受旧格式和新格式（伪代码）：\n\n```go\npacket = read(307, conn)          // old format has a fixed size\nif decrypt(packet) {\n    // legacy handshake\n} else {\n    size := bigEndianUint16(packet[:2])\n    packet += read(size - 307 + 2, conn)\n    if !decrypt(packet) { /* error */ }\n    // EIP-8 handshake\n}\n```\n\n长度前缀也会作为认证数据传给 ECIES，因此无法被篡改。\n\n## 需要注意\n\n- 这是网络层的改动，不是共识层的改动。它不会改变区块或交易，但所有客户端都需要它，才能保证未来的升级顺利进行。\n- 明文大小前缀是争议最大的部分，因为它可能帮助他人识别 RLPx 流量。规范认为随机填充可以限制这种风险。\n- 该 EIP 向后兼容：所有有效的版本 4 数据包仍会被接受。\n- 规范包含 hello、ping、pong、findnode、neighbours 以及握手数据包的测试向量。客户端开发者应当运行这些测试。\n- 正是同样的\"忽略你不认识的内容\"原则，使后来的协议版本得以逐步推出。\n"}},"requiredBy":[606,868]}
