Skip to content

Cairo

Cairo is a language for programs whose execution can be verified using STARK proofs. It is the smart contract language of Starknet and can also support verifiable computation outside that network. Its programming model, compilation pipeline and resource costs differ from Solidity on the EVM.

Written by Isaac GonzálezUpdated October 11, 2026

Key takeaways

  • Cairo supports programs whose execution can be verified through STARK proofs.
  • It is Starknet’s contract language, with tooling distinct from Solidity.
  • An execution proof does not replace a review of the contract’s rules.

What is Cairo?

Cairo expresses a computation whose execution can be supported by cryptographic evidence. On Starknet, developers use it to define contracts, store state and process operations included in the network’s proving system. The application program and the infrastructure that produces the proof perform different jobs.

For a business, that separation makes it possible to assess which participants must perform a calculation and which only need to verify its result. Verifiable computation can be useful beyond financial contracts. Feasibility also depends on proving costs, data handling and integration with the system that consumes the result.

Cairo does not automatically make an application private. A proof of correct execution does not hide transaction data that the application publishes. Confidentiality requirements need their own design and verification, alongside the execution model.

How it works

For Starknet contracts, Cairo source is compiled through Sierra, an intermediate representation, and then CASM. Execution supplies information used by the proving system. Scarb manages dependencies and compilation, while Starknet Foundry helps test contract behaviour and interactions.

Deployment distinguishes declaring a contract class from creating an instance. That distinction matters when recording versions, reproducing builds and verifying the code associated with an address. The application also needs a client that handles accounts, signatures, resource bounds and transaction states.

Starknet has a gas and fee model. Execution resources and costs associated with Ethereum contribute to it; counting trace steps alone or assuming a constant price is insufficient. Budgeting requires simulation of the actual workflow and a check of the parameters supported by the relevant protocol version.

What Cairo offers

Cairo provides verifiable execution and a contract environment designed for Starknet. It can fit a product that needs the network, its applications or its programmable accounts, provided the team can support a stack distinct from EVM development. Requirements should justify that choice.

Consider an application that groups several user actions under an account with limited permissions. Its design must specify which contracts the account may call, for how long and with what spending authority. Revocation, expiry and failure of an individual operation then become concrete test cases.

A technical evaluation should implement a complete journey with the account and wallet intended for production. This exposes signing and confirmation behaviour as well as isolated contract execution. It also provides evidence about integration work that a successful compiler run cannot supply.

Limitations and selection criteria

Cairo introduces its own data structures, serialization rules and programming conventions. Porting Solidity logic typically requires an implementation redesign and a fresh test suite. Libraries, analysis tools and integrations also differ from those available to an EVM team.

A validity proof establishes that execution follows a program, but the program can still encode incorrect business rules. Permission checks, economic invariants and unexpected inputs therefore remain essential test areas. Rollup security also requires assessment of upgrades, availability and exit mechanisms rather than an assumption that it matches Ethereum in every respect.

Before choosing Cairo, a project should confirm that it can maintain the compiler, dependencies and Starknet integrations. Solidity may reduce adaptation work when the same product needs multiple EVM networks. Where confidentiality is the objective, first define which information must remain hidden and from whom.

Also known as

  • Cairo lang
  • Starknet language
  • ZK Cairo
Development at Metlabs

How we approach a project with Cairo

Development capabilities and use cases to assess how Cairo fits your product.

What we build with Cairo at Metlabs

  • Starknet contracts

    Cairo implementation and testing with reproducible compilation and deployments.

  • EVM adaptation

    Redesign of permissions, storage and interfaces for the Starknet model.

  • Use case

    Credential registry

    Identifier issuance and revocation, separating public data from additional privacy mechanisms.

  • Use case

    Batched operations

    Flows assessing multiple calls and authorisations through application accounts.

Related content

Go deeper on Cairo

Other Metlabs pages that expand on this entry.

FAQ's

Frequently asked questions

Record the Scarb and compiler versions, dependencies, compilation settings and declared classes. Link each deployed instance to its class and retain the upgrade procedures. Together, these records let the team rebuild the artifact and compare it with the deployment on the network.

Check compatibility across the SDK, wallet, libraries and resource limits used by the application. A test environment should reproduce critical operations before the production change. Cryptographic execution proofs do not remove the need to maintain and verify the application’s integration dependencies.

Need to build in Cairo?

We analyze your case, pick the right stack and ship a production-ready solution.

Tell us about your project

As featured in

CointelegraphInvesting.comEl EspañolEmprendedoresEl ObservadorCriptoNoticias