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.

BuiltinDescription
OutputStores all the public memory needed to generate a STARK proof (input & output values, builtin pointers...)
PedersenComputes the Pedersen hash h of two felts a and b. h = Pedersen(a, b)
Range CheckVerify that a felt x is within the bounds [0, 2**128).
ECDSAVerify that the ECDSA signature of a given public key pub on a message m equals sig, previously stored. Only used by Cairo Zero.
BitwiseComputes the bitwise AND, XOR and OR of two felts a and b. a & b, a ^ b and a | b.
EC OPPerforms Elliptic Curve OPerations - For two points on the STARK curve P, Q and a scalar m, computes R = P + mQ.
KeccakComputes the new state s' after applying the 24 rounds of the keccak-f1600 block permutation on a given state s.
PoseidonComputes the new state s' after applying the 91 rounds of the hades block permutation on a given state s.
Range Check96Verify that a felt x is within the bounds [0, 2**96).
AddModArithmetic Circuit Support - Computes the modular addition c of two felts a, b by batches. c ≡ a + b mod(p)
MulModArithmetic Circuit Support - Computes the modular multiplication c of two felts a, b by batches. c ≡ a * b mod(p)
Segment ArenaManages the Cairo dictionaries Not used in Cairo Zero.
GasManages the available gas during the run. Used by Starknet to handle its gas usage and avoid DoS.
SystemManages the Starknet syscalls & cheatcodes.