An oracle framework with zero knowledge proof
- Truffle >=
- Solidity >=
Register as an oracle with deposit.
function oracle_register(bool TEE, bool MPC) public
- The address which sends this message will become the owner of this oracle.
name | type | detail |
---|---|---|
TEE | bool |
The oracle use trusted execution environment |
MPC | bool |
The oracle use multi-party computation |
Unregister from the oracle list and return the deposits.
function oracle_unregister() public
- This function can only be called by the owner of the oracle.
- User cannot sending any computation request after oracle unregistered.
- The locked deposits will only be returned after user remove the secret.
Create a secret on an oracle.
function secret_create(string secret_key, byte32 secret_hash, address oracle, bytes proof) public
- The address which sends this message will become the owner of this secret.
name | type | detail |
---|---|---|
secret_key | string |
The key to access the encrypted secret |
secret_hash | bytes32 |
The hash of the secret |
oracle | address |
The address of the oracle |
proof | bytes |
The zero knowledge proof of the encryption |
Remove a secret from an oracle.
function secret_remove(bytes32 secret_hash, address oracle) public
- This function can only be called by the owner of the secret.
name | type | detail |
---|---|---|
secret_hash | bytes32 |
The hash of the secret |
oracle | address |
The address of the oracle |
Create a circuit on an oracle.
function circuit_create(string circuit_key, byte32 circuit_hash, address oracle) public
- The address which sends this message will become the owner of this circuit.
name | type | detail |
---|---|---|
circuit_key | string |
The key to access the encrypted circuit |
circuit_hash | bytes32 |
The hash of the circuit |
oracle | address |
The address of the oracle |
Remove a circuit from an oracle.
function circuit_remove(bytes32 circuit_hash, address oracle) public
- This function can only be called by the owner of the circuit.
name | type | detail |
---|---|---|
circuit_hash | bytes32 |
The hash of the circuit |
oracle | address |
The address of the oracle |
Grant access of a secret for an user on an oracle.
function grant_secret_for_user(bytes32 secret_hash, address user, address oracle) public
- This function can only be called by the owner of the secret.
name | type | detail |
---|---|---|
secret_hash | bytes32 |
The hash of the secret |
user | address |
The address of granted user |
oracle | address |
The address of granted oracle |
Grant usage of a secret for the i'th parameter circuit on an oracle.
function grant_secret_on_circuit(bytes32 secret_hash, bytes32 circuit_hash, uint32 i, address oracle) public
- This function can only be called by the owner of the secret.
name | type | detail |
---|---|---|
secret_hash | bytes32 |
The hash of the secret |
circuit_hash | bytes32 |
The hash of the circuit |
i | uint32 |
The i'th parameter |
oracle | address |
The address of granted oracle |
Request an oracle to compute a circuit based on secrets.
function computation_request(bytes32 circuit_hash, byte32[] secret_hashes, uint32[] public_inputs, address oracle) public returns (bytes32)
name | type | detail |
---|---|---|
circuit_hash | bytes32 |
The hash of the circuit |
secret_hashes | bytes32[] |
The hashes of the secrets |
public_inputs | uint32[] |
The public inputs |
oracle | address |
The address of oracle |
type | detail |
---|---|
bytes32 |
The request key |
function computation_reply(byte32 request_key, string result_key, byte32 result_hash, bytes proof) public
name | type | detail |
---|---|---|
request_key | bytes32 |
The request key |
result_key | string |
The key to access the encrypted result |
result_hash | bytes32 |
The hash of the result |
proof | bytes |
The zero knowledge proof |