Builtins List
The following table lists the different builtins implemented in the Cairo VM and gives a brief description of their purpose. For each builtin, a specific section details how it works, its cells organization if any, and references their actual implementation in different implementations of the Cairo VM.
Additional resources related to the operation performed by the builtin are provided if relevant.
Builtin | Description |
---|---|
Output | Stores all the public memory needed to generate a STARK proof (input & output values, builtin pointers...) |
Pedersen | Computes the Pedersen hash h of two felts a and b . h = Pedersen(a, b) |
Range Check | Verify that a felt x is within the bounds [0, 2**128) . |
ECDSA | Verify that the ECDSA signature of a given public key pub on a message m equals sig , previously stored. Only used by Cairo Zero. |
Bitwise | Computes the bitwise AND, XOR and OR of two felts a and b . a & b , a ^ b and `a |
EC OP | Performs Elliptic Curve OPerations - For two points on the STARK curve P , Q and a scalar m , computes R = P + mQ . |
Keccak | Computes the new state s' after applying the 24 rounds of the keccak-f1600 block permutation on a given state s . |
Poseidon | Computes the new state s' after applying the 91 rounds of the hades block permutation on a given state s . |
Range Check96 | Verify that a felt x is within the bounds [0, 2**96) . |
AddMod | Arithmetic Circuit Support - Computes the modular addition c of two felts a , b by batches. c ≡ a + b mod(p) |
MulMod | Arithmetic Circuit Support - Computes the modular multiplication c of two felts a , b by batches. c ≡ a * b mod(p) |
Segment Arena | Manages the Cairo dictionaries Not used in Cairo Zero. |
Gas | Manages the available gas during the run. Used by Starknet to handle its gas usage and avoid DoS. |
System | Manages the Starknet syscalls & cheatcodes. |