Starknet: The Future of Decentralized Scaling

Jérémy Martin
July 26, 2023
Blockchain

Introduction to Starknet: The Future of Decentralized Scaling

Web3 is on the rise, offering a decentralized vision of the internet through blockchain technology. Among the computer protocols based on this technology, Ethereum stands out as the most acclaimed blockchain, largely due to its user-friendliness. It enables the execution of open programs known as smart contracts, accessible to anyone by sending a computer transaction and paying with Ether, the system's currency.

Over the years, Ethereum has experienced exponential growth, attracting developers, entrepreneurs, and users from around the world. However, its popularity has shed light on the scalability challenge, with issues of scalability and high transaction costs. As the network expands, it can become congested, resulting in dramatically high transaction fees and longer validation times. In practice, this significantly hinders its usability.

To address this well-known trilemma, numerous scaling solutions have emerged to alleviate network congestion, but these often sacrifice security, are sluggish, or tend to be centralized. In this context, Starknet, a solution from StarkWare, founded in 2018, has emerged as a promising solution. The principle is to execute fast and cost-effective transactions on the Starknet network while using Ethereum to store the minimum amount of information.

Overview of the stablecoin trilemma

In this article, we will explore Starknet's proposed solution, its foundational technological propositions, and its architecture.

1- The Starknet Solution

Starknet employs rollup technology. A rollup allows for anchoring a value that can prove the existence of a large quantity of other values using computer techniques based on graph theory. Starknet operates in parallel with Ethereum, generating a vast amount of data. All this data is compressed through the rollup, and a certain amount of data is anchored on Ethereum, providing proof that things have been executed. In this case, Starknet is referred to as a side-chain, and Ethereum as a commit-chain.

This proof technique is quite common, and Starknet is not the only blockchain employing it. All these blockchains running in parallel are referred to as layer-2.

As a result, the computations related to a transaction do not need to be executed on the network nodes because proof of their execution will suffice. The advantage is that verifying this proof takes much less time and resources than executing the code itself.

It is worth noting that although Starknet relies on Ethereum in its operation, it could also use another blockchain to anchor its execution proofs. However, relying on Ethereum benefits its ecosystem and its smart contracts. Data transfer goes both ways.

Starknet also adds another property to these proofs, the Zero-Knowledge Proof (ZKP). Due to their scalable and transparent nature, STARKs are often considered a promising solution for decentralized verification and data privacy in blockchain-based systems.

2- ZKP: Leading Layer-2

ZKP uses a technology called zk-SNARKs, which stands for "Succinct Non-Interactive Arguments of Knowledge." It is a cryptographic protocol system that allows proving knowledge of information without revealing the information itself. This is interesting because the prover can demonstrate the validity of a statement:

  • By providing much less data than the initial statement.
  • Without disclosing sensitive details of that statement.

Zk-SNARKs were introduced in 2012 by cryptography researchers, including Eli Ben-Sasson, Alessandro Chiesa, and others. The idea behind ZKPs is that the program is asked to solve challenges, to which it can respond only if the statement is true. For example, it's like someone wanting to prove they've learned a foreign language without needing to translate all the words. They could simply prove they've randomly and unbiasedly drawn a hundred words from the dictionary and provide the corresponding translations. This technique can be used in a non-interactive manner. Zk-SNARKs have gained increasing popularity since their use in the Zcash blockchain, launched in 2016.

Starknet uses an enhancement of zk-SNARKs called zk-STARKs, which stands for "Scalable Transparent Argument of Knowledge" in English. STARKs are designed to be used for large-scale problems very efficiently. STARKs enable transparent and deterministic verification of proofs, meaning that the verifier can confirm the accuracy of the proof without performing additional calculations. Although STARKs are more complex to generate, when the complexity of a statement increases by a certain value, the STARK proof only increases logarithmically in that value. Unfortunately, traditional SNARKs require a "trusted setup," which is quite laborious to establish during their creation. This means that a group of participants must generate specific parameters at initialization, or else the proofs can be falsified.

3- The Structure of the Starknet Blockchain

Proof generation converts a transaction (a call to a contract's function) into a verifiable STARK proof. This cryptographic proof demonstrates the validity of the operation performed by the client. Starknet transactions are aggregated into Ethereum in six phases:

  1. A user sends a transaction request from their user account to the sequencer on the Starknet network. The sequencer is responsible for the initial recording of the transaction.
  2. The sequencer then transfers the transaction to the prover on Starknet. The prover is responsible for verifying the transaction's validity using specific methods.
  3. After verifying the transaction, the prover forwards it to the full node on Starknet. The full node is a part of the network that stores all information in a decentralized manner and is responsible for validating and propagating the transaction.
  4. At this stage, the prover sends the verified transaction to the verifier contract on the Ethereum blockchain. The verifier contract is a specific component that performs additional checks to ensure the transaction's validity.
  5. The verifier contract then transfers the transaction to the anchoring contract on Ethereum. The anchoring contract is used to maintain synchronization between the Starknet network and the main Ethereum blockchain.
  6. Finally, the sequencer sends a copy of the transaction to the anchoring contract on Ethereum to ensure global coordination and compliance among the various parties involved.
Illustration of the structure of Starknet Blockchain : A user sends a transaction request from their user account to the sequencer on the Starknet network. The sequencer is responsible for the initial recording of the transaction.The sequencer then transfers the transaction to the prover on Starknet. The prover is responsible for verifying the transaction's validity using specific methods.After verifying the transaction, the prover forwards it to the full node on Starknet. The full node is a part of the network that stores all information in a decentralized manner and is responsible for validating and propagating the transaction.At this stage, the prover sends the verified transaction to the verifier contract on the Ethereum blockchain. The verifier contract is a specific component that performs additional checks to ensure the transaction's validity.The verifier contract then transfers the transaction to the anchoring contract on Ethereum. The anchoring contract is used to maintain synchronization between the Starknet network and the main Ethereum blockchain.Finally, the sequencer sends a copy of the transaction to the anchoring contract on Ethereum to ensure global coordination and compliance among the various parties involved.

However, this architecture does impose a time delay on transaction validation (from seconds to several minutes). There are already solutions in place to optimize this setup, but it takes time for development teams to study and implement them.

4- The Advantages of Starknet

Beyond its architecture, Starknet has other structural advantages.

1- The Cairo Language

Starknet utilizes the Cairo programming language. It is designed to be a low-level language optimized for ZKP proofs, providing it with high efficiency and performance. It can execute complex computations quickly and effectively, making it an attractive choice for applications requiring optimal performance. Cairo is a portable language, meaning it can be used on various platforms and architectures. It is hardware-agnostic, making it easy to deploy Cairo code across different environments.

Cairo can also be used independently of the Starknet blockchain. Programs written in Cairo can be rigorously verified and proven to ensure their correct operation. This offers a high level of confidence in reliability and security. Cairo is a versatile language that can be used to develop a wide range of applications, including smart contracts, cryptographic protocols, data processing systems, and more. Its modular design and flexible architecture allow developers to express complex functionality clearly and concisely. Additionally, Cairo can be integrated with other programming languages, allowing developers to leverage the specific advantages of each language.

2- Smart Contract Declaration

On Starknet, smart contracts are declared as a computer library called a class before being used. The functions, variables, and business logic of the contract are specified in this class.

The instantiation of the class corresponds to the deployment of the contract on Starknet. During this deployment process, it may be necessary to provide certain customized input parameters to the contract's constructor. The constructor, the function called during the contract's deployment, allows for the initialization of values or the execution of any required actions.

3- Account Abstraction

Starknet introduces native account abstraction, meaning that user accounts themselves are instances of smart contracts. This enables the implementation of new access management or rights management features for accounts, which sometimes hold cryptocurrencies or specific access to other high-value smart contracts. Here are a few examples:

  • Managing multi-user access or private key recovery features.
  • Determining what constitutes the validity of a signature or the contracts your account is allowed to interact with, known as "signature abstraction."
  • Paying transaction fees in different tokens, often referred to as "fee abstraction."
  • Designing your own replay protection mechanism and allowing the sending of multiple unrelated transactions in parallel.

Other features are, of course, implementable, and new standards are proposed by ecosystem participants.

4- Focused on Resource-Intensive Systems

Starknet is designed to be oriented towards fast and resource-intensive systems, such as video games and other applications that require rapid and efficient transaction execution. Starknet's primary goal is to provide a solution that can process a large number of transactions at high speed while maintaining affordable transaction costs.

Thanks to the use of succinct proofs and its optimized architecture, Starknet offers high performance and remarkable scalability. This means it can handle significant workloads and execute complex calculations quickly, providing a smooth and responsive experience for users.

For video games, for instance, Starknet offers an attractive solution by enabling fast execution of transactions related to movements, player interactions, virtual item purchases, and in-game rewards, among other things. Many programming frameworks specifically tailored to these use cases are currently in development.

In addition to video games, Starknet can also benefit other demanding systems, including decentralized finance applications, NFT markets, decentralized exchanges, and other applications that require fast execution.

In summary, Starknet's objective is to provide an efficient and effective solution to the scalability challenge faced by blockchain technology. Starknet revolutionizes Web3 by enabling highly efficient transaction execution without compromising network security or decentralization. Currently, the sequencer is centralized but will be decentralized in the near future. ZK-STARKs ensure the integrity of calculations and state transitions while providing tamper-proof evidence of their proper execution.

The existing rollup architecture offers an opportunity to increase throughput and reduce costs compared to Ethereum, ultimately enabling further use cases, particularly in the realm of video games.

For more information on Starknet applications under construction or already deployed, please visit Starknet.

Written by
Jérémy Martin
Research Director