| Crates.io | sierra-emu |
| lib.rs | sierra-emu |
| version | 0.6.2 |
| created_at | 2025-06-11 14:41:28.041244+00 |
| updated_at | 2025-09-16 15:33:20.328286+00 |
| description | A Cairo (Sierra) Virtual Machine. |
| homepage | |
| repository | https://github.com/lambdaclass/cairo_native |
| max_upload_size | |
| id | 1708649 |
| size | 406,960 |
An Cairo emulator directly using the Cairo's intermediate representation "Sierra" instead of CASM. An useful usecase is to aid in debugging Cairo Native.
First, make sure to have all the dependencies from Cairo Native setup.
Then, you can use the corelib recipe to make a symlink in the current directory.
make corelib
To use the sierra emulator binary, we must first compile the target cairo program.
../../cairo2/bin/cairo-compile -rs ./programs/fibonacci.cairo > ./programs/fibonacci.sierra
Then, we can generate the ejecution trace with the sierra emulator:
cargo run -- ./programs/fibonacci.sierra fibonacci::fibonacci::main \
--available-gas 100000 --output ./programs/fibonacci.trace.json
The program trace will be generated to ./programs/fibonacci.trace.json.
The sierra emulator can also be used as a library.