Starknet corelib

website·Indexed 39 days ago

https://docs.starknet.io/

Documentation for the Starknet core library (corelib), providing essential types and functions for Cairo development. Includes modules for circuit construction (core::circuit), byte array manipulation (core::byte_array), memory management with Box (core::box), and cryptographic primitives like blake2s (core::blake).

Tokens
203.1K
Snippets
1.1K
Records
1.5K
Agent score
71%

What's inside Starknet

  1. Overview of Cartridge Controller for Starknet Gaming

    Cartridge Controller provides an abstraction layer for managing account access and ownership on Starknet, specifically designed for gaming. Key features include social login (Google, Twitter), biometric authentication (Passkeys), policy-based access control, and delegated transactions. A critical feature is the built-in paymaster, which provides policy-bound sponsorship: Cartridge can sponsor fees for calls that match approved policies and eligible session/SNIP-9 paths.
  2. Overview of Privy for Starknet

    Privy provides secure, server-side key management for Starknet wallets, allowing developers to create and manage wallets, sign transactions on the backend without exposing private keys, and support social or email-based authentication. Starknet is supported as a Tier 2 chain, enabling the use of Privy's raw sign functionality for transaction signing.
  3. Overview of Starknet Protocol Architecture

    Starknet is a decentralized, permissionless Layer 2 (L2) validity rollup designed to scale Ethereum. It uses STARK-based zero-knowledge proofs to bundle thousands of transactions off-chain, which are then verified and settled on the Ethereum mainnet. As of 2026, it includes the STRK20 framework to support confidential balances and transfers for assets like stablecoins while maintaining regulatory compliance.
  4. Overview of the Cairo 1 Compilation Pipeline

    Cairo 1 uses a multi-stage compilation process to ensure that all transactions are provable and to prevent infinite loops or invalid constraints. The pipeline transforms high-level source code into executable assembly via a safe intermediate representation (Sierra).

    Pipeline flow:

    1. Cairo 1.0 Source: High-level code.
    2. Sierra IR: Compiled from source using the Cairo-to-Sierra compiler. This is safe, provable code where loops are transformed into recursion and gas usage is tracked.
    3. CASM (Cairo Assembly): The sequencer compiles Sierra IR into a subset of CASM known as 'Safe CASM'.
    4. CairoVM Execution: The CASM is executed to generate STARK Proofs.
  5. Overview of Circle FRI in S-two

    Circle FRI is a low degree test used in S-two to verify that a function $f$ over a canonical coset $D$ (of size $|D|=2^{n + \beta}$) is 'close' to a polynomial $p(x, y)$ from the polynomial space $L'_n(F)$.

    Key components include:

    • Field: $F$ is a field extension of $\mathsf{M31}$.
    • Blowup: $\beta$ is the log of blowup $B = 2^\beta$.
    • Polynomial Space: $L'_n(F) = F[x]^{< 2^{n-1}} + y \cdot F[x]^{< 2^{n-1}}$.

    S-two utilizes a multi-table variant of Circle FRI to support domains of different sizes, which avoids excessive padding overhead when representing traces over multiple tables.

  6. Overview of Starknet L1 ↔ L2 Messaging

    Starknet provides a messaging mechanism to allow interaction between Ethereum (L1) and Starknet (L2). This is essential for bridges and DeFi pooling. The mechanism is characterized by two key properties:

    1. Asynchronous: Contract code (Cairo or Solidity) cannot await the result of a message sent to the other layer within the same execution.
    2. Asymmetric:
      • L1 → L2: Fully automated. The Starknet sequencer ensures the message is delivered to the target L2 contract.
      • L2 → L1: Semi-automated. The sequencer sends the hash of the message to L1, but the recipient must manually consume the message using a transaction on L1.
  7. Overview of core::nullable::NullableTrait

    The NullableTrait provides a set of utility functions for managing Nullable types in Starknet. It allows developers to create non-null values, check for nullity, and safely unwrap values with defaults or closures.
    pub trait NullableTrait
  8. Overview of Starkzap TypeScript SDK

    Starkzap is a TypeScript SDK designed for building consumer applications on Starknet. It leverages native account abstraction to allow developers to integrate wallets, token operations, and DeFi features without requiring users to manage seed phrases. The SDK is cross-platform, supporting Node.js, browsers, and React Native with a consistent API.
  9. Overview of Account Abstraction on Starknet

    On Starknet, Account Abstraction (AA) is natively supported. Unlike Ethereum's Externally Owned Accounts (EOAs) which are controlled by private keys with hardcoded protocol logic, all Starknet accounts are Account Contracts. These are smart contracts that implement the account logic, allowing for greater flexibility and improved user experience.
  10. Overview of the Cairo Corelib

    The Cairo core library (Corelib) provides the foundational building blocks for writing provable programs in Cairo. It includes essential utilities, data structures, mathematical functions, cryptographic tools, and system interactions. It is designed for use in both onchain (e.g., Starknet smart contracts) and offchain development.
  11. Overview of the S-two proving framework

    S-two is a standalone framework that integrates both the frontend (structuring functions to be proven) and the backend (the process of creating the proof). This integrated approach reduces system complexity and simplifies maintenance compared to modular frameworks where frontends and backends are chosen separately.
  12. Overview of SHARP (SHARed Prover)

    SHARP (SHARed Prover) is a proof aggregation system designed to generate a single, unified STARK proof for multiple Cairo programs. By leveraging the exponential asymmetry of the STARK protocol, SHARP allows multiple applications to share the cost of onchain verification on Ethereum. For Starknet, this means sending a single proof for multiple blocks, significantly reducing costs and improving network efficiency.