Getting Started
The core component of interacting with Sight Oracle is the `@sight-oracle/contracts`
Solidity library.
Installation
Use following command to install:
Usage
Types
Sight Oracle support following encrypted types:
ebool
euint64
eaddress
These types are stored as native uint256
in Solidity, they represent the index where to locate the encrypted values in backend decentralized oracle network (DON).
Requests
Sight Oracle support following request formats:
Request - The basic FHE operation request, it consists of an array of operations (see Operations below).
SaveCiphertextRequest - The request to submit an encrypted value into DON.
ReencryptRequest - The request to re-encrypt an encrypted value, this request is used to reveal an encrypted value to a target wallet address only
Operations
Sight Oracle Request support following operations over encrypted data:
getEbool(ebool): Load an
ebool
value into the execution context.getEaddress(eaddress): Load an
eaddress
value into the execution context.getEuint64(euint64): Load an
euint64
value into the execution context.rand(): Request a random
euint64
.add(op, op): Add two
euint64
values.add(op, uint64): Add an
euint64
with auint64
.sub(op, op): Subtract one
euint64
from anothereuint64
.sub(op, uint64): Subtract a
uint64
from aneuint64
.sub(uint64, op): Subtract an
euint64
from auint64
.mul(op, op): Multiply two
euint64
values.mul(op, uint64): Multiply an
euint64
with auint64
.div(op, op): Divide one
euint64
by anothereuint64
.div(op, uint64): Divide an
euint64
by auint64
.div(uint64, op): Divide a
uint64
by aneuint64
.rem(op, op): Compute the remainder of two
euint64
values.rem(op, uint64): Compute the remainder of an
euint64
divided by auint64
.rem(uint64, op): Compute the remainder of a
uint64
divided by aneuint64
.shl(op, uint64): Shift an
euint64
to the left by auint64
.shr(op, uint64): Shift an
euint64
to the right by auint64
.rotl(op, uint64): Rotate an
euint64
to the left by auint64
.rotr(op, uint64): Rotate an
euint64
to the right by auint64
.select(op, op, op): Select one of two
euint64
values based on anebool
condition.decryptEbool(op): Decrypt an
ebool
value.decryptEuint64(op): Decrypt an
euint64
value.decryptEaddress(op): Decrypt an
eaddress
value.decryptEboolAsync(op): Decrypt an
ebool
asynchronously.decryptEuint64Async(op): Decrypt an
euint64
asynchronously.decryptEaddressAsync(op): Decrypt an
eaddress
asynchronously.
Last updated