# Task Definitions

## Overview&#x20;

Core service can be broken down into “Tasks", each representing a unit of work to be carried out by the Operators. A Task is any off-chain computation the network performs, from fetching price feeds to training ML models.

Othentic Stack enables developers to **configure multiple tasks** for operators to execute, each with customizable parameters, rewards, and operator clusters.&#x20;

Each task is uniquely identified by a **Task Definition ID**. By default, a task with **Task Definition ID `0`** is automatically created and available for use.&#x20;

#### Default Task Definition (ID 0)

By default, a **Task Definition with ID 0** is created for every AVS. This default task definition is intended **solely for testing purposes** and is **not recommended for production use**.

For production deployments, **AVS teams must create and configure new Task Definitions** for their specific use cases.

## Fields and Usage

Task definitions outline the key metadata and parameters that govern how each task operates. These parameters are essential for ensuring tasks are configured according to specific security and operational requirements.

Each Task Definition includes the following fields:

* **Name:** A descriptive label for the task.
* **Base Rewards:** Specifies the base rewards allocated to each operator role involved in consensus—[Performer](https://docs.othentic.xyz/main/learn/operator-roles#performers), [Attesters](https://docs.othentic.xyz/main/learn/operator-roles#attesters), and [Aggregators](https://docs.othentic.xyz/main/learn/operator-roles#aggregators).
* [**Minimum Voting Power (Optional)**](#minimum-voting-power)**:** Sets the minimum voting power required for an operator to participate.
* [**Restricted Operators (Optional)**](#restricted-operator-set)**:** Lists which operators are permitted to participate in consensus for the task.
* [**Maximum Number of Attesters (Optional)**](#maximum-number-of-attesters)**:** Limits how many attesters can participate in consensus for the task.
* **Task Expiry:** Defines a **block number** after which the task is no longer executable. If left blank, the task does not expire by default.

#### **Usage**

* [Guide: Create Tasks](https://docs.othentic.xyz/main/user-guide/network-management/create-tasks)
* [CLI Command Reference: Create Tasks](https://docs.othentic.xyz/main/reference/othentic-cli/network/tasks/create-task-definition)

***

### Minimum Voting Power

**Minimum Voting Power** is the minimum amount of [Voting Power](https://docs.othentic.xyz/main/learn/core-concepts/voting-power) an operator must have to participate in a Task’s execution or attestation.

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.&#x20;

* If an operator attests to a task and has less than the minimum voting power, the task would fail with a `OperatorDoesNotHaveMinimumVotingPower(operatorIndex)`  error.&#x20;
* The AVS Governance Multisig should not set this value too high so that no attester passes the threshold.

#### **Usage**

* [CLI Command Reference: Set minimum voting power for a Task](https://docs.othentic.xyz/main/reference/othentic-cli/network/tasks/set-minimum-voting-power)
* This can be specified when creating the task definition or set using [setTaskDefinitionMinVotingPower](https://docs.othentic.xyz/main/reference/contracts/attestation-center#settaskdefinitionminvotingpower) method in the Attestation center contract.

***

### Restricted Operator Set

AVS can have an unlimited number of tasks, and each task can be executed by different Operator clusters. For certain tasks, you may want to restrict execution to a specific group of operators.

You can define a **restricted operator set**—an "**allowlist**" of operators—who are eligible to execute a particular task.&#x20;

* Only those on the `restrictedOperatorIndexes`list can perform or attest
* If someone outside the list tries, the task will fail with: `InvalidRestrictedOperator`

#### **Usage**

* [CLI Command Reference: Set restricted Operator set for a Task](https://docs.othentic.xyz/main/reference/othentic-cli/network/tasks/set-restricted-operator-set)
* This can be specified when creating the task definition or set using [setTaskDefinitionRestrictedOperators](https://github.com/Othentic-Labs/core-contracts/blob/main/src/NetworkManagement/L2/AttestationCenter.sol#L267) method in the AttestationCenter contract.

***

### Maximum Number of Attesters

You can define a maximum number of Attesters—who are eligible to submit attestations for a particular task.

#### **Usage**

This can be specified when creating the task definition or set using [setTaskDefinitionMaximumNumberOfAttesters](https://docs.othentic.xyz/main/reference/contracts/attestation-center#settaskdefinitionmaximumnumberofattesters) method in the AttestationCenter contract.

***
