The Shape of a Line: Linea's Architecture
Linea's ideal stateβ
Linea has the goal of being a fully decentralized, permissionless network. To that end, we are building towards an architecture made up of three main elements:
- Sequencer
- Prover
- Bridge Relayer
(Don't worry, if this isn't making sense to you yet, we'll explain further below π)
Current stateβ
Linea is in mainnet status, and the team is fervently working towards full decentralization. Currently, this is a good representation of the main components of Linea, and how they interact:
First of all: what is Linea, anyway? What's a zkEVM L2?β
There are a number of different mental models that people in web3 use to explain these different networks and how they relate to one another. Some people prefer to call them "rollup networks", or "scaling solutions"; probably the most popular way of discussing them is by imagining them as "layers", where one network is "built on top of another". Let's try and set metaphor aside for a moment, and speak in clear terms:
The Ethereum network has several functional areas:
- It has the blockchain, where it keeps track of addresses, and which tokens are allocated to which addresses.
- It has the consensus mechanism, wherein many many nodes communicate about the movement of tokens from one address to another, and each keeps their local copy of the ledger up to date.
- And it has the execution environment, wherein computer programs can be run. That's the "EVM", or "Ethereum Virtual Machine", part of things.
These three areas are heavily interconnected, and this is a simplification, but it's a helpful one to understand what's going on with other networks.
Ethereum prioritizes security: that consensus mechanism is designed to ensure that no one can singlehandedly alter the state of the network. This is a very impressive feat of engineering, and it comes with a tradeoff: the execution environment is highly limited in the amount of work it can do, because the consensus mechanism intentionally runs slowly, to keep everything safe.
Linea, and other networks like it, is designed to participate in the security mechanism of Ethereum, while optimizing for execution. In other words, it allows people to do lots of transactions, run lots of programs, deploy contracts, mint NFTs, absolutely go to town--fast, and cheap--and then report all that back to Ethereum, and include it in Ethereum's blockchain. By sending regular reports of activity on Linea to Ethereum, the network can optimize for execution without being as limited by security.
This is the action known as "rolling up": we would say that Linea "rolls up its transactions to Ethereum". And the fact that it relies on Ethereum for something--the security--leads people to say that it's "built on top of Ethereum": it's a "second-layer network", an L2. And before you ask, yes, Ethereum is an L1, and L3s exist, too: networks that roll up to Linea would roll up to Ethereum...
The trick is in how that rollup happens. Linea is special: it uses cutting-edge developments in a branch of mathematics and computer science often referred to as zero-knowledge, or zero-knowledge cryptography, to prove to the Ethereum network that everything that is happening on the Linea network is, in fact, happening, without having to submit a complete record of every last transaction and check each one. That's the 'zk' part.
So, now that we've walked through some concepts, we can roll it all up: Linea is a zkEVM L2 network.
OK... But what's a sequencer and a prover? How does all this actually work?β
At a high level, if you were to follow a flow from Ethereum, through Linea, and back to Ethereum, it would go like this:
Ethereum bridge contract >β
Linea bridge contract >β
Coordinator >β
Sequencer (Block building > Execution > Trace data generation) >β
Coordinator >β
Trace Conflation >β
EVM State Manager >β
Trace Expansion and Proving (Corset > gnark) >β
Coordinator >β
zk-proof and updated Merkle tree >β
Linea bridge contract >β
Ethereum bridge contract >β
Ethereum blockchainβ
_...in other words, there's a lot involved. _
Simplifying thingsβ
In order to make this explanation as clear and navigable as possible, we'll break each component down, and explain it in three steps:
What is it?β
What does it do?β
How does it do it?β
Let's start with the thing that a lot of users encounter when trying to access an L2 for the first time: a bridge.
But not just any bridge; there are a lot of data to pass back and forth between Linea and other networks, and therefore, Linea has more than one bridge; and that number is likely to continue to grow. But there's one in particular that matters: the Linea Canonical Message Service.