Starknet Documentation

repository·main·Indexed 41 days ago

https://github.com/starknet-io/starknet-docs

Official documentation hub for Starknet, providing guides and references for developers, validators, and users. Includes technical specifications for Mainnet and Sepolia, including Starknet version 0.14.2/0.14.3, Sierra 1.7.0/1.9.0, and Cairo 2.0.0 - 2.19.0. Features resources on network security, protocol deep dives, JSON-RPC API specifications, and infrastructure provider configurations.

Tokens
102.3K
Snippets
183
Records
384
Agent score
52%

What's inside Starknet

  1. Overview of StarkGate bridging capabilities

    main

    StarkGate is a bridge developed by StarkWare that enables the transfer of ETH and ERC-20 tokens between Ethereum (L1) and Starknet (L2).

    Key capabilities include:

    • Depositing funds to Starknet (with or without an attached message).
    • Withdrawing funds to Ethereum.
    • Adding new tokens to the StarkGate ecosystem.

    Important Note on DAI Migration: StarkGate has launched a new set of DAI bridge and token contracts.

    • DAI v0: The old DAI. Depositing DAI v0 via the DAI v0 bridge is disabled. While withdrawals are still possible, it does not support latest features like Smart Deposits or Withdrawal Limits and will eventually lose compatibility with Starknet.
    • DAI: The new DAI. Users are strongly encouraged to migrate by swapping DAI v0 for DAI on Starknet swap apps/aggregators or by withdrawing DAI v0 to L1 and re-depositing it via StarkGate (which issues the new DAI).
  2. Overview of S-two core components and protocols

    main

    S-two is built upon several specialized mathematical and cryptographic components designed for efficient arithmetic and proof generation. The system implementation relies on the following core concepts:

    • Mersenne31 Prime Field: Uses Mersenne primes for efficient arithmetic operations.
    • Circle Group: An algebraic structure that facilitates FFT and polynomial operations.
    • Circle Polynomials: Polynomials represented and evaluated within the circle group.
    • Circle FFT: A Fast Fourier Transform algorithm adapted specifically for the circle group.
    • Vector Commitment Scheme (VCS): Utilizes Merkle trees to commit to vectors and enable efficient proofs of inclusion.
    • AIR to Composition Polynomial: The process of encoding algebraic constraints as polynomials for proof generation.
    • Circle FRI: A protocol for low-degree testing of polynomials over the circle group.
    • Polynomial Commitment Scheme (PCS): A protocol for committing to and opening polynomials with soundness guarantees.
    • Proof Generation and Verification: The end-to-end workflow for generating and verifying STARK proofs.
    • Lookups: Implementation of lookup arguments for efficient constraint checking.
  3. Introduction to the Circle FRI protocol

    main

    The Circle FRI protocol is used to check proximity to low-degree polynomials. This protocol is a core component of the STWO system for verifying polynomial properties efficiently. The documentation for Circle FRI is divided into three main technical areas:

    1. Technical Overview: Covers mathematical foundations, protocol steps, multi-table examples, and security analysis.
    2. FRI Prover: Details the implementation of the prover, specifically focusing on protocol configuration, the commitment phase, and the decommitment phase.
    3. FRI Verifier: Details the implementation of the verifier, specifically covering query generation and the verification logic.
  4. Overview of the S-two framework

    main

    S-two is a framework designed for creating STARK proofs. It is characterized by three core pillars:

    1. Flexible Frontend: Allows developers to express and define their own custom constraints.
    2. High-Performance Backend: Utilizes Circle STARKs over the Mersenne31 prime field to achieve fast prover performance.
    3. Cairo Integration: Features seamless integration with the Cairo programming language.

    Developers use S-two to define mathematical constraints and generate proofs for them efficiently.

  5. Overview of the Help secure Starknet guide

    main

    The Help secure Starknet guide is a comprehensive tutorial designed to walk users through the process of becoming a Starknet validator. As Starknet transitions from a centralized model to a staking protocol, validators will take over the responsibilities of producing, attesting, and proving blocks.

    The guide is structured into several progressive tutorials:

    • Running a full node: Instructions for setting up and maintaining a validator node.
    • Becoming a validator: How to stake tokens to gain eligibility for validation.
    • Attesting to blocks: How to participate in the block attestation process as an active validator.
    • Recommended next steps: Advanced topics and ongoing maintenance strategies.
  6. AI-powered tools for Starknet and Cairo

    main

    Leverage AI to assist with coding, searching, and automation:

    • Cairo Coder: An intelligent code generation service using RAG to provide functional Cairo code based on natural language.
    • Starknet Agent: An AI-powered search engine for querying Starknet documentation and the Cairo Book.
    • Snak: A toolkit for creating AI agents that interact with the Starknet blockchain (supports Anthropic, OpenAI, Google Gemini, and Ollama).
    • Eliza Starknet plugin: Bridges the Eliza ecosystem with Starknet for automated token operations, trading, and DeFi management.
    • Daydreams: A generative agent framework for executing complex, long-term tasks like onchain gaming or DeFi strategies.
  7. dApp development and infrastructure tools

    main

    Use these tools to build, deploy, and connect user interfaces to Starknet applications:

    • Scaffold Stark: Simplifies creating, deploying, and interacting with smart contracts.
    • Starknet React: A collection of React hooks inspired by wagmi for Starknet integration.
    • Get Starknet: A bridge for connecting Starknet wallets (Ready, Braavos, Metamask Snaps, OKX) to dApps.
    • Starknetkit: A wallet connection kit built by Ready using starknet.js and starknet-react.
    • Dynamic SDK: Provides authentication, smart wallets, and secure key management across multiple chains.
    • Dojo: A framework for building provable, composable, and persistent games and applications.
    • Chipi SDK: Enables non-custodial wallets via social logins (Google, Apple, etc.) and transaction sponsorship via AVNU's Paymaster.
    • Cavos: Wallet infrastructure for instant creation, gasless transactions, and multi-provider authentication.
    • STRK20 by Example: A hub for integrating STRK20 private transfers using the starknet-privacy SDK.
  8. Utility and debugging tools for Starknet

    main

    Specialized tools for debugging, testing, and contract management:

    • Walnut: A transaction debugger and simulator supporting Mainnet, Sepolia, and Appchains. Includes call trace analysis and step-by-step debugging.
    • Starkli: A CLI tool for querying the Starknet network and making transactions.
    • Cairo Playground: An online environment to experiment with Cairo and the Cairo VM without deploying contracts.
    • Stark Utils: A web-based toolbox for converting values to felts, strings, hexadecimals, etc.
    • Katana: A high-speed devnet optimized for the Dojo gaming engine.
    • OpenZeppelin Contract Wizard: Helps generate smart contracts using OpenZeppelin libraries by toggling features.
    • Starknet Devnet JS: A JavaScript package for interacting with the Starknet Devnet API, useful for L1<->L2 end-to-end testing.
    • Starknet Contract Verifier: A client for the Voyager explorer to verify contract classes.
  9. Understand the AIR to composition polynomial conversion process

    main

    The AIR (Algebraic Intermediate Representation) conversion process involves transforming an AIR into a single composition polynomial. This process combines multiple components and their respective constraints into one unified polynomial.

    To understand the implementation, you should explore three main areas:

    1. Technical Overview: High-level explanation of combining components into a composition polynomial.
    2. Components: Implementation details of the Components struct and functions like mask_points and eval_composition_polynomial_at_point.
    3. Prover Components: Details on the ComponentProvers struct and the compute_composition_polynomial function used during the proving process.
  10. Explore Starknet Learning Paths

    main

    Starknet provides several structured learning paths depending on your technical goals. You can choose to focus on smart contract development, language mastery, protocol architecture, or advanced proving systems:

    • Write Cairo Contracts: Practical examples and best practices for building smart contracts.
    • Cairo Language: A comprehensive guide to mastering the Cairo programming language from the ground up.
    • Protocol: Deep dive into Starknet's architecture, consensus mechanisms, and core components.
    • S-two (Advanced): Focused on Starknet's next-generation proving system, including zero-knowledge proofs and AIR (Algebraic Intermediate Representation) development.
  11. Understand the S-two Polynomial Commitment Scheme (PCS) implementation

    main

    The S-two implementation of the Polynomial Commitment Scheme (PCS) is built on top of the FRI protocol. A PCS allows a prover to commit to a polynomial and subsequently reveal evaluations at specific points. The implementation is divided into three main components:

    1. Overview: High-level description of the S-two PCS architecture.
    2. PCS Prover: Implementation details for the prover, covering the commitment and opening protocols.
    3. PCS Verifier: Implementation details for the verifier, covering how to check commitments and evaluate proofs.
  12. Compare zkVM and Proof System architectures

    main

    The benchmarks report compares several zkVM and proof systems based on their architecture, frontend, backend, and security bits.

    Key systems included:

    • Stone: Cairo VM, Cairo frontend, STARK-based backend, 100 bits security.
    • S-two: Cairo VM, Cairo frontend, STARK-based backend, 96 bits security.
    • RISC Zero: RISC-V, Rust frontend, STARK-based backend, 96 bits security.
    • SP1: RISC-V, Rust frontend, STARK-based backend, 100 bits security.
    • OpenVM: RISC-V, Rust frontend, STARK-based backend, 100 bits security.
    • Jolt: RISC-V, Rust frontend, Lookup-based backend.

    Important Benchmark Notes:

    • All benchmarks are CPU-only (no GPU acceleration).
    • SP1, R0, and OpenVM use compressed or succinct prover types that aggregate STARK proofs into a single STARK proof.
    • Stone benchmarks use a dynamic layout.
    • In tables, 💾 indicates the benchmark ran out of memory, and ❌ indicates a proof generation error.