---
eip: 225
label: EIP-225
title: Clique proof-of-authority consensus protocol
status: Final
type: Standards Track
category: Core
created: 2017-03-06
official: https://eips.ethereum.org/EIPS/eip-225
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-225.md
canonical: https://eips.huatuo.xyz/eip-225/
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]
---

# EIP-225: Clique proof-of-authority consensus protocol

> 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.

**TL;DR:** 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.

## What problem does it solve?

A 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.

Clique 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.

## How it works

Clique reuses existing header fields instead of adding new ones:

- **`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.
- **`miner` / `beneficiary`** is normally zero. A signer sets it to the address it wants to vote on.
- **`nonce`** is `0xffffffffffffffff` to vote to **add** that address and `0x0000000000000000` to vote to **remove** it.
- **`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.
- **`mixHash`** is zero, and **`ommersHash`** is always the hash of an empty uncle list.

Rules:

- 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.
- 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.
- 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.
- 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.

## Sample code

Clique section of a Geth-style genesis file:

```json
{
  "config": {
    "chainId": 1337,
    "clique": { "period": 15, "epoch": 30000 }
  },
  "difficulty": "1",
  "gasLimit": "8000000",
  "extraData": "0x<32 zero bytes><signer addresses, 20 bytes each><65 zero bytes>"
}
```

Recovering the signer of a header (pseudocode):

```python
seal = header.extra_data[-65:]
unsigned = header.copy(extra_data=header.extra_data[:-65])
sighash = keccak256(rlp_encode(unsigned))   # all header fields, in yellow-paper order
signer = ecrecover(sighash, seal)
assert signer in authorized_signers and not signed_recently(signer)
```

## Things to know

- 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.
- Because `miner` holds a vote target, the `COINBASE` opcode and transaction fees must use the actual block signer recovered from `extraData`.
- Short forks can still occur when out-of-turn signers race. The heavier in-turn difficulty decides between competing blocks.
- Ethereum mainnet uses proof of stake ([EIP-3675](/eip-3675/)), not Clique.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-225
