Virtual Machine

Virtual Machine

Our stack-based virtual machine (opens in a new tab) is designed to read data from EVM-compatible rollups and generate proofs that can be returned to and verified on Layer 1.

A GatewayRequest (opens in a new tab) constitutes a single bytes type that holds sequential OP codes(See our Builder API Methods) (followed by their associated data in the case of PUSH_ operations) that are interpreted by the virtual machine.

Operations manipulate the stack of the Virtual Machine to generate slot IDs and fetch/manipulate data.

A GatewayRequest is built using our builder interface which specifies how many outputs it expects, and how those outputs should be fetched.

There are OP codes that allow for execution of nested requests for more complex use cases.

Evaluation

Evaluation of a request returns:

  • outputs: An array of the requested outputs.
  • exitCode: A code that shows the exit status code.