Altcoins Talks - Cryptocurrency Forum

Learning & News => Announcements [ANN] => Topic started by: 0406Antoxa1982 on July 11, 2023, 12:10:22 AM

Title: Kakarot
Post by: 0406Antoxa1982 on July 11, 2023, 12:10:22 AM
Kakarot: an intro to the first modular zkEVM

(https://i.imgur.com/0ok0WQ3.png)

TL;DR: Kakarot is a type 3 (soon-to-be type 2.5) zkEVM, built on top of the CairoVM. The project, which began in October 2022, has several goals in mind: open-source from day one, welcoming contributions, and most ambitiously, creating a zkEVM in less than 10,000 lines of code. We achieved this goal in just six months. We’ll release a testnet at the end of summer 2023.

A glossary is available at the end of the article for context on EVM, zkRollups and zkEVM.


An Incomplete Primer on the CairoVM

The CairoVM is a virtual machine that enables provable execution. It serves as the foundation for Starknet, a general-purpose Layer 2 (L2) validity rollup in the Ethereum ecosystem. The CairoVM’s ability to represent execution as polynomials allows every transaction on Starknet to be proven using STARKs. This necessitates developers building decentralised applications (dApps) in Cairo, the associated programming language.

In the words of the team behind Cairo, Lior Goldberg and Shahar Papini and Michael Riabzev:


We present Cairo, a practically efficient Turing-complete STARK-friendly CPU architecture. We describe a single set of polynomial equations for the statement that the execution of a program on this architecture is valid. Given a statement one wishes to prove, Cairo allows writing a program that describes that statement, instead of writing a set of polynomial equations.

Takeaway: Programs written in Cairo are provable, which enables a game-changing advantage: writing provable programs in a high-level language. As a result, developers looking to leverage the scalability property of zero-knowledge cryptography no longer need to write circuits.

So, would rewriting the Ethereum Virtual Machine (EVM) in Cairo result in a zkEVM?


The idea was simple: the EVM is a mature, well-defined VM architecture. 142 opcodes, 9 precompiles, and a democratic process to update these opcodes or precompiles. Should one build it in Cairo, would one get a zkEVM “for free”, i.e. obtain the scaling property of zero-knowledge as a direct consequence? Spoiler alert, yes.

From there, the idea gained traction in the Starknet community. Abdel, the lead of Starkware’s exploration team and part of the core Ethereum developer team, started implementing it in October 2022. Around the same time, the open-source builder community of Starknet — gathered together with Onlydust’s help — began a similar project in parallel. The former absorbed the latter during StarknetCC in Lisbon.


By the End of 2022, Kakarot Had 100% of EVM Opcodes Implemented.

A hacker house in Lisbon, one week of dedicated work, and about ten people building a zkEVM. The Kakarot core team was born. We realized that this was feasible and powerful. A naive implementation of a zkEVM that fit in less than 5,000 lines of code. No circuits, no polynomials. Just high-level, expressive code.

With the help of the Starknet Foundation and Onlydust, we embarked on this adventure. Our values were open-source, open contributions, and community-driven technical strategy. Clément and I led and coordinated this effort. Today, Kakarot has more than 40 unique contributors. While Kakarot is incorporating to crystallise the effort around building a production-grade zkEVM, our values endure: open-source forever and open for outside contributions


As of May 2023, Kakarot has achieved 100% bytecode equivalence (equivalent to type 3 zkEVM) and implemented 8 out of 9 EVM precompiles. It will soon have all nine of them, thus reaching type 2.5, as per Vitalik’s typology. As a result, dApps written in Solidity or any other EVM-supported language can be deployed onto Kakarot without requiring any modifications to the existing code.

What’s Next? A Two-Fold Bet: Bring the EVM to Starknet and Build a zkEVM-Rollup-as-a-Service Product

When we analysed the market, we noticed that compared to other zkEVMs, Kakarot is an underdog — a team of fewer than 10 people with a significantly smaller budget and brand. Deploying as a general-purpose zkEVM L2 seemed risky. So, what other strategies appeared sound? Bring EVM compatibility to Starknet and leverage fractal scaling.

We strongly believe Cairo will prove to be the best toolbox for zero-knowledge engineering in the coming years. We also believe the EVM will remain the most common layer of abstraction for developers. This is why we’re bringing EVM compatibility to Starknet. Soon, teams will be able to deploy their Solidity dApp on Starknet, through Kakarot.

Moreover, we think app-chains (or app-specific L3s) will emerge sooner than people expect. The traction that the OP stack has been gaining is a good example. By leveraging the modular nature of Kakarot (small and flexible codebase, adaptable to any Cairo chain), we’re empowered to build a zkRollup-as-a-service tool.
One-click: a zkEVM deployed as L3 on top of Starknet for a specific app. EVM environment, low gas, and fast execution. Cryptographic security.


Context & Glossary

EVM (Ethereum Virtual Machine): The EVM is a Turing-complete virtual machine that executes smart contracts on the Ethereum blockchain. It serves as the runtime environment for these contracts, processing the instructions and managing the state of the network. Developers can write smart contracts in languages like Solidity, which are then compiled to EVM bytecode and executed by the virtual machine.
zkRollups: zkRollups are Layer 2 scaling solutions for blockchain networks, particularly Ethereum. They bundle multiple transactions into a single proof, which is then posted on the main chain. By using zero-knowledge proofs, zkRollups enable greater throughput and lower transaction costs while maintaining a high level of security and decentralisation.
zkEVM (Zero-Knowledge Ethereum Virtual Machine): A zkEVM is an EVM implementation that incorporates zero-knowledge proof systems. It allows for the execution of smart contracts with increased scalability (and sometimes privacy) by leveraging cryptography to prove the correctness of transactions.



Welcome to Kakarot zkEVM useful links

Our Website: https://kakarot.org/
Our Twitter: https://twitter.com/kakarotzkevm
Our Medium Blog: https://medium.com/kakarot-zkevm
Our Github: https://github.com/kkrt-labs/kakarot
Our Linktree: https://linktr.ee/kakarotzkevm