Task Definition

Overview

Othentic Stack enables AVS developers to configure a wide range of tasks for operators to execute, each with customizable parameters, rewards, and operator clusters. Through Task Definitions, you can specify not only the task parameters but also the required security levels, number of operators, and other operational criteria necessary for task execution. This flexibility ensures that tasks requiring consensus can be precisely tailored to meet your security and operational needs.

Create Task Definitions

const attestationCenter = new ethers.Contract(
  ATTESTATION_CENTER_ADDRESS,
  ['function createNewTaskDefinition(string,(uint256,uint256,uint256,uint256,uint256,uint256,uint256[])) external']
);

const tx = await attestationCenter.createNewTaskDefinition(
  "Example Task",             // Human-readable name
  {             
  ethers.MaxUint256,          // Never expires
  ethers.parseEther('0.01'),  // Reward for attestation
  ethers.parseEther('0.1'),   // Reward for performer
  ethers.parseEther('0.005'), // Reward for aggregation
  0,                          // Disable disputes
  0,                          // Minimum Voting Power
  []                          // Restricted Operator Set 
  }                          
);

await tx.wait();

In order to use the created "TaskDefinition", the Task Performer should send taskDefinitionId in the RPC request.

The RPC call that the Task Performer sends to the Othentic Client:

{
    "jsonrpc": "2.0",
    "method": "sendTask",
    "params": [<proofOfTask>, <data>, <taskDefinitionId>,  <performerAddress>, <signature>]
}

Minimum Voting Power Per Task Definition

Limit the number of operators who can participate in certain tasks. You can set a minimum voting power per task definition. By default, the minimum voting power is zero, which means that any active operator can participate in any consensus role and task execution. You can restrict this to having only operators with minimum shares.

If an operator attests to a task and has less than the minimum voting power, the task would fail with a OperatorDoesNotHaveMinimumVotingPower(operatorIndex) error.

The AVS Governance Multisig should not set this value too high so that no attester passes the threshold. If the total voting power of the Task Definition is zero, the task will revert with a InvalidRequiredVotingPower error.

Restricted Operator Set Per Task Definition

AVS can have an unlimited number of tasks, and each task can be executed by different Operator clusters. You might have a type of task that should not be executed in a permissionless way.

You can set a restricted operator set as "allowlisted set" of operators for a particular task definition (or define it as registration criteria in theAVSGovernance)

If a task that has restricted operators is submitted, the system checks that the Operators are part of the restrictedOperatorIndexes list. If an unrestricted operator attests to this task, then it will revert with a InvalidRestrictedOperator(taskDefinitionId, attesterId) error.

Last updated