Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linter and associated tasks #828

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"bracketSameLine": true,
"bracketSpacing": true,
"printWidth": 80,
"proseWrap": "never",
"proseWrap": "always",
"singleQuote": false,
"trailingComma": "all",
"tabWidth": 2,
Expand Down
102 changes: 58 additions & 44 deletions docs/architecture/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ image: /img/socialCards/architecture-of-linea.jpg

## Linea's ideal state

Linea aims to be a fully decentralized, permissionless network. To support this goal, the Linea architecture is made up of three main elements:
Linea aims to be a fully decentralized, permissionless network. To support this
goal, the Linea architecture is made up of three main elements:

- Sequencer
- Prover
- Bridge relayer

## Current state

Linea is in mainnet status, and the team is fervently working towards full decentralization.
The following is a good representation of the main components of Linea, and how they interact:
Linea is in mainnet status, and the team is fervently working towards full
decentralization. The following is a good representation of the main components
of Linea, and how they interact:

<div class="center-container">
<div class="img-large">
Expand All @@ -31,48 +33,56 @@ The following is a good representation of the main components of Linea, and how

## First of all: what _is_ Linea, anyway? What's a zkEVM L2?

There are several different mental models that people use to explain the different
networks and how they relate to one another. Some people prefer to call L2s "rollup networks",
or "scaling solutions". The term "layer" is a popular mental model: where one network is "built on top of another".
There are several different mental models that people use to explain the
different networks and how they relate to one another. Some people prefer to
call L2s "rollup networks", or "scaling solutions". The term "layer" is a
popular mental model: where one network is "built on top of another".

Let's set metaphor aside for a moment, and clarify:

**The Ethereum network has several functional areas:**

- _Blockchain_: keeps track of addresses, and which tokens are allocated to
which addresses
- _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
- _Execution environment_: the EVM (Ethereum Virtual Machine) wherein computer programs can be run.

These three areas are heavily interconnected, and this is a simplification, but it's a helpful
one to understand the tradeoffs all networks must make.

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 L2s are designed to participate in the security mechanism of Ethereum,
while optimizing for execution. In other words, L2s enables users to make many transactions, run
lots of programs, deploy contracts, mint NFTs, absolutely go to town—fast and cheap, and then compresses this data into a report back to Ethereum for inclusion 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 can say that Linea "rolls up its transactions to
Ethereum". And the fact that it relies on Ethereum for its 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. Instead, Linea submits a verifiable proof to Ethereum of each transaction: 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.
- _Blockchain_: keeps track of addresses, and which tokens are allocated to
which addresses
- _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
- _Execution environment_: the EVM (Ethereum Virtual Machine) wherein computer
programs can be run.

These three areas are heavily interconnected, and this is a simplification, but
it's a helpful one to understand the tradeoffs all networks must make.

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 L2s are designed to participate in the security mechanism of
Ethereum, while optimizing for execution. In other words, L2s enables users to
make many transactions, run lots of programs, deploy contracts, mint NFTs,
absolutely go to town—fast and cheap, and then compresses this data into a
report back to Ethereum for inclusion 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 can say that Linea "rolls up its
transactions to Ethereum". And the fact that it relies on Ethereum for its
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. Instead, Linea submits a verifiable proof to
Ethereum of each transaction: 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.

<div class="center-container">
<div class="img-xsmall">
Expand All @@ -85,7 +95,8 @@ 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:
At a high level, if you were to follow a flow from Ethereum, through Linea, and
back to Ethereum, it would go like this:

1. Ethereum bridge contract >
2. Linea bridge contract >
Expand Down Expand Up @@ -114,6 +125,9 @@ _...in other words, there's a lot involved._

## Next steps

- Learn more about the different components that comprise the [Linea architecture](./stack/index.mdx).
- Understand the first point of contact for many new L2 users, the bridge. Linea has more than one bridge; and that number is likely to continue to
grow. The [Linea canonical message service](./stack/canonical-msg-service/index.mdx) is key to these bridges and how they function.
- Learn more about the different components that comprise the
[Linea architecture](./stack/index.mdx).
- Understand the first point of contact for many new L2 users, the bridge. Linea
has more than one bridge; and that number is likely to continue to grow. The
[Linea canonical message service](./stack/canonical-msg-service/index.mdx) is
key to these bridges and how they function.
Loading
Loading