Maru
  • Introduction
  • Volume use cases
  • Architecture overview
  • Maru Roadmap
  • ZK IMPLEMENTATION
    • Schema
      • Sum proof
      • Search proof
      • Data proof
      • Keccak proof
      • KeccakSponge proof
      • Logic proof
      • Arithmetic proof
    • Plonky2 verifier in Circom
  • user guide
    • Maru Demo FAQ
      • Why event proofs?
      • Why starky?
    • Deployed contracts
  • Maru ZKVM
    • Computer architecture
    • Memory model
    • Instruction set architecture
      • Instructions Execution
      • Instruction set
      • Instruction encoding
    • High-level frontend
    • Domain Specific Language
      • Unary map
      • Zip and binary map
      • Filter for all ETH-USDC swap prices on Uniswap
      • Calculate a 24-hour block-by-block moving average of the ETH-USDC pair on Uniswap
      • Compiler optimizations
Powered by GitBook
On this page
  1. Maru ZKVM

Instruction set architecture

As the zkVM processor is just a set of constraints by which rows are changed in response to instructions execution, the usual size of instruction set question presents quite unusual possibilities. While it’s true that each new instruction added to the set will bring additional complexity, with a clever column layout, new instructions cost may vary greatly. Parts of constraints, already introduced by previously added instructions can be reused almost freely. Also actual instructions execution time is neglectable compared to proving costs, so more complex instructions can greatly decrease trace size, actually improving performance. On the other hand, bloating the instruction set will still call for bigger instruction size and would definitely increase overall complexity, as even opcode selection itself would become rather complicated.

Our instruction set was originally restricted to very basics of what would make the processor work - RISC core with only arithmetic operations, conditional jump and call/ret. But with the infrastructure needed for this bare set of instructions, we decided to go a little bit further and actually exposed quite a number of instructions, derived from constraint combinations of the basic instruction set. This extended set of instructions seems to reduce strings of instructions, produced by more sophisticated pointer manipulations, but it’s still quite experimental and was introduced only because it had almost no implementation cost.

Also we introduced peripherals - native modules, having a memory-mapped interface and helping to extend the instruction set without bloating instructions itself. From the instruction execution point of view peripherals are free, as processed data just appears in memory, already proven.

PreviousMemory modelNextInstructions Execution

Last updated 1 year ago