Linea
Linea (opens in a new tab) is an EVM compatible Zero Knowledge (ZK) rollup chain built by Consensys (opens in a new tab).
- LineaScan (opens in a new tab) is the chain explorer for the chain.
- Linea smart contract addresses can be found here (opens in a new tab).
High level overview
The LineaRollup
rollup smart contract implementation is deployed behind a proxy on Layer 1.
Linea uses a Spare Merkle Trie (SPT) data structure.
The Linea: Operator (opens in a new tab) address calls finalizeBlocksWithProof
passing in the generated aggregate ZK Proof to update the latest finalized L2 block number and associated state root. An example transaction can be seen here (opens in a new tab).
Context
The LineaRollup.ts
specifies the finalised L2 block number as the context for virtual machine requests (returned by calling currentL2BlockNumber
on the Linea rollup contract).
Commit
The Linea L1MessageService
contract (opens in a new tab) has stateRootHashes
method that maps a L2 blockNumber
to a state root. The state root makes up the body of the commit for Linea.
Verification
The Unruggable gateway Typescript prover implementation used for Linea is LineaProver.ts
. Linea implements the linea_getProof
RPC method that returns proof data that can be verified with the SparseMerkleProof.sol (opens in a new tab)(tests (opens in a new tab)) written by Consensys.
The verifier for Linea proofs is found in the LineaVerifier.sol
that is deployed on L1. We interface with the SpareMerkleProof.sol
library through our proving hooks in LineaTrieHooks.sol
.
Notes
Compiler version
As outlined here (opens in a new tab):
"Solidity 8.23 and later compiles newer versions of the EVM by default. Use the solc --evm-version london command to ensure compatibility with Linea."
Linea.eth
subnames
Linea released their own code (opens in a new tab) for resolving subnames of linea.eth
from Linea using Proof of Humanity as a way of allocating names. This effort was auditted by Consensys (opens in a new tab) and makes for an interesting read.
Workshop with ENS and Unruggable
At Devcon 2024 in Bangkok, Thailand Linea gave a workshop alongside ENS and Unruggable.
The recording of this workshop can be viewed here.