# Attestation Center

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>View Source Code</td><td><a href="https://github.com/Othentic-Labs/core-contracts/blob/main/src/NetworkManagement/L2/AttestationCenter.sol">https://github.com/Othentic-Labs/core-contracts/blob/main/src/NetworkManagement/L2/AttestationCenter.sol</a></td></tr></tbody></table>

## Overview

The Attestation Center is a critical system designed to ensure the integrity and efficiency of AVS operations by bridging off-chain execution with on-chain verification and maintaining a transparent history of all activities involved.

AVS Attestation center contract manages

* Task submission and verification
* Rewards accounting and distribution
* Slashing & Ejection configuration and logic
* Aggregated view of AVS activities
* Creation of new Tasks&#x20;
* Operator interface

## **Write Methods**

### Task Submission

#### For Performer `BLS` signature type

```
 _submitTask(TaskInfo calldata _taskInfo, 
        BLSTaskSubmissionDetails memory _taskSubmissionDetails) 
```

<table><thead><tr><th width="294.44317626953125">Property</th><th width="101.54541015625">Type</th><th>Description</th></tr></thead><tbody><tr><td>TaskInfo.taskDefinitionId</td><td>uint16</td><td>The ID of specific Task definition</td></tr><tr><td>TaskInfo.proofOfTask</td><td>string</td><td><a href="../../learn/core-concepts/tasks/proof-of-task">ProofOfTask</a>: any string that the Attesters can use to verify that the Performer has executed its task as expected</td></tr><tr><td>TaskInfo.data</td><td>bytes</td><td>Any auxiliary/metadata required by the AVS or the service consumer to be verified</td></tr><tr><td>TaskInfo.taskPerformer</td><td>address</td><td>The address of the Task Performer</td></tr><tr><td>TaskSubmissionDetails._isApproved</td><td>bool</td><td>Indicate if a task has been approved or rejected by the Attesters</td></tr><tr><td>TaskSubmissionDetails._tpSignature</td><td>uint256[2]</td><td>Task Performer <strong>BLS</strong> signature</td></tr><tr><td>TaskSubmissionDetails._taSignature</td><td>uint256[2]</td><td>Task Attesters BLS aggregated signature</td></tr><tr><td>TaskSubmissionDetails._operatorIds</td><td>uint256[]</td><td>Task Attesters IDs </td></tr></tbody></table>

#### For Performer `ECDSA` signature type

```
 _submitTask(TaskInfo calldata _taskInfo, 
        TaskSubmissionDetails memory _taskSubmissionDetails) 
```

<table><thead><tr><th width="294.40765380859375">Property</th><th width="122">Type</th><th>Description</th></tr></thead><tbody><tr><td>TaskInfo.taskDefinitionId</td><td>uint16</td><td>The ID of specific Task definition</td></tr><tr><td>TaskInfo.proofOfTask</td><td>string</td><td><a href="../../learn/core-concepts/tasks/proof-of-task">ProofOfTask</a>: any string that the Attesters can use to verify that the Performer has executed its task as expected</td></tr><tr><td>TaskInfo.data</td><td>bytes</td><td>Any auxiliary/metadata required by the AVS or the service consumer to be verified</td></tr><tr><td>TaskInfo.taskPerformer</td><td>address</td><td>The address of the Task Performer</td></tr><tr><td>TaskSubmissionDetails._isApproved</td><td>bool</td><td>Indicate if a task has been approved or rejected by the Attesters</td></tr><tr><td>TaskSubmissionDetails._tpSignature</td><td>bytes</td><td>Task Performer <strong>ECDSA</strong> signature</td></tr><tr><td>TaskSubmissionDetails._taSignature</td><td>uint256[2]</td><td>Task Attesters BLS aggregated signature</td></tr><tr><td>TaskSubmissionDetails._operatorIds</td><td>uint256[]</td><td>Task Attesters IDs </td></tr></tbody></table>

The [submitTask](https://github.com/Othentic-Labs/core-contracts/blob/main/src/NetworkManagement/L2/AttestationCenter.sol#L76) function is responsible for handling the submission of tasks in a decentralized system, with multiple steps to ensure the validity and proper handling of task data, signatures, and rewards. It performs the following key actions:

1. **Pre-Processing (Optional)**: If an `avsLogic` hook is set, it calls `beforeTaskSubmission` for pre-processing.
2. **Task Validation**: Validates the task's signature and checks if the task has already been signed.
3. **Signature Verification**: Verifies the `taskPerformer`'s signature and checks the aggregated signature.
4. **Task Definition validation**: Validates the task definition and checks for any restrictions.
5. **Fee Calculation**: Calculates base reward fees for attesters, performers, and aggregators using the fee calculator system. If a [fee calculator](https://docs.othentic.xyz/main/learn/advanced-concepts/hooks/rewards-fee-calculator) is set, it computes the appropriate rewards based on the task's definition and submission details.
6. **State Update**: Marks the task as "signed" and optionally calls `afterTaskSubmission` for post-processing.

***

### Task Definitions&#x20;

Othentic Stack enables AVS developers to configure tasks for operators to execute, each with customizable parameters, rewards, security levels, number of operators, and operator clusters.

#### [setTaskDefinitionMinVotingPower](https://github.com/Othentic-Labs/core-contracts/blob/main/src/NetworkManagement/L2/AttestationCenter.sol#L259)

#### Sets Minimum Voting power for a Task

| Parameter            | Type    | Description                   |
| -------------------- | ------- | ----------------------------- |
| \_taskDefinitionId   | uint16  | Task Definition ID            |
| \_minimumVotingPower | uint256 | Minimum Voting Power (in wei) |

* 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.

#### [setTaskDefinitionRestrictedOperators](https://github.com/Othentic-Labs/core-contracts/blob/main/src/NetworkManagement/L2/AttestationCenter.sol#L267)

#### Sets Restricted Operator Set for a Task

| Parameter                   | Type       | Description             |
| --------------------------- | ---------- | ----------------------- |
| \_taskDefinitionId          | uint16     | Task Definition ID      |
| \_restrictedOperatorIndexes | uint256\[] | Restricted Operator Set |

#### setTaskDefinitionMaximumNumberOfAttesters

<table><thead><tr><th>Parameter</th><th width="119.6171875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_taskDefinitionId</td><td>uint16</td><td>Task Definition ID</td></tr><tr><td>_maximumNumberOfAttesters</td><td>uint256</td><td>Maximum number of Attesters</td></tr></tbody></table>

***

### Hooks Configuration

#### setAvsLogic(IAVSLogic)

Set the AVS Logic Hook contract. Learn more [here](https://docs.othentic.xyz/main/learn/advanced-concepts/hooks/task-logic).

<table><thead><tr><th width="177.55078125">Property</th><th width="118.38671875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_avsLogic</td><td>IAvsLogic</td><td>AVS Logic Hook contract address</td></tr></tbody></table>

#### setFeeCalculator

Sets the fee calculator hook contract. Lean more [here](https://docs.othentic.xyz/main/learn/advanced-concepts/hooks/rewards-fee-calculator).

<table><thead><tr><th width="194.38671875">Property</th><th width="151.7890625">Type</th><th>Description</th></tr></thead><tbody><tr><td>_feeCalculator</td><td>IFeeCalculator</td><td>The fee calculator contract to be set</td></tr></tbody></table>

***

#### updateBLSKey

Updates the [BLS key ](https://docs.othentic.xyz/main/learn/advanced-concepts/key-management)for the operator(uint256\[], signature)

<table><thead><tr><th width="160.98828125">Property</th><th width="226.26953125">Type</th><th>Description</th></tr></thead><tbody><tr><td>_blsKey</td><td>uint256[]</td><td>The new BLS key to be set for the operator</td></tr><tr><td>_authSignature</td><td>BLSAuthLibrary.Signature</td><td>The authentication signature used to verify the update request</td></tr></tbody></table>

#### setOblsSharesSyncer(address)

Set OBLS shares syncer address.

<table><thead><tr><th>Property</th><th width="118.38671875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_oblsSharesSyncer</td><td>address</td><td>Syncer Address </td></tr></tbody></table>

***

### Rewards functions

#### requestBatchPayment&#x20;

Executes batch reward distribution over the **entire active operator set**, i.e., from `1` to `numOfTotalOperators`.

<table><thead><tr><th width="194.8828125">Property</th><th width="157.3359375">Type</th><th>Description</th></tr></thead><tbody><tr><td>_submissionType</td><td>SubmissionType</td><td>Distribution method as defined by <code>IRewardsDistributor</code></td></tr><tr><td>_distributionData</td><td>bytes</td><td>Custom reward data payload</td></tr></tbody></table>

#### requestBatchPayment (Operator subset)

Executes batch reward distribution to a **subset of the operator list.**

<table><thead><tr><th width="207.421875">Property</th><th width="151.19921875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_from</td><td>uint256</td><td>Starting operator index (inclusive)</td></tr><tr><td>_to</td><td>uint256</td><td>Ending operator index (inclusive)</td></tr><tr><td>_submissionType</td><td>SubmissionType</td><td>Distribution method as defined by <code>IRewardsDistributor</code></td></tr><tr><td>_distributionData</td><td>bytes</td><td>Custom reward data payload</td></tr></tbody></table>

{% hint style="success" %}
The above two functions are only callable by AVS Governance Multisig or `PAYMENT_REQUESTS` role.&#x20;
{% endhint %}

#### setPaymentRequestsRole

This function sets a new account for handling **payment requests** in the AVS.&#x20;

<table><thead><tr><th width="194.8828125">Property</th><th width="157.3359375">Type</th><th>Description</th></tr></thead><tbody><tr><td>_newPaymentRequestsAdmin</td><td>address</td><td>The address to be granted the PAYMENT_REQUESTS role.</td></tr></tbody></table>

***

## View Functions

### **AVS Contracts**

<table><thead><tr><th width="270.91015625">function</th><th>description</th></tr></thead><tbody><tr><td>internalTaskHandler()</td><td>Returns the address of the internal task handler contract</td></tr><tr><td>obls()</td><td>Returns the address of the on-chain BLS contract</td></tr><tr><td>avsTreasury()</td><td>Returns the address of the AVS treasury</td></tr><tr><td>EXTENSION_IMPLEMENTATION</td><td>Returns the address of the extension contract exposing additional functions.</td></tr></tbody></table>

### **Tasks**

<table><thead><tr><th width="382.48089599609375">function</th><th>description</th></tr></thead><tbody><tr><td>taskNumber()</td><td>Returns the total number of tasks</td></tr><tr><td>numOfTaskDefinitions()</td><td>Returns the total number of task definitions</td></tr><tr><td>getTaskDefinitionMinimumVotingPower()</td><td>Returns the minimum voting power required for a given task definition</td></tr><tr><td>getTaskDefinitionRestrictedAttesters()</td><td>Returns the list of restricted attester IDs for a given task definition</td></tr><tr><td>getTaskDefinitionMaximumNumberOfAttesters()</td><td>Returns the maximum number of attesters allowed for a given task definition</td></tr></tbody></table>

### **Hooks**&#x20;

<table><thead><tr><th width="221.1328125"></th><th></th></tr></thead><tbody><tr><td>avsLogic()</td><td>Returns the address of the AVS logic contract</td></tr><tr><td>beforePaymentsLogic()</td><td>Returns the address of the before-payments logic contract</td></tr></tbody></table>

### Operators

<table><thead><tr><th width="223.68072509765625">function</th><th>description</th></tr></thead><tbody><tr><td>numOfTotalOperators</td><td>Returns the total number of operators, including unregistered ones</td></tr><tr><td>numOfActiveOperators</td><td>Returns the number of currently active operators</td></tr><tr><td>getActiveOperatorsDetails</td><td>Returns an array containing details of all active operators, including their address, ID, and voting power</td></tr><tr><td>operatorsIdsByAddress</td><td>Returns the operator ID associated with the given operator address</td></tr><tr><td>getOperatorPaymentDetail</td><td>Returns the payment details for a given operator ID</td></tr><tr><td>votingPower(address)</td><td>Get <a href="../../learn/core-concepts/voting-power">Voting Power</a> for an Operator. </td></tr></tbody></table>

#### **verifyOperatorValidForTaskDefinition**

Verifies whether an operator meets the requirements for a given task definition, including minimum voting power.

<table><thead><tr><th width="172.25390625">Property</th><th width="118.38671875">Type</th><th>Description</th></tr></thead><tbody><tr><td>_operator</td><td>address</td><td>The address of the operator</td></tr><tr><td>_taskDefinitionId</td><td>uint16</td><td>The ID of the task definition to validate against</td></tr></tbody></table>

***

## Slashing Functions

### Roles Configuration

These functions are only callable by the governance multisig `AVS_GOVERNANCE_MULTISIG` role.

<table><thead><tr><th width="296.58203125">Function</th><th>Description</th></tr></thead><tbody><tr><td>setEjector(address _ejector)</td><td>Set <code>EJECTOR</code> role</td></tr><tr><td>revokeEjector(address _ejector)</td><td>Revoke <code>EJECTOR</code> role</td></tr><tr><td>setSlasher(address _slasher)</td><td>Set <code>SLASHER</code> role</td></tr><tr><td>revokeSlasher(address _slasher)</td><td>Revoke <code>SLASHER</code> role</td></tr></tbody></table>

***

### Task-Specific Slashing Configuration

If a Task's execution or validation logic is still being tested or isn't fully deterministic, slashing should be disabled until it's production-ready.

#### setIsRejectedTaskSlashingEnabled

Enable or disable [**Rejected Task**](https://docs.othentic.xyz/main/learn/core-concepts/slashing-and-ejection/modules#id-2.-rejected-task) slashing condition for a given task definition Id.

```solidity
function setIsRejectedTaskSlashingEnabled(
    uint16 _taskDefinitionId,
    bool _enabled
)
```

<table><thead><tr><th width="183.21484375">Parameter</th><th width="126.43359375">Type</th><th>Description</th></tr></thead><tbody><tr><td>_taskDefinitionId</td><td>uint16</td><td><a href="../../learn/core-concepts/tasks/task-definitions">Task Definition Id</a></td></tr><tr><td>_enabled</td><td>bool</td><td>Enable/ disable this slashing condition</td></tr></tbody></table>

#### setIsIncorrectAttestationSlashingEnabled

Enable or disable [**Incorrect Attestation**](https://docs.othentic.xyz/main/learn/core-concepts/slashing-and-ejection/modules#id-3.-incorrect-attestations) slashing condition for a given task definition Id.

<pre class="language-solidity"><code class="lang-solidity">
<strong>function setIsIncorrectAttestationSlashingEnabled(
</strong><strong>    uint16 _taskDefinitionId,
</strong><strong>    bool _enabled
</strong><strong>)
</strong></code></pre>

<table><thead><tr><th width="183.21484375">Parameter</th><th width="126.43359375">Type</th><th>Description</th></tr></thead><tbody><tr><td>_taskDefinitionId</td><td>uint16</td><td><a href="../../learn/core-concepts/tasks/task-definitions">Task Definition Id</a></td></tr><tr><td>_enabled</td><td>bool</td><td>Enable/ disable this slashing condition</td></tr></tbody></table>

***

### [Challenger System](https://docs.othentic.xyz/main/learn/core-concepts/slashing-and-ejection/modules#challenger-system)

#### setChallengerRewardFee

This function is used to configure reward amount that a successful challenger receives when they submit a valid slashing proof.

```solidity
function setChallengerRewardFee(uint256 _challengerRewardFee)
```

<table><thead><tr><th width="197.58203125">Parameter</th><th width="129.48828125">Type</th><th>Description</th></tr></thead><tbody><tr><td>_challengerRewardFee</td><td>uint256</td><td>Sets the incentive (in wei units) </td></tr></tbody></table>

#### slashOperatorForIncorrectAttestation

```solidity
function slashOperatorForIncorrectAttestation(
    IncorrectAttestationSlashingDetails _details,
    TaskInfo _taskInfo
)
```

**Parameters:**

* `_details`: `IncorrectAttestationSlashingDetails` struct containing<br>

  <table><thead><tr><th width="170.109375">Parameter</th><th width="142.55078125">Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>address</td><td>The address of the operator being accused of submitting an incorrect attestation.</td></tr><tr><td>isApproved</td><td>bool</td><td>The final consensus result for the task — <code>true</code> if the task was approved, <code>false</code> if rejected. Used to validate that the operator’s attestation contradicts this result.</td></tr><tr><td>incorrectSignature</td><td>uint256[2]</td><td>The signature submitted by the operator in their attestation (typically an ECDSA signature, broken into 2 parts: r and s).</td></tr><tr><td>taSignature</td><td>uint256[2]</td><td>The signature from the Task Authority or consensus verifier confirming the final result (isApproved). Serves as the deterministic proof of what the correct attestation should have been.</td></tr><tr><td>attesterIds</td><td>uint256[]</td><td>A list of attester IDs who participated in the consensus. Used to verify that a consensus was properly formed and that the operator's attestation deviates from it.</td></tr></tbody></table>
* `_taskInfo`: `TaskInfo`  Struct containing

  <table><thead><tr><th width="152.671875">Parameter</th><th width="142.68359375">Type</th><th>Description</th></tr></thead><tbody><tr><td>proofOfTask</td><td>string</td><td><a href="../../learn/core-concepts/tasks/proof-of-task">Proof Of Task</a></td></tr><tr><td>data</td><td>bytes</td><td>Additional Task Data  </td></tr><tr><td>taskPerformer</td><td>address</td><td>Address of the Task <a href="../../../learn/core-concepts/operator-roles#performers">Performer</a></td></tr><tr><td>taskDefinitionId</td><td>uint16</td><td><a href="../../learn/core-concepts/tasks/task-definitions">Task definition ID</a> (to check if slashing is enabled)</td></tr></tbody></table>

#### slashOperatorForDoubleAttestation

```solidity
function slashOperatorForDoubleAttestation(
    DoubleAttestationSlashingDetails _details,
    TaskInfo _taskInfo
)
```

**Parameters:**

* `_details`: `DoubleAttestationSlashingDetails` struct containing

  <table><thead><tr><th width="206.15234375">Parameter</th><th width="109.609375">Type</th><th>Description</th></tr></thead><tbody><tr><td>operator</td><td>address</td><td>The address of the operator being accused of submitting an incorrect attestation.</td></tr><tr><td>trueBlsSignature</td><td>uint256[2]</td><td>The BLS signature corresponding to the <code>true</code> attestation </td></tr><tr><td>falseBlsSignature</td><td>uint256[2]</td><td>The BLS signature corresponding to the <code>false</code> attestation</td></tr></tbody></table>
* `_taskInfo`: `TaskInfo` struct containing<br>

  <table><thead><tr><th width="152.671875">Parameter</th><th width="142.68359375">Type</th><th>Description</th></tr></thead><tbody><tr><td>proofOfTask</td><td>string</td><td><a href="../../learn/core-concepts/tasks/proof-of-task">Proof Of Task</a></td></tr><tr><td>data</td><td>bytes</td><td>Additional Task Data </td></tr><tr><td>taskPerformer</td><td>address</td><td>Address of the Task <a href="../../../learn/core-concepts/operator-roles#performers">Performer</a></td></tr><tr><td>taskDefinitionId</td><td>uint16</td><td><a href="../../learn/core-concepts/tasks/task-definitions">Task definition ID</a> (to check if slashing is enabled)</td></tr></tbody></table>

***

### Custom Slashing

#### ejectOperatorFromNetwork

Immediately removes the operator from the AVS network.&#x20;

```solidity
function ejectOperatorFromNetwork(address _operator) external;
```

<table><thead><tr><th width="135.265625">Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>_operator</td><td>address</td><td>The address of the operator to be ejected from the AVS.</td></tr></tbody></table>

#### applyCustomSlashing

Directly slashes a custom amount of stake from the operator across one more staking contracts.

```solidity
function applyCustomSlashing(address _operator,
    SlashingContractInfo[] memory _slashingContractInfos) 
```

**Parameters:**

* `_operator` (address) - the address of the operator to be slashed
* `_slashingContractInfos` (SlashingContractInfo\[]) - a list of structs defining how much stake to slash from which staking contracts. Each entry specifies:

<table><thead><tr><th width="205.53125">Parameter</th><th width="142.41796875">Type</th><th>Description</th></tr></thead><tbody><tr><td>stakingContract</td><td>address</td><td>The staking contract from which stake will be slashed.</td></tr><tr><td>sharedSecurityProvider</td><td>SharedSecurityProvider</td><td> Use <code>0</code> for Eigen Layer</td></tr><tr><td>wadsToSlash</td><td>uint256</td><td>The amount of stake to slash, denominated in 18 decimals (e.g., <code>1e18</code> represents 1 token).</td></tr></tbody></table>
