package octez-protocol-020-PsParisC-libs

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Dummy ZK Rollup for testing the ZKRU integration in the protocol. The library Plompiler is used to build the circuits (in a module V as verifier) and the corresponding functions to produce the inputs for the circuits (in a module P as prover).

The state of this rollup is a boolean value, which will be represented with a scalar value of zero for false and one for true.

This RU has only one operation, with op_code 0. In addition to the common header (see Zk_rollup_operation_repr), this operation has as payload one scalar representing a boolean value.

The transition function f for this rollup is:

f : operation -> state -> state
f (Op b) s = if b = s then not s else s

That is, the state bool is flipped only if the operation's payload is equal to the current state.

The operation can be used publicly or in a private batch. The circuits that describe the RU are:

  • "op": for a single public operation.
  • "batch-"[N]: for a batch of N private operations. N is determined by the batch_size parameter to the Operator functor.
  • "fee": the trivial fees circuit, since this RU has no concept of fees.

NB: the "op" circuit does not add any constraints over the operation's exit_validity other than it being in {0, 1}. This means that the dummy rollup can be used to test deposits/withdrawals, but the rollup will not perform any monetary bookkeeping.

Helper types and modules

Empty types to represent bounds

type balance
type amount
type fee
type op_code
module Bound : sig ... end

Bounds required for the dummy rollup.

module Bounded : sig ... end

Modules to manipulate bounded integers, both as OCaml values and in circuit representation.

module Types : sig ... end

Types used for the Dummy Rollup circuits. This module is split into:

module V (L : Plompiler.LIB) : sig ... end

Plompiler circuits for the dummy rollup

module Operator (Params : sig ... end) : sig ... end

Basic rollup operator for generating Updates.

OCaml

Innovation. Community. Security.