Smart contracts
LinethLineth (Formerly the Linea Stack) The open-source ZK-rollup stack, codebase, and technical protocol that's the foundation of Linea Mainnet. Operators can deploy this stack to launch their own Ethereum-compatible L2 or L3 networks. deploys system contracts on two chains: the finalization layerFinalization layer The blockchain where a Lineth deployment submits proofs and state commitments for verification and hard finality. If the finalization layer is Ethereum (an L1), the deployment is an L2. If the finalization layer is Linea (an L2), the deployment is an L3., where state transitions are verified and recorded, and the network itself. Together they establish what the network's state is and move messages and tokens between the two.
Because the network is an EVMEthereum Virtual Machine (EVM) A stack-based virtual machine that executes bytecode. In Ethereum, the execution model specifies how the system state is altered given a series of bytecode instructions and a small tuple of environmental data. This is specified through a formal model of a virtual state machine.-equivalent environment, these contracts, and any application contracts deployed on the network, can be written in any language that compiles to EVM bytecode.
Finalization contract
Deployed on the finalization layer, this contract is the network's onchain root of trust: nothing the network claims about its own state is accepted elsewhere until this contract has recorded it. The finalization contract:
- Verifies the zk-SNARKzk-SNARK (Zero-Knowledge Succinct Non-interactive Argument of Knowledge) A type of ZK proof where the prover and verifier don't have to interact. With zk-SNARKs, you can verify 1 transaction or 1 billion transactions in the same amount of time. proof submitted for each range of blocks, and records the resulting finalized state.
- Accepts the transaction data the network publishes, through whichever data submission model the deployment uses.
- Anchors the Merkle roots of the messages the finalized blocks sent, and verifies the rolling hash of the messages the network received. See Message commitments.
- Queues forced transactions submitted on the finalization layer, so they can be proven to have been processed by their deadline.
In the Linea Mainnet deployment, this contract is LineaRollup on Ethereum,
which also serves as the L1 message service.
Operators running other deployments can reuse the same contract or deploy an equivalent that satisfies the
interfaces their finalization design requires.
Message service contracts
A message service contract is deployed on each chain. Together they carry arbitrary calldata and native currency in both directions, and only deliver a message once it can be checked against a commitment recorded by the finalization contract.
Everything else that crosses chains, including the token bridge, is built on this pair. See Canonical message service.
Token bridge contracts
A token bridge contract is deployed on each chain. They bridge ERC-20 tokens by escrowing the original on its home chain and minting a bridged equivalent on the other, sending each instruction through the message service. Minted supply is always matched by escrowed supply, so the bridge cannot mint tokens that were never locked. See Canonical token bridge.
Contract versioning
Contracts are immutable once deployed unless they're explicitly designed to be upgraded. Lineth's upgradeable contracts, including the finalization contract, message service, and token bridge, use the OpenZeppelin Transparent Upgradeable Proxy pattern (v4.x): state lives in a proxy, and an upgrade replaces the implementation the proxy delegates to.
Who holds upgrade authority is a deployment decision, not a protocol one. See Trust and responsibilities for how that authority is scoped.
Linea contracts are written in Solidity and audited by two to three external auditors before release, alongside static analysis and, where applicable, formal verification. The auditors also confirm the deployment on the target environment. See Security audits for the published reports. Upgrading the system requires signatures from both the Linea Operational Safe and the Linea Security Council Safe multisignature accounts.
See also
- See the contracts reference for the deployed addresses and roles on Linea Mainnet, and the Security Council transaction record for its upgrade history.
- See the contract source code in the
lineth-monorepo.