Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



3 Commits

Repository files navigation

StarkEx Cairo Code Repository


​ This repository contains the Cairo code (and some of the cryptographic primitives) used by StarkEx, StarkWare's scalability solution for spot ERC-20 and ERC-721 trading. If you are not familiar with StarkEx, you can read more about it here. ​

Note: The Cairo code that proves perpetual trading, can be found in another repo. ​

If you are not familiar with the Cairo language, you can find more details about it here.

​ The Cairo code is published to allow a permissionless audit of StarkEx business logic, as enforced by the StarkEx smart-contract

Repository Contents

src/starkware/cairo/dex, src/services/exchange/cairo The full Cairo program that StarkEx, StarkWare's scaling solution, executes. It includes a Python file,, that calculates the hash of the Cairo code and compares it to the pre-calculated value found at program_hash.json

src/starkware/crypto/starkware/crypto/signature: The Python implementation of the cryptographic primitives used by StarkEx, namely the Pedersen hash functions and the ECDSA signature. These implementations, or equivalent implementations in other languages such as JS, are used by StarEx user's wallets in order to generate and sign on orders.

src/starkware/python: additional utility scripts the scripts at src/starkware/cairo/dex need.

How to Use the Repo


Docker (Ubuntu install via: apt install -y ​


  1. Run the test to verify that the Cairo program hash is indeed the one saved in the file src/starkware/cairo/dex/program_hash.json by running the command:
    docker build .

  2. Verify that the same hash is used by StarkEx on Mainnet by running the script src/services/ in the following way:
    ./src/services/exchange/ --main_address <checksummed_main_address> --node_endpoint <your_node_endpoint>

You can find the relevant addresses and current versions for the different StarkEx deployments here.

When comparing the hash, please make sure you checkout the tag that corresponds to the deployed version from this repo.


No description, website, or topics provided.







No releases published


No packages published