Overview
Starknet is built on advanced cryptographic primitives that enable scalable, trustless computation using STARK proofs. These include a custom prime field and elliptic curve and multiple hash functions optimized for zero-knowledge performance.The STARK field
The STARK field is the finite field , where: = = 3618502788666131213697322783095070105623107215331596699973092056135872020481The
felt252 type in Cairo refers to elements of the STARK field.The STARK curve
The STARK curve is an elliptic curve defined over the STARK field by: where:- = 1
- = 3141592653589793238462643383279502884197169399375105820974944592307816406665
- = 874739451078007766457464989774322083649278607533249481151382481072868806602
- = 152666792071518830868575557812948353041420400780739481342941381225525861407
The STARK curve is commonly used in smart contracts, but is not distinguished by the Starknet protocol.
Hash functions
There are three hash functions used throughout Starknet’s specifications that map inputs to elements in the STARK field.Starknet Keccak
Starknet’s version of the Keccak hash function, commonly denoted by , is defined as the first 250 bits of Ethereum’s keccak256.Pedersen hash
Starknet’s version of the Pedersen hash function is then defined by: where:- and are the 248 low of and , respectively
- and are the 4 high bits of and , respectively
- The values of the constants can be found in fast_pedersen_hash.py
- denotes the coordinate of point