Understanding Request Model
Sight Oracle interacts with requests using the following Request
format:
Key Concept: Operation
The ops
array in the request defines the sequence of computations. Each Operation
includes an opcode
, operands (references to other operations by index), and optionally, a direct value:
The FHE compute engine processes the ops
array, executing the operations sequentially. Notably, except for getXXX
operations (e.g., getEuint64
), all operations accept indices of other operations as input, not raw variables or values.
Example: Requesting an Addition Operation
Below is an example demonstrating how to construct a request that adds two encrypted values (euint64
):
Important Notes:
Operands as Indices: Operations (except
getXXX
) only accept indices of prior operations as inputs. For example,r.add(load_a, load_b)
passes the indices ofload_a
andload_b
within theops
array.Sequential Execution: Operations are executed in the order they are defined in the
ops
array.Callback Handling: The callback function is invoked by the Oracle once the computation is complete, allowing the contract to handle the results.
Last updated