Proof of Task

Overview

Protocol core service can be broken down into units called β€œTasks". Each Task represents a unit of work to be carried out by the Operators. A Task is any off-chain computation performed by the AVS network, from fetching price feeds to training ML models.

In the Othentic Stack, a task is executed by the Performer and then verified by the Attesters. As a result, the task must not be subjective; 2/3 of the voting power of the network must reach a consensus on whether or not a task is valid.

Proof of Task is a string the Performer generates and distributes to the Attesters over the p2p network to validate an arbitrary Task. It could be any string that the Attesters can use to verify that the Performer has executed its task as expected.

If over β…” of the quorum's voting power attest "valid", the task is considered approved. If over β…“ of the quorum's voting power attest "invalid", the task is rejected, and the quorum executes a slashing event to the Performer. the Aggregator submits this task with the aggregated signatures on-chain. The submitted task can also contain additional data that your AVS requires, and make this data verified and available on-chain.

Send task for validation

The Task Performer sends an RPC call to gossip the tasks to the Task Attesters. The body of that call includes the following params:

ParameterTypeDescription

string

Any string that the Attesters can use to verify that the Performer has executed its task as expected

data

bytes

Additional data to be added to the consensus

taskDefinitionId

uint16

The ID of specific Task definition

performerAddress

address

The address of the Task Performer

signature

bytes

Task Performer ECDSA signature

Task Performer sends the Proof of Task as a param to the network, where Task Attesters use this information to verify the task.

Examples

Oracles

Oracle AVS can fetch data from various endpoints and set the result as the Proof of Task. This proof can be sent to the Task Attesters, which will also fetch the data independently and check the validity of the results.

If valid, the Task Attesters approve and sign the task. This way, the Proof of Task also contains the task result, which will be submitted on-chain by the Task Aggregator.

const ethPrice = oracleService.getPrice("ETHUSD");
const btcPrice = oracleService.getPrice("BTCUSDT");
const task = { ethPrice: ethPrice, btcPrice: btcPrice };
proofOfTask = JSON.stringify(task);

ZK Proofs

If your AVS is performing any pure function then the Task Performer can generate a ZK proof for the same and pass it as the Proof of Task.

The Task Attesters can verify this ZK proof and attest if the task is valid or not.

Inclusion Proofs

If your AVS involves a state, you can ensure a valid state update via Merkle trees. After the task, the Task Performer can pass the state and Merkle proof as the Proof of Task, which the Task Attesters can verify.

IPFS CID

If your AVS involves operating on large amounts of data, such as images, videos, and ML models, the Task Performer can upload the data to IPFS (i.e. via piΓ±ata) and generate a CID.

This identifier can now be used as a Proof of Task which the Task Attesters can fetch and verify the validity of the task.

// Task Performer sending task to Aggregator

const taskDefinitionId = Number(req.body.taskDefinitionId)
const result = await oracleService.getPrice("ETHUSDT");
const cid = await dalService.publishJSONToIpfs(result);
const data = req.body.data;
await dalService.sendTask(cid, data, taskDefinitionId);

// Attesters Validating Proof of Task

const taskResult = await dalService.getIpfsTask(proofOfTask);
const data = await oracleService.getPrice("ETHUSDT");

return taskResult == data;

Last updated