Starkware: Building Zero-Knowledge Scaling Solution

Bringing scalability, security, and privacy to Ethereum.

hitesh mahajan
Coinmonks
Published in
6 min readJul 3, 2022

--

Overview

Starkware is a zero-knowledge company focusing on building zero-knowledge based rollup solutions for scaling Ethereum. Starkex, their first product, was launched in 2020 and released Starknet with more functionality in November 2021.

Starkex is a standalone Zk-rollup SaaS product providing specific use cases through smart contracts for certain applications like trading (DyDx), NFTs (Immutable, Sorare), and Defi (DiversiFi). Starkent is the next iteration of zk-rollup — a permissionless, decentralized, and fully composable network, unlike Starknet. Composability refers to the ability of an application to interconnect, coordinate and build on top of each other.

Starkware

Technology

Starkware has built a new technology that compresses thousands of transactions into a single validity proof called STARK (Scalable Transparent Argument of Knowledge) that is submitted to Ethereum L1. STARK has primarily two main advantages over SNARKs (Used in ZK-Rollups by ZkSync, Hermez, etc.):

1) It doesn’t require an initial trusted setup.

2) Faster computation times than SNARKs. Since less computation is required, it can improve the scalability of Ethereum by orders of magnitude

STARK Vs SNARK

Architecture

The Starkware stack consists of key features mainly Shared Prover (SHARP) and Verifier (Existing on L1). SHARP bundles multiple transactions from different Dapps and generates a single proof. It then shares the proof with the verifier on L1. This saves costs as computation is shared among different applications. The verifier checks whether SHARP proofs are valid. If so, then they are shared in the Fact Registry. The application can either interface with Starkex or directly with SHARP (Starknet applications)

Starkware: Architecture

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

New to trading? Try crypto trading bots or copy trading

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

Data Availability

Starknet uses Validium mechanism for Data Availability. It is nearly identical to ZK-rollup just that it keeps data off-chain while ZK-roll up and Optimism Rollup (OR’s) keep it on-chain. Validium posts only validity proofs on L1 while keeping the data off the chain. This enables Validium to achieve considerably higher throughput and also reduces the cost of each transaction.

The trade-off for storing data off-chain is that it requires trust in the third party which could prevent users from accessing their balances. Starkware aims to solve this with a Data Availability Committee (DAC), a committee of 8 independent members that have their copy of the transactions made. They are also required to maintain this data by making it available at all times. If an operator prevents a user from accessing their funds, a committee member can override them to confirm their request if it is valid.

Starkware is also planning to implement a Volition mechanism in which users can select whether the data needs to be sent on-chain or not. It moves the decision for data availability from the application level to the user level even for a single transaction. If users want to send a high-value NFT on-chain with all data, they can pay an extra cost to move it on-chain. This will be implemented with Immutable and Sorare.

Data Availability

Cairo Programming Language

With new technology comes new requirement. Cairo is a Turing-complete programing language built especially for STARK. It is better for performance and scalability but is very new. Lots of developers are not familiar with it and it makes it difficult for existing applications to move to Starkent. Warp, developer by Nethermind is an EVM to Cairo transpiler. Warp allows Solidity contracts to be converted to Cairo seamlessly.

A breakthrough of the Cairo language is that it enables just one verifier to use a single proof to confirm the integrity of many different program executions. This has the effect of distributing costs across separate dApps.

Starknet Vs OR’s

Starkent has not only a faster withdrawal window as compared to 7-day windows for OR’s but underlying architectural differences. Starknet uses “stateless” in which you just store state root of the whole state on L1 and users will need to supply Merkle proofs to access specific state items. OR’s follow a “stateful” solution in which every state item is recorded on-chain. This results in much larger state bloat and may prove to not scale well in the future with adoption.

From a sole scalability perspective, ZK-Rollups are more performant than OR’s because they compress data more efficiently meaning they have a smaller “batch size” when submitting to L1. OR’s posts data to the Ethereum L1 for every transaction, Starkex implementations, like dYdX, only post to Ethereum L1 to reflect every account balance. Because of this approach, dYdX’s interacts with L1 only ~20% as much as Optimism, equating to roughly 90% reduction in fees.

Ecosystem

The starkware ecosystem is growing. With permissionless deployment on Starknet, many developers have shown interest. Starkex with its open ecosystem and extensive documentation has made it easy for developers to implement. Defi Pooling is possible on Starknet. It allows users to exist on L2, while DeFI remains on L1 where it was born and a lot of exciting stuff is being built. It brings a single L1 transaction representing a large set of buyers from L2 and comes back to L2 with proceeds for distribution. Lots of Gaming and NFT projects have launched on Starkent.

Starkware Ecosystem

Starknet will follow a similar path to that of Optimism (OR): Launch the network with a single sequencer and a limited whitelist of dApps early on to control the launch and limit any risks. Ultimately, Starkware hopes to grow the ecosystem into a Starknet “Universe” while also decentralizing the network, nodes, and infrastructure. Multiple L3s will ride on top of an L2. Moreover, additional layers (L4, etc.) may be built upon L3 for fractal layering solutions.

Layered Ecosystem

Conclusion

Starknet seems to have solved the blockchain trilemma: Scalability, Decentralised and Secure; all three at once. It has shown a promising future for scaling Ethereum using Zk-rollups. Ethereum has already embraced a rollup-centric future with users transacting on L2 and L1 acts as a settlement layer. EIP-4488 will further drive down transaction costs for rollups. Starknet with lots of backing seems to be a strong L2 future contender but in its current state, it is centralized with starkware as the only prover. With Cairo as a new and less popular language among developers, it needs to be seen how much talent pool Starkware can attract. With Valadium, you have to trust the L2 for Data Availability. Despite these challenges, Starkware has shown how STARKS can be used to provide an effective solution to scale Ethereum. This is definitely a project worth looking for.

Resources

https://docs.starkware.co/starkex-v4/

https://medium.com/starkware/fractal-scaling-from-l2-to-l3-7fe238ecfb4f

https://mirror.xyz/0x3D5FE39342e661776bb5273521F52E99B624288c/NFOsWYCb2eVk612VSnrrCsoKcwI_EMObp_q9uNKa4uA

https://docs.starknet.io/docs/Intro

--

--