Cover photo

Linea: A ZK Layer 2 by Consensys

What is Linea? (Thanks to CoinGecko)

Linea is a developer-ready Ethereum-equivalent zkEVM network that utilizes zero knowledge technology and rollups. It also features technology like quantum-resistant lattice-based cryptography and its Canonical Messaging Sevice.


Key Takeaways

  • Linea is being developed by Consensys. It is an EVM-equivalent Layer 2 network that claims to scale the user experience on Ethereum.

  • Linea boasts improved transaction fees and significantly lower fees compared to the main network. It uses zero knowledge to verify the authenticity of transactions.

  • Linea is built on lattice-based cryptography and secured with a zero knowledge rollup, where transactions are executed off the mainnet with proofs of the transactions sent to Ethereum for final validation. By this, it maintains the same level of security and decentralization as the main network.


Ethereum vertical scaling solutions are on the rise. Different projects are developing facilities and platforms that enable users to enjoy the strengths of the Ethereum blockchain without its infamous high gas fees and slower speed.

Originally, the Ethereum blockchain’s consensus mechanism allowed multiple validators to assess new transactions before they are added to the network to ensure security. But this has become challenging as blockchain adoption grows and more users put pressure on the network, which has led to the popularity of Layer 2s like ArbitrumOptimismzkSync Era and now Linea.

Linea, a Layer 2 scaling solution being developed by Consensys claims to scale Ethereum through a constitutive platform that handles transactions in a more efficient environment. But what is Linea and how does it work?

Understanding Linea and How It Works

On July 11, 2023, Consensys announced the mainnet alpha of the Linea network after completing the testing phase. Data from the Goerli testnet for Linea claims that over 49 million transactions have been conducted on the Linea Goerli testnet by over 5.5 million verified addresses.

So, how does Linea work?

Linea is a type 1 zkEVM. Type 1 zkEVMs are Ethereum equivalent and do not change any part of the system, which makes them perfectly compatible with Ethereum and lets developers reuse a lot of existing infrastructure. Ethereum equivalence enables the smooth deployment of existing applications on Linea, along with the creation of new ones that would be too expensive on the Mainnet.

However, the challenge here is around improving the prover time, as proofs for Ethereum blocks can take hours. To overcome this, Linea uses zero-knowledge proofs, rollups, and the Linea Canonical Message Service.

Zero-Knowledge Proofs

Linea uses zero-knowledge proofs to prove the integrity of transactions without revealing the details of the transaction. Linea leverages lattice-based cryptography to create zero-knowledge proofs for every transaction performed on the network. It completely cuts off third parties in transaction verification and keeps the details of a transaction away from the public view.

Here’s how zero-knowledge proof works:

The two parties in a zero-knowledge proof transaction are the Prover and the Verifier. The prover is the sender of the transaction while the verifier is the recipient. The hidden information (details of the transaction) is known as a Witness.

To prove to the verifier that a transaction is true, a prover is meant to answer a question regarding the transaction. The verifier generates the question (known as the Challenge) and sends it to the prover. The prover provides an answer (known as a Response) question and proves their knowledge of the witness. The protocol validates the answer provided by the prover and relays the Truthfulness of the transaction to the verifier. Therefore, the only information the recipient of the transaction has is whether it is true or false.

Rollups

As the name implies, rollups package multiple transactions into batches, which are validated as a single transaction. This mass validation system means that only a single fee is paid for the rolled-up transactions and they are all validated at the same time. This saves cost and time based on how many transactions are rolled-up at a time. According to an article by Vitalik Buterin, rollups can package up to 62,500 transactions into one and approve a batch in 13 seconds, translating to over 4,800TPS. The Ethereum mainnet can only process 32 transactions in a second.

Linea Canonical Message Service

Linea’s Canonical Message Service creates an efficient communication pathway between the Linea network and the Ethereum mainnet.

The  Canonical Message Service functions as a bridge and a messaging stack. It is a combination of protocols and smart contracts that pass stage-change information (routine transactions) and arbitrary messages between Linea and other networks. It transmits data about the current state of the Ethereum mainnet to Linea and vice versa. The main messaging protocol of Linea’s canonical message service is the ‘Postbots’.

According to the project, Postbots are ‘actors’ that 'listen' for calls being made to one of the contracts, either on Linea or Ethereum and pass the information submitted to the other network. While centralized during the testing phase, Consensys claims that the Postbot protocol when in full service will be a decentralized protocol where anyone on the network can serve as a Postbot.

In summary, Linea conceals transactions on its network using zero knowledge, rolls them up using the rollup technology, and sends them to the mainnet through the canonical message service.

post image

Now, let's look at some features of the Linea network.

Full Ethereum Equivalence

As Linea is a Type 1 zkEVM, it runs an execution environment equivalent to Ethereum. In simpler terms, Linea is not just EVM-compatible, it is EVM-equivalent. This means that applications previously deployed on the mainnet can be moved to Linea where they can enjoy (almost) the same security and decentralization as on the main network while operating on a more resource-efficient platform.

This makes it easy for existing Ethereum projects to deploy on Linea.

Lattice-based Cryptography

Linea claims to operate a zero-knowledge proof protocol that uses lattice-based cryptography. Lattice-based cryptography, while not being a new concept, is finding its way into modern blockchain systems. It is based on the concept of a lattice. A lattice is a geometric structure developed by crossing structures in such a way that leaves a square, rectangular, or diamond shape between them. In cryptography, this pattern is used to encrypt data.

The encryption design in lattice-based cryptography is based on deciphering the points in a lattice and matching them to corresponding points on another lattice. This is only possible (or will be easier) for someone who knows the correct keys for the lattices. Keyed lattice cryptography algorithms, like NTRUEncrypt, require using a secret key to encrypt and decrypt messages. Lattice-based cryptography could be used to construct a full encryption structure or used to develop security proofs where they function as an authentication system.

In modern cryptographic systems, here’s what lattice-based cryptography could offer

Quantum resistance

Quantum technology is a clear threat to current cryptographic systems like RSA and the Elliptic curve. Experiments claim that these encryption systems can be exposed by quantum computers using the Shor algorithm. According to claims, lattice-based encryption has shown resistance to quantum computers. Lattice-based ciphers like Dilithium and Kyber are widely considered examples of quantum-proof encryption, and Linea operates a quantum-resistant system thanks to lattice-based cryptography.

Speed

Lattice-based cryptographic systems have shown a faster computation time than other encryption systems. Efficiency in this area could contribute to the overall throughput of the (blockchain) network where it is used. This gives lattice-based systems an edge over alternatives that operate the same technology in every other area.

Resource Efficiency

Computing lattice-based encryption requires lesser energy and computer resources. Systems built on this can therefore be run on low-power devices. Also, relative to the elliptic curve and RSA cryptography, lattice-based cryptography is easier to implement and can be used in a more diverse system. Lattice-based cryptography can be used for digital signatures, password-based encryption, and key exchange. Lattice-based cryptography is therefore regarded as a relatively cost-effective and accessible encryption system.

Improved Security

Research in this area claims that lattice-based encryption systems are harder to break into, even by quantum computers as explained earlier. When used to develop blockchains, it could offer a more secure network.

With these features, Linea hopes to compete with other Layer 2 scaling solutions, but how does it compare to these other networks?

Linea vs. Other ZK Layer 2s

While other Layer 2 networks like Optimism and Arbitrum use optimistic rollups to scale transactions on the mainnet, Linea and other zero knowledge scaling solutions use the relatively more complex ZK rollups that don't require a challenge period. zkSync Era launched in the first quarter of 2023 and has since then built an ecosystem of applications using its technology. More networks like these are emerging, including Polygon’s zkEVM.