Defining a Computation

Computations must be defined as Computation Definitions before they may be instantiated. Computation Definitions always exist within the context of an associated MXE (Single Use or Persistent), which defines the state (Data Objects) that the Computation Definition can interact with. Each Computation Definition consists of details of the Computation's outputs as well as a version field for tracking upgrades to definitions and ensuring that Computation execution instantiations are always performed on the intended definition version.

Computation Definitions must also grant associated execution authority — which party or parties are able to execute computations using the definition — from the following options:

  • None: no entities currently have the authority to execute Computations for the definition.

  • Private: a single entity that has the authority to execute Computations for the definition.

  • Restricted: a list of specific entities that have authority to execute Computations for the definition.

  • Public: anyone has the authority to execute Computations for the definition.

The actual execution logic of a Computation Definition is defined as a circuit. Two types of circuits exist in Computation Definitions:

  • Public Circuits: the logic is open and may be publicly read.

  • Private Circuit: the logic of the circuit is obfuscated via a Zero-Knowledge Proof.

The BDOZ protocol operates on arithmetic circuits, meaning its fundamental units are field elements and elliptic curve points: this allows it to natively handle many cryptographic operations that act on these types without having to emulate them like FHE would. In addition to this however, it can also be made to support logic gates such as conditionals and comparisons, as well as more complex gates such as lookups, thus also enabling true general-purpose computing.

Parameters

The parameters associated with a Computation Definition fall into one of the two following categories:

  • Data Objects: the data can come from a wide variety of on-chain and off-chain sources, for more details on data provisioning to Data Objects see the Data Provisioning section. Data Objects can be defined to be either mutable or immutable.

  • Binary Data: a length is defined in bits for the raw binary data that will be provided when the Computation is commissioned.

Execution Costs

The circuit associated with a Computation Definition also contains metadata about the number of arithmetic operations within the circuit, as well as the number of inputs and outputs. This applies to both public and private circuit types. This metadata enables precise calculation of the execution cost of the circuit based on the exact number of each operation type required.

Last updated