Cointime

Download App
iOS & Android

Why Cairo 1.0 ?

Validated Project

Source: https://hackmd.io/@abdelhamid/stark-at-home-why-cairo-1

In a recent Stark @ Home Episode named Why Cairo 1.0 ?, the creators of Cairo programming language came together to discuss their vision for the future of Layer 2 scaling solutions. The episode featured a thorough conversation between:

  • Vitalik Buterin, the co-founder of Ethereum
  • Eli Ben-Sasson, ZK-STARK Co-Inventor and Co-Founder of StarkWare
  • Lior Goldberg, StarkWare engineer and co creator of Cairo
  • Shahar Papini, StarkWare engineer co creator of Cairo
  • Ori Ziv, StarkWare co creator of Sierra

Throughout the discussion, the panelists covered various aspects of StarkNet, Cairo, Sierra, and the ongoing improvements and optimizations of these technologies.

5 quotes from the Stark @ Home Episode - Why Cairo 1.0?

- Vitalik: "Level one is Cairo assembly, the base language that gets proven. Sierra adds safety and Cairo 1.0 adds Expressivity."

- Eli: "Making the proof ZK is relatively easy. Designing for a general purpose computation that is meaningful and composable is much harder."

- Lior: "With Cairo, you don't need to be a ZK expert to start writing programs."

- Shahar: "Sierra is an intermediate representation that allows us to make sure that the Cairo programs are consistently provable, addressing issues like reverted transactions, unsatisfiable AIRs, and DOS attacks."

- Ori: "Typed Starknet adds type safety, enabling better resource management & efficiency."

This post summarizes the main points of the webinar.

StarkNet: A Layer 2 Scaling Solution

StarkNet is a Layer 2 scaling solution designed to improve transaction throughput on Ethereum. The platform employs zk-STARKS, an advanced zero-knowledge proof technology, to enhance scalability and maintain strong security guarantees. The webinar offered a detailed introduction to Cairo and Sierra, two programming languages specifically developed for StarkNet.

Cairo: A High-Level Language for StarkNet

Cairo is a high-level programming language designed to make it easier for developers to write contracts and applications for StarkNet. It features a memory model and syntax that closely resemble conventional programming languages. During the webinar, the panelists discussed ongoing improvements and optimizations to Cairo, including:

  • Enhancements to the language for convenience and usability
  • Efforts to improve the efficiency of compiling Cairo to Sierra

Sierra: An intermediate representation bringing Safety

Sierra is designed to enhance the safety of the language, allowing the construction of Cairo programs that are consistently provable.

The addition of an extra layer between user-written Cairo 1.0 code and the proven Casm code is necessary due to the limitations of Cairo and the need to address issues like reverted transactions, unsatisfiable AIRs, and DOS attacks. Sequencers in L2 systems must be compensated for their work, even if a transaction fails. If they can’t charge for such transactions, it becomes an obvious DOS attack.

A possible solution is to include these transactions in a block, like Ethereum. However, this is difficult in a validity rollup with Cairo 0, as there’s no separation between user code and proven code, allowing users to write unprovable code. Sierra, the added layer, ensures all transactions are eventually provable, addressing these concerns.

Some of the future plans for Sierra include:

  • Adding library functions or extensions to improve functionality
  • Developing a Sierra-to-Casm compiler written in Sierra itself

Performance Improvements and Scaling

The panelists discussed various strategies for enhancing transaction processing speed and scaling StarkNet. These included:

  • Improving the performance of the sequencers
  • Implementing a fee market, similar to Ethereum
  • Exploring parallelization of transactions

In addition to these strategies, the speakers mentioned plans to transition from a Python-based implementation to a Rust-based implementation for better performance.

Future Directions for StarkNet

Some exciting future directions for StarkNet include:

Typed StarkNet

Typed StarkNet would involve adding type safety to contracts and state within the StarkNet ecosystem. This would enable better resource management and more efficient transaction processing.

Extensibility of Cairo and Sierra

The panelists emphasized that Cairo and Sierra’s extensible design offers the potential for adaptation and expansion into non-blockchain ecosystems. Sierra provides increased flexibility for future enhancements, such as employing a small field to accelerate arithmetic operations.

Q&A Highlights

The webinar concluded with a Q&A session, during which the panelists answered several interesting questions from the audience. Some of the main topics covered included:

  • The reasons behind the development of Cairo and Sierra as new languages
  • The potential for Cairo to be used as a standalone language, independent of StarkNet
  • The possibility of implementing “unsafe Cairo” with added hints for optimization
  • The prospect of employing Cairo on Ethereum L1 in the future

Conclusion

The episode offered a fascinating glimpse into the world of StarkNet and Cairo programming language. As the panelists continue to refine and optimize these technologies, developers can look forward to new features, improvements, and opportunities for innovation.

For those interested in learning more about Cairo, Sierra, and StarkNet, the panelists recommended exploring resources such as starklings, an interactive tutorial based on Rustlings. By exploring these tools and tutorials, developers can gain a deeper understanding of the potential of StarkNet and its associated technologies.

Call out StarkNet Beta Testers!

Reddio is building developer tools for StarkNet to help you accelerate the process to develop StarkNet applications. We are inviting all of StarkNet developers to join our beta testing group, try out brand-new features and tell us what you think.

https://share.hsforms.com/1E88oQkqMSJifUV1CqR_WrQd30xn

Comments

All Comments

Recommended for you

  • U.S. Congressman Mike Flood: Looking forward to working with the next SEC Chairman to revoke the anti-crypto banking policy SAB 121

     US House of Representatives will investigate Representative Mike Flood's recent statement: "Despite widespread opposition, SAB 121 is still operating as a regulation, even though it has never gone through the normal Administrative Procedure Act process." Flood said, "I look forward to working with the next SEC chairman to revoke SAB 121. Whether Chairman Gary Gensler resigns on his own or President Trump fulfills his promise to dismiss Gensler, the new government has an excellent opportunity to usher in a new era after Gensler's departure." He added, "It's not surprising that Gensler opposed the digital asset regulatory framework passed by the House on a bipartisan basis earlier this year. 71 Democrats and House Republicans passed this common-sense framework together. Although the Democratic-led Senate rejected it, it represented a breakthrough moment for cryptocurrency and may provide information for the work of the unified Republican government when the next Congress begins in January next year."

  • Indian billionaire Adani summoned by US SEC to explain position on bribery case

    Indian billionaire Gautam Adani and his nephew, Sahil Adani, have been subpoenaed by the US Securities and Exchange Commission (SEC) to explain allegations of paying over $250 million in bribes to win solar power contracts. According to the Press Trust of India (PTI), the subpoena has been delivered to the Adani family's residence in Ahmedabad, a city in western India, and they have been given 21 days to respond. The notice, issued on November 21 by the Eastern District Court of New York, states that if the Adani family fails to respond on time, a default judgment will be made against them.

  • U.S. Congressman: SEC Commissioner Hester Peirce may become the new acting chairman of the SEC

    US Congressman French Hill revealed at the North American Blockchain Summit (NABS) that Republican SEC Commissioner Hester Peirce is "likely" to become the new acting chair of the US Securities and Exchange Commission (SEC). He noted that current chair Gary Gensler will step down on January 20, 2025, and the Republican Party will take over the SEC, with Peirce expected to succeed him.

  • Tether spokesperson: The relationship with Cantor is purely business, and the claim that Lutnick influenced regulatory actions is pure nonsense

     a spokesperson for Tether stated: "The relationship between Tether and Cantor Fitzgerald is purely a business relationship based on managing reserves. Claims that Howard Lutnick's joining the transition team in some way implies an influence on regulatory actions are baseless."

  • Are we finally ready for a gas limit increase?

    There has been growing discussion around the possibility of increasing Ethereum’s gas throughput, either by raising the gas limit or reducing slot time. The key argument in favor of this is that the hardware requirements for running a validator have steadily decreased over the past four years.

  • Cointime August 17th News Express

    1.VanEck and 21Shares Solana ETF Form 19b-4 Suspected to be Removed from CBOE Website

  • Ethereum network gas fee falls back below 1 gwei

    According to Etherscan data, the current Ethereum network gas fee has fallen below 1 gwei, currently at 0.937 gwei.

  • Cointime August 10th News Express

    1. The U.S. Internal Revenue Service has released a new draft of the crypto tax form, which no longer requires filling in wallet addresses and transaction IDs

  • Ethereum ACDC #139: Pectra's Devnet 2 upgrade is under debugging, and the release date of Devnet 3 is still to be determined

    Christine Kim, Vice President of Galaxy Research, summarized the main content of the 139th ACDC conference call. The debugging of Pectra's upgraded Devnet 2 is currently underway, and the release date of Devnet 3 is yet to be determined. Developers will hold weekly testing update meetings starting from Monday to better coordinate the release of Pectra's Devnet. The decision to include EIP-7688 in Pectra's upgrade has been postponed again.

  • Ethereum network gas fee drops to 1 gwei

    According to Ether­scan data, the current gas fee on the Ethereum network has dropped to 1 gwei.