Skip to main content

Architecture

A Madara blockchain consists of the following components:

  • An orchestrator
  • A sequencer
  • Starknet OS (SNOS)
  • A prover
  • A settlement layer

Note that some components are left out, for now, for simplicity.

Transaction flow

When a user issues a transaction it goes through the components in the following way:

  1. The transaction is received by the sequencer
  2. The sequencer executes the transaction and generates a state diff (depicting what state changes the transaction causes in the blockchain)
  3. The sequencer waits until enough transactions have been received to assemble a block
  4. Meanwhile, the Orchestrator polls the sequencer for new, unprocessed blocks
  5. Once a new, unprocessed block is available, a request is sent to SNOS to process the block number
  6. SNOS queries the sequencer for block data (transactions, state diff, old state root, new state root), based on the block number
  7. The sequencer returns block data for the SNOS
  8. The SNOS generates and sends validity proof input for the orchestrator
  9. The orchestrator forwards the validity proof inputs to the prover
  10. The prover generates a validity proof and forwards this to the settlement layer verifier contract
  11. The orchestrator monitors the verifier contract for block verification
  12. Once the block has been verified, the orchestrator requests the settlement layer's core contracts to update the network state
  13. The sequencer monitors the core contracts for a new, updated state and updates its own state accordingly