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

  • BTC Falls Below $77,000

    Market data shows that BTC has fallen below $77,000, currently priced at $76,999.01, with a 24-hour decline of 2.21%. The market is experiencing significant volatility, so please ensure proper risk management.

  • BTC Falls Below $77,000

    Market data shows that BTC has fallen below $77,000, currently priced at $76,996, with a 24-hour decline of 1.93%. The market is experiencing significant volatility, so please ensure proper risk management.

  • BTC Falls Below $77,000

    Market data shows that BTC has fallen below $77,000, currently priced at $76,996, with a 24-hour decline of 1.93%. The market is experiencing significant volatility, so please ensure proper risk management.

  • President Trump Claims U.S. Profiting from Tariffs

    According to market news: President Trump stated that the United States is profiting from tariffs.

  • President Trump Claims the U.S. is Profiting from Tariffs

    According to market news: President Trump stated that the United States is profiting from tariffs.

  • Iran's Deputy Defense Minister: New Systems Deployed on the Battlefield Even Under War Conditions

    The Deputy Minister of Defense of Iran stated that despite facing difficulties and sanctions, Iran's defense industry has successfully strengthened and enhanced the deterrent capability of its armed forces. Although the enemy claims to have destroyed these capabilities in recent conflicts, Iran has maintained the production lines for the necessary equipment and weapons for its armed forces through careful planning and foresight. Furthermore, new offensive and defensive systems have been successfully deployed on the battlefield under war conditions, and this process continues to advance vigorously. Iran will never succumb to pressure, and this resistance has already broken the strategic deadlock, leaving the Trump administration perplexed.

  • Iran's Deputy Defense Minister: New Systems Deployed on the Battlefield Even Under War Conditions

    The Deputy Minister of Defense of Iran stated that despite facing difficulties and sanctions, Iran's defense industry has successfully strengthened the 'long arm' of its armed forces, making it more powerful and deterrent. Although the enemy claims to have destroyed it in recent conflicts, Iran has maintained the production lines for the necessary equipment and weapons for its armed forces through careful planning and foresight. Furthermore, new offensive and defensive systems have been successfully deployed on the battlefield under war conditions, and this process continues to advance strongly. Iran will never yield to pressure, and this resistance has broken the strategic deadlock, leaving the Trump administration perplexed.

  • Iraq Confirms Some Tankers Granted Passage Through the Strait of Hormuz

    On August 22, Al Arabiya reported that the President of Iraq stated: "We discussed the issue of reassessing Baghdad's relationship with Tehran with Iranian Parliament Speaker Ghalibaf. Currently, some vessels carrying Iraqi oil have indeed been granted permission to pass through the Strait of Hormuz. Given the current situation, I believe the United States wishes to reach an agreement to end the war with Iran. It must be said that we are the country most affected by the war, and the government is doing its utmost to avoid getting involved." (Jinshi)

  • Iraq Confirms Some Tankers Granted Passage Through Strait of Hormuz

    On August 22, Al Arabiya reported that the President of Iraq stated: "We discussed the issue of reevaluating the relationship between Baghdad and Tehran with Iranian Parliament Speaker Qalibaf. Currently, some vessels carrying Iraqi oil have indeed been granted permission to pass through the Strait of Hormuz. Given the current situation, I believe the United States hopes to reach an agreement to end the war with Iran. It must be said that we are the country most affected by the war, and the government is doing everything possible to avoid being drawn into it." (Jinshi)

  • Total Open Interest in ETH Contracts Exceeds $30 Billion

    According to data from Coinglass, the total open interest in ETH contracts across the network has increased by 7.46% in the past 24 hours, reaching a current total of $33.304 billion. Among these, Binance holds $8.76 billion, CME has $3.27 billion, Bybit accounts for $2.21 billion, and OKX holds $1.67 billion.