core::traits | Core traits for various operations. This module provides a collection of essential traits that define common behavior patterns for Cairo types. |
core::boolean | Boolean operations. The bool type is a primitive type in Cairo representing a boolean value that can be either true or false . |
core::circuit | Efficient modular arithmetic computations using arithmetic circuits. This module provides a type-safe way to perform modular arithmetic operations using arithmetic circuits. |
core::blake | — |
core::box | Box is a smart pointer that allows for heap allocation. |
core::nullable | A wrapper type for handling optional values. Nullable is a wrapper type that can either contain a value stored in a Box or be null. |
core::array | A contiguous collection of elements of the same type in memory, written Array . Arrays have O(1) indexing, O(1) push and O(1) pop (from the front). |
core::dict | A dictionary-like data structure that maps felt252 keys to values of any type. The Felt252Dict provides efficient key-value storage with operations for inserting, retrieving, and updating values. |
core::result | Error handling with the Result type. Result is the type used for returning and propagating errors. It is an enum with the variants, Ok(T) , representing success and containing a value, and Err(E) , representing error and containing an error value. |
core::option | Optional values. The Option type represents an optional value: every Option is either Some and contains a value, or None , and does not. |
core::clone | The Clone trait provides the ability to duplicate instances of types that cannot be ‘implicitly copied’. In Cairo, some simple types are “implicitly copyable”: when you assign them or pass them as arguments, the receiver will get a copy, leaving the original value in place. |
core::ec | Functions and constructs related to elliptic curve operations on the STARK curve. This module provides implementations for various elliptic curve operations tailored for the STARK curve. |
core::ecdsa | Elliptic Curve Digital Signature Algorithm (ECDSA) for the STARK curve. This module provides implementations for ECDSA signature verification and public key recovery. |
core::integer | Integer types and operations. This module provides the built-in integer types and their associated operations. |
core::cmp | Utilities for comparing and ordering values. This module contains functions that rely on the PartialOrd trait for comparing values. |
core::gas | Utilities for handling gas in Cairo code. |
core::math | Mathematical operations and utilities. Provides extended GCD, modular inverse, and modular arithmetic operations. |
core::num | — |
core::ops | Overloadable operators. Implementing these traits allows you to overload certain operators. Note: Other overloadable operators are also defined in the core::traits module. |
core::panics | Core panic mechanism. This module provides the core panic functionality used for error handling in Cairo. It defines the basic types and functions used to trigger and manage panics, which are used when an unrecoverable error is encountered. |
core::hash | Generic hashing support. This module provides a hash state abstraction that can be updated with values and finalized to produce a hash digest. |
core::keccak | Keccak-256 cryptographic hash function implementation. |
core::pedersen | Pedersen hash related traits implementations. This module provides an implementation of the Pedersen hash function, which is a collision-resistant cryptographic hash function. The HashState allows for efficient computation of Pedersen hashes. |
core::qm31 | Definition for the qm31 type. Only available for local proofs. The implementations defined in this module can be accessed by using the traits directly. |
core::serde | Serialization and deserialization of data structures. This module provides traits and implementations for converting Cairo types into a sequence of felt252 values and back. |
core::sha256 | Implementation of the SHA-256 cryptographic hash function. This module provides functions to compute SHA-256 hashes of data. The input data can be an array of 32-bit words, or a ByteArray . |
core::poseidon | Poseidon hash related traits implementations and functions. This module provides cryptographic hash functions based on the Poseidon permutation. |
core::debug | Utilities related to printing of values at runtime. The recommended way of printing values is by using the Display and Debug traits available in the fmt module. |
core::fmt | Functionality for formatting values. The main components of this module are the formatting traits and the Formatter struct. |
core::starknet | Functionalities for interacting with the Starknet network. |
core::internal | — |
core::zeroable | Types and traits for handling non-zero values and zero checking operations. This module provides the NonZero wrapper type which guarantees that a value is never zero. |
core::bytes_31 | Definitions and utilities for the bytes31 type. The bytes31 type is a compact, indexable 31-byte type. |
core::byte_array | ByteArray is designed to handle large sequences of bytes with operations like appending, concatenation, and accessing individual bytes. It uses a structure that combines an Array of bytes31 chunks with a pending word for efficient storage. |
core::string | — |
core::iter | Composable external iteration. If you’ve found yourself with a collection of some kind, and needed to perform an operation on the elements of said collection, you’ll quickly run into ‘iterators’. |
core::metaprogramming | Metaprogramming utilities. |
core::testing | Measurement of gas consumption for testing purpose. This module provides the get_available_gas function, useful for asserting the amount of gas consumed by a particular operation or function call. |
core::to_byte_array | ASCII representation of numeric types for ByteArray manipulation. This module enables conversion of numeric values into their ASCII string representation, which can then be used to build ByteArray instances. |