Getting Started
The core component of interacting with Sight Oracle is the `@sight-oracle/contracts` Solidity library.
Installation
Use following command to install:
npm install @sight-oracle/contractsUsage
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
eboolvalue into the execution context.getEaddress(eaddress): Load an
eaddressvalue into the execution context.getEuint64(euint64): Load an
euint64value into the execution context.rand(): Request a random
euint64.add(op, op): Add two
euint64values.add(op, uint64): Add an
euint64with auint64.sub(op, op): Subtract one
euint64from anothereuint64.sub(op, uint64): Subtract a
uint64from aneuint64.sub(uint64, op): Subtract an
euint64from auint64.mul(op, op): Multiply two
euint64values.mul(op, uint64): Multiply an
euint64with auint64.div(op, op): Divide one
euint64by anothereuint64.div(op, uint64): Divide an
euint64by auint64.div(uint64, op): Divide a
uint64by aneuint64.rem(op, op): Compute the remainder of two
euint64values.rem(op, uint64): Compute the remainder of an
euint64divided by auint64.rem(uint64, op): Compute the remainder of a
uint64divided by aneuint64.shl(op, uint64): Shift an
euint64to the left by auint64.shr(op, uint64): Shift an
euint64to the right by auint64.rotl(op, uint64): Rotate an
euint64to the left by auint64.rotr(op, uint64): Rotate an
euint64to the right by auint64.select(op, op, op): Select one of two
euint64values based on aneboolcondition.decryptEbool(op): Decrypt an
eboolvalue.decryptEuint64(op): Decrypt an
euint64value.decryptEaddress(op): Decrypt an
eaddressvalue.decryptEboolAsync(op): Decrypt an
eboolasynchronously.decryptEuint64Async(op): Decrypt an
euint64asynchronously.decryptEaddressAsync(op): Decrypt an
eaddressasynchronously.
Last updated