Is Starkware's Lack of EVM Compatibility and Cairo Programming Language Its Achilles Heel?

By Michael @ CryptoEQ | CryptoEQ | 2 Feb 2023


You are reading an excerpt from our free but shortened abridged report! While still packed with incredible research and data, for just $20/month you can upgrade to our FULL library of 50+ reports (including this one) and complete industry-leading analysis on the top crypto assets. 

f335db6f2e4517432f34c0844de36a5d54528d4db563ba6c0ba03f49c1a7e6a0.png

Becoming a Premium member means enjoying all the perks of a Basic membership PLUS:

  • Full-length CORE Reports: More technical, in-depth research, actionable insights, and potential market alpha for serious crypto users
  • Early access to future CORE ratings: Being early is sometimes just as important as being right!
  • Premium Member CORE+ Reports: Coverage on the top issues pertaining to crypto users like bridge security, layer two solutions, DeFi plays, and more 
  • CORE report Audio playback: Don’t want to read? No problem! Listen on the go.

f932d746a0dfa682c3e07545c502806fc31250b2b521cb814543b1f474ecdc78.png

Starkware is a ZK-rollup company that pioneered zero-knowledge-based rollups in 2018, launched StarkEx in 2020, and recently released StarkNet in November 2021. StarkEx is a ZK-rollup with less functionality than its StarkNet successor. StarkEx supports the ability for smart contracts to run any arbitrary logic for specific use cases, such as trading and NFTs, while StarkNet enables more general use cases. 

Since its creation in 2018, Starkware has raised $110+ million across three equity rounds and received a $12 million grant from the Ethereum Foundation. Not only is the project backed by heaps of money, but prominent crypto and financial figures, including Pantera Capital, Sequoia, Founders Fund, DCVC, Paradigm, ConsenSys, Multicoin, Polychain, Vitalik Buterin, Naval Ravikant, and others, have also invested in Starkware.

StarkEx is the first iteration “scalability engine” from Starkware that now supports two versions: ZK-Rollup mode and Validium mode (discussed below). Validiums can be custom-tailored to offer superior performance for specific dApps and use cases, such as DeversiFi, ImmutableX, and Sorare.

StarkNet is Starkware’s next iteration of a ZK-rollup and the first ZK-rollup to feature general smart contracts on a fully composable network in a permissionless manner. Composability refers to the ability for applications to coordinate, build on top of one another, and interconnect—something for which StarkEx isn’t designed. 

 

Cairo

StarkNet stands out from the numerous other zero-knowledge rollups (ZKR) projects in the space because, despite being a layer 2 project on Ethereum, it has shirked the EVM for its own development environment. This sets StarkWare apart from other ZKRs and indicates that it does not see ZKEVM as the ultimate goal. The company believes that in order to achieve high scalability, it is necessary to create languages and virtual machines that are specifically optimized for ZKRs rather than focusing on compatibility with the EVM. Additionally, they anticipate that the significance and influence of the EVM will decline in the future as more and more decentralized applications will be run on layer 2 solutions.

StarkNet and StarkEX don’t use Solidity, the preferred Ethereum smart contracting language, because it isn’t the best language to compile to STARKs. This is because Solidity can't be efficiently encoded to STARKs and is costly in comparison. Instead, StarkNet uses a new programming language developed by the team at Starkware called ‘Cairo.’ It’s a language for programming STARKs that achieves Turing-completeness with STARKs. A breakthrough of the Cairo language is it lets just one verifier use a single proof to confirm the integrity of many different program executions. This amortizes costs across separate dApps, e.g., a single proof that includes both dYdX trades and SoRare transactions.

Initially, Cairo was designed as an assembly language and was written as a low-level language. This makes it harder to code in Cairo. After various feedback from developers, the Starkware team made Cairo more developer-friendly and continuously improved it.

Cairo is a programming language that is specifically designed to support STARK programs while also providing general computation capabilities. Programs written in Cairo can be verified using the Cairo language itself, and the composability between Cairo-based or StarkNet-based decentralized applications is exceptional. The execution of a Cairo program also produces a proof that can then be sent to a prover. This generates a STARK proof of the validity of the instruction or calculation represented by the Cairo program. 

The Cairo language has a similar structure to WebAssembly (Wasm), making it easily accessible for developers who are familiar with Wasm. Additionally, Cairo offers a user-friendly development environment that includes an Integrated Development Environment (IDE) where developers can access a native compiler that converts Cairo code into bytecodes, Cairo-exclusive Virtual Machines, and debuggers all within a single program. Furthermore, Cairo eliminates the need for building new verifier contracts for each decentralized application, as it uses a general-purpose verifier contract.

Therefore, Cairo ameliorates Ethereum’s expensive computation, transmission, and storage fees. To link the Cairo code to the smart contract, a Shared Prover (SHARP) is used. This involves a prover off-chain, a smart contract verifier on-chain, and a fact-logger contract on-chain. The prover proves the code is valid and sends this proof to the verifier, which then sends an attestation of the proof’s validity in the fact register. This fact functions as a seal of approval without trust, certifying the validity of the Cairo program. Now, dApp’s smart contract just needs to verify this fact exists and then it can rely on the computation that performed off-chain.

However, StarkWare acknowledges the importance of the EVM developer ecosystem and is working on providing a service called Warp, a transpiler that will seamlessly convert solidity smart contracts into Cairo to make Starkware EVM-compatible. WARP is the first automated Solidity compiler that allows programs written in Solidity to be deployed on StarkNet. It also provides a smoother transition for companies moving from ETH L1 to StarkNet L2. Finally, as of November 2022, Cairo 1.0 has been open-sourced, allowing anyone to review the code.

 

StarkNet

StarkNet uses Zero-Knowledge Proofs to achieve fast transaction times and hyper-scaling without compromising security. An alpha version of StarkNet was launched in November 2021 with limited capabilities to allow developers to begin building on top of the protocol. It fully launched in February of 2022 and is now fully functional for transactions and for building applications. StarkNet is designed so that it benefits from economies of scale, i.e., the greater the number of transactions in a batch, the less gas each participant in the batch must pay. 

As we know, ZK-rollups enable provable computation, i.e., it allows programs to prove they’ve been executed by providing SNARK or STARK proofs without having to re-run/re-execute the transactions. This leads to tremendous scalability improvements. StarkNet is designed to benefit from economies of scale, i.e., the greater the number of transactions in a batch, the less gas each participant in the batch pays.

StarkNet transactions sent by users are batched and delivered to the STARK prover. This STARK prover has the accurate ledger state prior to and following the processing of these new transactions. The prover generates a STARK proof attesting to the veracity of the new state of the ledger. The new state and STARK proof are relayed to the STARK verifier on Ethereum mainnet where the proof is verified autonomously by a smart contract.

zk comparisons

Source

The Starknet L2 node (sequencer) will execute every transaction and periodically update the state to the Ethereum mainnet. StarkNet transaction finality is tied to L1, meaning the L2 node must simultaneously validate StarkNet and Ethereum. StarkNet introduces a solution involving checkpoints to the Ethereum mainnet, enabling it to quickly achieve finality on the rollup side. Therefore, all L2 nodes incorporate an L1 full node. 

STARKs improves scalability and privacy since developers can move computations and storage off-chain. Off-chain services can generate STARK proofs, attesting to the integrity of off-chain computations. These proofs are then returned to the chain for any interested party to validate the computation. Moving the bulk of the off-chain computations using STARK allows the blockchain infrastructure to scale exponentially while maintaining the integrity of the computations.

Additionally, since the state transitions are "STARK-approved" by the sequencer, it's mathematically/cryptographically impossible for fraudulent transactions to be accepted on mainnet Ethereum. This removes the need for any "challenge" period that exists in ORs. All data needed to reconstruct the full StarkNet state is published on-chain.

However, Starkware is in control of the sequencer, and all of the transactions are verified by Starkware cloud servers. However, Starkware aims to create a decentralized sequencer set in the future. It's not a fully permissionless system. For example, to deploy a smart contract on StarkNet, you must fill out a form and send it to the Starkware team.

How do you rate this article?

68


Michael @ CryptoEQ
Michael @ CryptoEQ

I am a Co-Founder and Lead Analyst at CryptoEQ. Gain the market insights you need to grow your cryptocurrency portfolio. Our team's supportive and interactive approach helps you refine your crypto investing and trading strategies.


CryptoEQ
CryptoEQ

Gain the market insights you need to grow your cryptocurrency portfolio. Our team's supportive and interactive approach helps you refine your crypto investing and trading strategies.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.