This repository provides a systematic breakdown and explanation of core components in the Starknet protocol implementation.
The main focus is on three key modules: Sequencer, Prover, and Settlement. The code spans across multiple repositories including
starkware-libs/sequencer
,starkware-libs/stone-prover
,starkware-libs/starkex-contracts
,madara-alliance/madara
, andstarkware-libs/cairo-lang
.
Below is a simple example that ties together the three core components - Sequencer, Prover, and Settlement - to help you build a mental model before diving into the documentation.
Let's say Alice wants to send 1 ETH to Bob on Starknet. The process goes through these three stages:
- The transaction first enters the Sequencer's memory pool (mempool).
- The Sequencer picks a batch of transactions from the queue, executes them locally, and verifies rules like sufficient balance.
- Successful transactions are written to a block; failed ones are dropped or rolled back.
- Once sealed, the block is broadcast to other Sequencers for quick consensus.
- The newly confirmed block enters the Prover queue, where it can be processed in parallel with other blocks.
- The Prover records the complete Execution Trace and State Diff.
- It then performs "blow-up and mixing" operations to amplify and randomize potential errors.
- The algorithm randomly samples to generate a STARK proof that will fail if there are any data inconsistencies.
- The Prover packages the "STARK proof + State Diff" into an L1 transaction and sends it to Ethereum.
- The Ethereum Verifier contract spot-checks the proof and rejects it immediately if any inconsistencies are found.
- After passing verification, the Starknet Core contract updates the state.
- The updated state is permanently stored with the Ethereum block, giving the transaction its finality.
This example shows the complete cycle of Sequencer → Prover → Settlement, which are the main focus of this repository. Other sections like Governance and Chore provide supplementary information to help you better understand the Starknet ecosystem.
The following documentation is arranged in recommended reading order:
- Engine API
- Cairo VM
- Derivation
- Deposit
- Withdraw
- Madara Data Submission Job
- Mastering the Stone Prover for Developers
- Starknet Version History
Feel free to open an Issue or submit a PR for any questions or suggestions.