⚠️ 🚧 TODO / WIP

Table of Contents

Introduction

This article gathers information on Sierra, Cairo’s safe intermediate representation, summarizing online posts, documentation, and

Cairo 1.0

Source: Starkware Blog - Cairo 1.0

Cairo 1.0 will give developers a safer, simpler, more usable programming language.

At the heart of Cairo 1.0 will be Sierra, an intermediary representation layer that promises greater long term stability for Cairo programs.

Sierra advances Cairo to serve in a permissionless network:

While Cairo made STARKs accessible, it was originally designed as an assembly language, and as such it was written as a low level language. Cairo was gradually made more expressive and more developer-friendly.

Introducing Sierra: ensuring every Cairo run can be proven

The main addition in Cairo 1.0 is Sierra (Safe Intermediate Representation). Sierra constitutes a new intermediate representation layer between Cairo 1.0 and Cairo byte code. Sierra’s goal is to ensure that every Cairo run — i.e. a Cairo program and its input — can be proven.

Sierra promises Cairo devs better future-proof code. Further stability is provided by the fact that StarkNet contracts won’t need recompiling in the case of improvements to the underlying system (e.g., CPU AIR architecture changes, improvements of the final translation from Sierra to Cairo byte code).

Proving every Cairo run.

In old Cairo, a Cairo run can result in three cases — TRUE, FALSE, or failure. Failed runs can’t be proven. Sierra, ensures that a Cairo run will never fail, and can only result in TRUE or FALSE. This in turn, ensures that every Cairo run can be proven.

This introduction of Sierra has important implications for StarkNet as a permissionless network. Sierra ensures that even reverted transactions can be included in StarkNet blocks. This property will allow the StarkNet protocol to remain lean and simple without the need to add complex crypto-economic mechanisms.

Reading Sierra: Starknet's secret sauce for Cairo 1.0