Rust
In the first part of the lesson, we’ve covered some common topics like Cargo, enums, match
, Option
, etc., in Rust synaxis, which you can find in any popular guide.
Rust is a very popular language in the ZKP space, because of its core features:
- Memory safety without garbage collection
- Concurrency without data races
- Abstraction without overhead
Check these two books to learn Rust: https://google.github.io/comprehensive-rust/ https://doc.rust-lang.org/book
Many projects like StarkNet and Aztec use Rust-like languages to program smart contracts (circuits).
Understanding and Analyzing Layer 2
How we differentiate L2s (from https://ethereum.org/en/layer-2/):
- Generalized like Arbitrum, Optimism, and StarkNet, which are EVM-complete, and you can run the same things as on Ethereum.
- Application specific like dYdX, Immutable, and Loopring that have some limitations in the possible instructions.
Check out more on L2Beat: https://l2beat.com/scaling/summary (and donate on GitCoin, they’re good guys!)
Back in 2020, we ran monolithic rollups but later realized they could be separated into several layers:
Check each layer here: https://stack.optimism.io/docs/understand/landscape/
- We usually use Ethereum to store data for DA because it has established security, but we’re not limited in this regard. We can use a different storage, but it’ll have other security assumptions.
- The Sequencing layer defines the collection of user transactions and their publication to the DA layer.
- The Derivation layer works very close to the DA layer and processes data to define the inputs for the Execution layer.
- The Execution layer takes inputs from the Derivation layer and processes outputs by some rules (for example, EVM opcodes).
- The Settlement layer is read-only and used by external parties to retrieve some data from the L2 blockchain. Usually, we have a Sequencer that collects the transactions by some API.
Vitalik Buterin introduced rollup milestones in this post: https://ethereum-magicians.org/t/proposed-milestones-for-rollups-taking-off-training-wheels/11571
- Stage 0: full training wheels
- Stage 1: limited training wheels
- Stage 2: no training wheels
Where 0 is the most centralized and unsecure stage, and 2 is the most decentralized and secure.
Also, check out a post by L2Beat: https://medium.com/l2beat/introducing-stages-a-framework-to-evaluate-rollups-maturity-d290bb22befe
Currently, there are only two rollups on Stage 2 (Fuel and DeGate), and the most popular ones are still on Stage 0.