{"eip":225,"title":"Clique proof-of-authority consensus protocol","description":"Clique is a proof-of-authority consensus protocol. It shadows the design of Ethereum mainnet, so it can be added to any client with minimal effort.","authors":["Péter Szilágyi \u003cpeterke@gmail.com\u003e"],"status":"Final","type":"Standards Track","category":"Core","created":"2017-03-06","discussionsTo":"https://github.com/ethereum/EIPs/issues/225","repo":"EIPs","label":"EIP-225","officialUrl":"https://eips.ethereum.org/EIPS/eip-225","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-225.md","url":"https://eips.huatuo.xyz/eip-225/","tldr":{"en":"Clique is a simple proof-of-authority consensus in which a voted list of signers seals blocks, built to fit Ethereum's existing header format so clients could adopt it easily.","ja":"Clique は、投票で決まる署名者のリストがブロックに署名する単純なプルーフ・オブ・オーソリティのコンセンサス。Ethereum の既存のヘッダー形式に収まるよう設計され、クライアントが容易に採用できる。","ko":"Clique는 투표로 정해진 서명자 목록이 블록을 봉인하는 단순한 권위 증명(PoA) 합의. 이더리움의 기존 헤더 형식에 맞게 설계되어 클라이언트가 쉽게 도입할 수 있다.","zh":"Clique 是一种简单的权威证明共识：由投票产生的签名者名单负责封装区块，设计上适配以太坊现有的区块头格式，便于客户端采用。"},"tags":["consensus","proof-of-authority","testnet","clique"],"explainers":{"en":{"lang":"en","tldr":"Clique is a simple proof-of-authority consensus in which a voted list of signers seals blocks, built to fit Ethereum's existing header format so clients could adopt it easily.","tags":["consensus","proof-of-authority","testnet","clique"],"related":[3675],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-225/","markdown":"## What problem does it solve?\n\nA proof-of-work testnet is only as secure as the hash power behind it, and testnet ether is worth nothing. In early 2017, attackers took over the Ropsten testnet cheaply. They pushed the block gas limit up to about 9 billion and then flooded the network with huge transactions. Restarting the testnet would not help, because the same attack could be repeated.\n\nClique replaces mining with a set of **trusted signers**. Its main design goal is to fit into Ethereum's existing data structures, so any client can add it with little effort and fast and light sync keep working.\n\n## How it works\n\nClique reuses existing header fields instead of adding new ones:\n\n- **`extraData`** is 32 bytes of free \"vanity\" data, then a 65-byte secp256k1 signature that seals the header. On checkpoint blocks, the current signer list (N × 20 bytes, sorted) sits between the two.\n- **`miner` / `beneficiary`** is normally zero. A signer sets it to the address it wants to vote on.\n- **`nonce`** is `0xffffffffffffffff` to vote to **add** that address and `0x0000000000000000` to vote to **remove** it.\n- **`difficulty`** is 2 if the signer is \"in turn\" (`block_number % signer_count == signer_index`) and 1 otherwise. The chain with more in-turn blocks wins.\n- **`mixHash`** is zero, and **`ommersHash`** is always the hash of an empty uncle list.\n\nRules:\n\n- Each signer may seal at most one block in any `floor(N/2) + 1` consecutive blocks. A single bad or compromised signer cannot dominate the chain. Censoring a vote requires a majority.\n- A vote takes effect as soon as a majority of signers agree. Every `EPOCH_LENGTH` blocks (suggested 30,000), all pending votes are discarded and a checkpoint header records the full signer list. Clients can sync from a checkpoint without earlier state.\n- Blocks must be at least `BLOCK_PERIOD` apart (suggested 15 s). Out-of-turn signers are advised to wait a random delay so the in-turn signer usually wins.\n- Votes do not cascade. Only the address voted on in the current block can change, even if removing a signer would push other proposals past the majority.\n\n## Sample code\n\nClique section of a Geth-style genesis file:\n\n```json\n{\n  \"config\": {\n    \"chainId\": 1337,\n    \"clique\": { \"period\": 15, \"epoch\": 30000 }\n  },\n  \"difficulty\": \"1\",\n  \"gasLimit\": \"8000000\",\n  \"extraData\": \"0x\u003c32 zero bytes\u003e\u003csigner addresses, 20 bytes each\u003e\u003c65 zero bytes\u003e\"\n}\n```\n\nRecovering the signer of a header (pseudocode):\n\n```python\nseal = header.extra_data[-65:]\nunsigned = header.copy(extra_data=header.extra_data[:-65])\nsighash = keccak256(rlp_encode(unsigned))   # all header fields, in yellow-paper order\nsigner = ecrecover(sighash, seal)\nassert signer in authorized_signers and not signed_recently(signer)\n```\n\n## Things to know\n\n- Clique was used for public testnets such as Rinkeby and Görli, both of which have since been shut down, and it is widely used for private and dev networks.\n- Because `miner` holds a vote target, the `COINBASE` opcode and transaction fees must use the actual block signer recovered from `extraData`.\n- Short forks can still occur when out-of-turn signers race. The heavier in-turn difficulty decides between competing blocks.\n- Ethereum mainnet uses proof of stake ([EIP-3675](/eip-3675/)), not Clique.\n"},"ja":{"lang":"ja","tldr":"Clique は、投票で決まる署名者のリストがブロックに署名する単純なプルーフ・オブ・オーソリティのコンセンサス。Ethereum の既存のヘッダー形式に収まるよう設計され、クライアントが容易に採用できる。","tags":["consensus","proof-of-authority","testnet","clique"],"related":[3675],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-225/","markdown":"## 何を解決するのか\n\nプルーフ・オブ・ワークのテストネットの安全性は、その背後にあるハッシュパワーの大きさ次第ですが、テストネットの ether には価値がありません。2017 年初め、攻撃者は Ropsten テストネットを安価に乗っ取りました。ブロックのガスリミットを約 90 億まで引き上げ、巨大なトランザクションでネットワークを溢れさせたのです。同じ攻撃を繰り返せるため、テストネットを再起動しても解決になりませんでした。\n\nClique はマイニングを**信頼された署名者**の集合に置き換えます。主な設計目標は Ethereum の既存のデータ構造に収まることで、どのクライアントも少ない手間で追加でき、fast sync や light sync もそのまま動作します。\n\n## 仕組み\n\nClique は新しいフィールドを追加せず、既存のヘッダーフィールドを再利用します。\n\n- **`extraData`** は、32 バイトの自由な「vanity」データに続き、ヘッダーに署名する 65 バイトの secp256k1 署名が入ります。チェックポイントブロックでは、現在の署名者リスト（N × 20 バイト、ソート済み）がその 2 つの間に入ります。\n- **`miner` / `beneficiary`** は通常ゼロです。署名者は、投票したいアドレスをここに設定します。\n- **`nonce`** は、そのアドレスを**追加**する投票なら `0xffffffffffffffff`、**削除**する投票なら `0x0000000000000000` です。\n- **`difficulty`** は、署名者が「順番どおり（in turn）」（`block_number % signer_count == signer_index`）なら 2、そうでなければ 1 です。in-turn ブロックの多いチェーンが勝ちます。\n- **`mixHash`** はゼロで、**`ommersHash`** は常に空のアンクルリストのハッシュです。\n\nルール:\n\n- 各署名者は、連続する `floor(N/2) + 1` ブロックの中で最大 1 ブロックしか署名できません。不正な署名者や侵害された署名者が 1 人いても、チェーンを支配できません。投票を検閲するには過半数が必要です。\n- 投票は、署名者の過半数が賛成した時点で有効になります。`EPOCH_LENGTH` ブロックごと（推奨は 30,000）に、保留中の投票はすべて破棄され、チェックポイントヘッダーが署名者の全リストを記録します。クライアントは、それ以前の状態なしでチェックポイントから同期できます。\n- ブロックは少なくとも `BLOCK_PERIOD` の間隔を空ける必要があります（推奨は 15 秒）。順番外の署名者は、in-turn の署名者が通常は勝てるよう、ランダムな遅延を置くことが推奨されます。\n- 投票は連鎖しません。署名者を削除すると他の提案が過半数を超える場合でも、変更されるのは現在のブロックで投票されたアドレスだけです。\n\n## サンプルコード\n\nGeth 形式のジェネシスファイルの Clique 部分:\n\n```json\n{\n  \"config\": {\n    \"chainId\": 1337,\n    \"clique\": { \"period\": 15, \"epoch\": 30000 }\n  },\n  \"difficulty\": \"1\",\n  \"gasLimit\": \"8000000\",\n  \"extraData\": \"0x\u003c32 zero bytes\u003e\u003csigner addresses, 20 bytes each\u003e\u003c65 zero bytes\u003e\"\n}\n```\n\nヘッダーの署名者を復元する（擬似コード）:\n\n```python\nseal = header.extra_data[-65:]\nunsigned = header.copy(extra_data=header.extra_data[:-65])\nsighash = keccak256(rlp_encode(unsigned))   # all header fields, in yellow-paper order\nsigner = ecrecover(sighash, seal)\nassert signer in authorized_signers and not signed_recently(signer)\n```\n\n## 知っておくべきこと\n\n- Clique は Rinkeby や Görli といった公開テストネットで使われましたが、どちらもすでに停止しています。プライベートネットワークや開発用ネットワークでは今も広く使われています。\n- `miner` が投票対象を保持するため、`COINBASE` オペコードとトランザクション手数料には、`extraData` から復元した実際のブロック署名者を使う必要があります。\n- 順番外の署名者が競合すると、短いフォークは依然として発生し得ます。競合するブロックの間では、in-turn の重い difficulty が勝敗を決めます。\n- Ethereum メインネットは Clique ではなく、プルーフ・オブ・ステーク（[EIP-3675](/eip-3675/)）を使っています。\n"},"ko":{"lang":"ko","tldr":"Clique는 투표로 정해진 서명자 목록이 블록을 봉인하는 단순한 권위 증명(PoA) 합의. 이더리움의 기존 헤더 형식에 맞게 설계되어 클라이언트가 쉽게 도입할 수 있다.","tags":["consensus","proof-of-authority","testnet","clique"],"related":[3675],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-225/","markdown":"## 어떤 문제를 해결하나요?\n\n작업 증명 테스트넷의 보안은 그 뒤에 있는 해시 파워만큼만 안전한데, 테스트넷의 ether는 가치가 없습니다. 2017년 초 공격자들이 Ropsten 테스트넷을 저렴하게 장악했습니다. 블록 가스 한도를 약 90억까지 끌어올린 뒤 거대한 트랜잭션으로 네트워크를 가득 채웠습니다. 같은 공격을 반복할 수 있었기 때문에 테스트넷을 재시작해도 소용이 없었습니다.\n\nClique는 채굴을 **신뢰할 수 있는 서명자** 집합으로 대체합니다. 핵심 설계 목표는 이더리움의 기존 데이터 구조에 맞는 것이어서, 어떤 클라이언트든 적은 노력으로 추가할 수 있고 fast sync와 light sync도 계속 동작합니다.\n\n## 어떻게 동작하나요?\n\nClique는 새 필드를 추가하지 않고 기존 헤더 필드를 재사용합니다.\n\n- **`extraData`**는 32바이트의 자유로운 \"vanity\" 데이터 뒤에 헤더를 봉인하는 65바이트 secp256k1 서명이 옵니다. 체크포인트 블록에서는 현재 서명자 목록(N × 20바이트, 정렬됨)이 둘 사이에 들어갑니다.\n- **`miner` / `beneficiary`**는 보통 0입니다. 서명자는 투표하려는 주소를 여기에 설정합니다.\n- **`nonce`**가 `0xffffffffffffffff`이면 해당 주소를 **추가**하는 투표이고, `0x0000000000000000`이면 **제거**하는 투표입니다.\n- **`difficulty`**는 서명자가 \"자기 차례(in turn)\"(`block_number % signer_count == signer_index`)이면 2, 아니면 1입니다. 차례에 맞춘 블록이 더 많은 체인이 이깁니다.\n- **`mixHash`**는 0이고, **`ommersHash`**는 항상 빈 엉클 목록의 해시입니다.\n\n규칙:\n\n- 각 서명자는 연속한 `floor(N/2) + 1`개 블록 중 최대 한 블록만 봉인할 수 있습니다. 악의적이거나 탈취된 서명자 한 명이 체인을 장악할 수 없습니다. 투표를 검열하려면 과반수가 필요합니다.\n- 투표는 서명자 과반수가 동의하는 즉시 효력이 생깁니다. `EPOCH_LENGTH` 블록마다(권장 30,000) 대기 중인 투표가 모두 폐기되고, 체크포인트 헤더가 전체 서명자 목록을 기록합니다. 클라이언트는 이전 상태 없이 체크포인트에서부터 동기화할 수 있습니다.\n- 블록은 최소 `BLOCK_PERIOD` 간격을 두어야 합니다(권장 15초). 차례가 아닌 서명자는 무작위로 지연한 뒤 서명하도록 권장되어, 보통은 차례인 서명자가 이기게 됩니다.\n- 투표는 연쇄적으로 적용되지 않습니다. 서명자를 제거하면 다른 제안이 과반수를 넘게 되더라도, 현재 블록에서 투표한 주소만 바뀝니다.\n\n## 샘플 코드\n\nGeth 스타일 제네시스 파일의 Clique 부분:\n\n```json\n{\n  \"config\": {\n    \"chainId\": 1337,\n    \"clique\": { \"period\": 15, \"epoch\": 30000 }\n  },\n  \"difficulty\": \"1\",\n  \"gasLimit\": \"8000000\",\n  \"extraData\": \"0x\u003c32 zero bytes\u003e\u003csigner addresses, 20 bytes each\u003e\u003c65 zero bytes\u003e\"\n}\n```\n\n헤더의 서명자 복구(의사 코드):\n\n```python\nseal = header.extra_data[-65:]\nunsigned = header.copy(extra_data=header.extra_data[:-65])\nsighash = keccak256(rlp_encode(unsigned))   # all header fields, in yellow-paper order\nsigner = ecrecover(sighash, seal)\nassert signer in authorized_signers and not signed_recently(signer)\n```\n\n## 알아둘 점\n\n- Clique는 Rinkeby와 Görli 같은 공개 테스트넷에서 쓰였으며 두 테스트넷은 이후 종료되었습니다. 프라이빗 네트워크와 개발용 네트워크에서는 지금도 널리 쓰입니다.\n- `miner`가 투표 대상을 담고 있으므로, `COINBASE` opcode와 트랜잭션 수수료에는 `extraData`에서 복구한 실제 블록 서명자를 사용해야 합니다.\n- 차례가 아닌 서명자들이 경쟁하면 짧은 포크가 여전히 생길 수 있습니다. 경쟁하는 블록 사이에서는 차례인 쪽의 더 무거운 difficulty가 승패를 가립니다.\n- 이더리움 메인넷은 Clique가 아니라 지분 증명([EIP-3675](/eip-3675/))을 사용합니다.\n"},"zh":{"lang":"zh","tldr":"Clique 是一种简单的权威证明共识：由投票产生的签名者名单负责封装区块，设计上适配以太坊现有的区块头格式，便于客户端采用。","tags":["consensus","proof-of-authority","testnet","clique"],"related":[3675],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-225/","markdown":"## 它解决什么问题？\n\n工作量证明测试网的安全性取决于其背后的算力，而测试网的 ether 一文不值。2017 年初，攻击者以很低的成本接管了 Ropsten 测试网。他们把区块 gas 上限推高到约 90 亿，然后用巨大的交易淹没网络。重启测试网也无济于事，因为同样的攻击可以重演。\n\nClique 用一组**受信任的签名者**取代挖矿。它的主要设计目标是适配以太坊现有的数据结构，让任何客户端都能轻松加入，并且 fast sync 和 light sync 仍然可用。\n\n## 它如何运作\n\nClique 复用现有的区块头字段，而不是新增字段：\n\n- **`extraData`** 先是 32 字节的自由\"vanity\"数据，然后是封装区块头的 65 字节 secp256k1 签名。在检查点区块中，当前的签名者列表（N × 20 字节，已排序）位于这两部分之间。\n- **`miner` / `beneficiary`** 通常为零。签名者把想要投票的地址设在这里。\n- **`nonce`** 为 `0xffffffffffffffff` 表示投票**添加**该地址，为 `0x0000000000000000` 表示投票**移除**该地址。\n- **`difficulty`** 在签名者\"轮到自己\"（`block_number % signer_count == signer_index`）时为 2，否则为 1。轮次内区块更多的链获胜。\n- **`mixHash`** 为零，**`ommersHash`** 始终是空叔块列表的哈希。\n\n规则：\n\n- 在任意连续 `floor(N/2) + 1` 个区块中，每个签名者最多只能封装一个区块。单个恶意或被攻陷的签名者无法主导区块链。要审查某次投票需要多数签名者。\n- 一旦多数签名者同意，投票即刻生效。每隔 `EPOCH_LENGTH` 个区块（建议 30,000），所有待处理的投票都会被丢弃，并由一个检查点区块头记录完整的签名者列表。客户端可以从检查点开始同步，而无需更早的状态。\n- 区块之间至少相隔 `BLOCK_PERIOD`（建议 15 秒）。建议没轮到的签名者随机等待一段时间，这样通常是轮到的签名者获胜。\n- 投票不会连锁生效。即使移除某个签名者会让其他提案超过多数，也只有当前区块中被投票的那个地址会发生变化。\n\n## 示例代码\n\nGeth 风格创世文件中的 Clique 部分：\n\n```json\n{\n  \"config\": {\n    \"chainId\": 1337,\n    \"clique\": { \"period\": 15, \"epoch\": 30000 }\n  },\n  \"difficulty\": \"1\",\n  \"gasLimit\": \"8000000\",\n  \"extraData\": \"0x\u003c32 zero bytes\u003e\u003csigner addresses, 20 bytes each\u003e\u003c65 zero bytes\u003e\"\n}\n```\n\n恢复区块头的签名者（伪代码）：\n\n```python\nseal = header.extra_data[-65:]\nunsigned = header.copy(extra_data=header.extra_data[:-65])\nsighash = keccak256(rlp_encode(unsigned))   # all header fields, in yellow-paper order\nsigner = ecrecover(sighash, seal)\nassert signer in authorized_signers and not signed_recently(signer)\n```\n\n## 需要注意\n\n- Clique 曾用于 Rinkeby 和 Görli 等公共测试网，这两个测试网如今都已关闭；它在私有网络和开发网络中仍被广泛使用。\n- 由于 `miner` 用来存放投票目标，`COINBASE` 操作码和交易费用必须使用从 `extraData` 中恢复出的实际区块签名者。\n- 当没轮到的签名者争抢时，仍可能出现短分叉。竞争区块之间由轮次内更高的 difficulty 决定胜负。\n- 以太坊主网使用的是权益证明（[EIP-3675](/eip-3675/)），而不是 Clique。\n"}},"requiredBy":[3436]}
