Othentic
  • Introduction
    • Introducing Othentic Stack
    • Use Cases
  • AVS Framework
    • Abstract
    • Quick Start
    • Othentic CLI
      • Key Management
      • Contracts Deployment
      • Operator Registration
      • AVS Logic Implementation
      • Operator Deposit
      • Node Operators
      • Rewards Distribution
      • P2P Config
        • Custom P2P Messaging
        • P2P Auth Layer
        • Metrics and Monitoring
        • Logging
        • Persistent storage
        • Latency
      • CLI Command Reference
    • Smart Contracts
      • AVS Governance
      • Attestation Center
      • Hooks
        • Task Logic
        • Operator Management
        • Rewards Fee Calculator
      • OBLS
      • Othentic Registry
      • Message Handlers
    • Othentic Consensus
      • Abstract
      • Task & Task Definitions
      • Leader Election
      • Proof of Task
      • Execution Service
      • Validation Service
      • Voting Power
      • Rewards and Penalties
      • Internal Tasks
    • FAQ
    • Supported Networks
    • Explainers
      • Networking
      • Multichain
      • Production Guidelines
      • Operator Allowlisting
      • Governance Multisig
  • External
    • AVS Examples
  • GitHub
  • Othentic Hub
Powered by GitBook
On this page
  • Overview
  • Building your Validation Service
  • AVS Boilerplates
  • Example Use Cases
  1. AVS Framework
  2. Othentic Consensus

Validation Service

PreviousExecution ServiceNextVoting Power

Last updated 3 days ago

Overview

The Validation Service is a container with the task validation logic that can be called by the Attester nodes. It acts as a micro-service for validating tasks and can be written in any programming language.

Key Responsibilities

  • Task Validation: Execute verification logic specific to the task.

  • Response Generation: Based on the task verification, the service returns either an approval or rejection response.

When the Performer node sends a task to the P2P network to Task Attesters for validation, the Attesters interact with the Validation Service endpoint to verify and validate the task.

When the Task Attesters are spin up, Othentic CLI internally handles the process of receiving tasks, interacting with the validation service, and sending signed responses back to the P2P network.

Building your Validation Service

1

Task validation logic

Your service should:

  • Receive requests containing task details for validation.

  • Execute the task validation logic.

  • Return a response, either approving or rejecting the task.

The Validation Service uses the task details to verify whether the task was executed as expected. If an issue arises during the validation process, the service returns a custom error message and appropriate HTTP status codes (e.g., 500 for server errors).

Attesters can only return a signed approval or rejection and are not authorized to change or edit the task details.

2

Expose an API endpoint

Define an endpoint (/task/validate) that allows operator nodes (Attesters) to trigger task validation. This endpoint should accept parameters such as proofOfTask and other task-specific data to validate the task.

POST /task/validate

Headers

Name
Value

Content-Type

application/json

Body

Parameter
Type
Description

string

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

data

string

Represent an additional data to be added to the consensus

taskDefinitionID

uint16

performer

address

The address of the Task Performer

Response The validation service should return responses in the following structure, based on the validation outcome:

  • data: Indicates the validation result (true for approval, false otherwise).

  • error: Boolean value indicating whether an error occurred.

  • message: Contains additional context; typically null for successful responses or a descriptive error message for failures.

{ 
    "data": true,
    "error": false,
    "message": null 
}
{ 
    "data": false,
    "error": false,
    "message": null 
}
{ 
    "data": null,
    "error": true,
    "message": "Something went wrong"
}
3

Containerization with Docker

Each Task Attester must spin up its own Validation Service and perform local endpoint calls to ensure an immutable and distributed task validation process.

4

Specifying the IPv4 Address for Task Attester Nodes

--avs-webapi "http://<Validation_Service_IP>"

AVS Boilerplates

In the Price Oracle example, the Validation Service exposes the /task/validate endpoint in an express server that the Attesters can call.

The Attester node calls the endpoint to initiate the validation logic. In the Price Oracle example, the Validation Service fetches the data source price and matches the result with the corresponding results of the Task Performer. If the results are within a defined threshold or margin of error, the service approves the task and returns it back to the Attester, which signs the response and propagates its attestation back to the network for aggregation discovery.

Example Use Cases

In this AVS, The Validation Service cross-checks task execution results with an oracle-derived fee estimate to ensure accuracy. It retrieves the proof of task data from IPFS and fetches the expected fee from the oracle. The service then establishes an acceptable range, allowing a 5% deviation from the expected fee. If the fee falls within this range, the validation succeeds.

In this AVS, the Validation Service ensures the integrity of parallel execution by verifying that proposed transaction batches are valid and collision-free. It retrieves task results from IPFS and computes a SHA-256 hash of the block data. This computed hash is then compared with the provided block hash to validate the task execution. If the hashes match, the validation succeeds, proving that the batch was correctly processed.

In this AVS, the Validation Service independently verifies proof of task using the Llama-3-8B-262k model while utilizing distinct AI models from the Execution Service to prevent collusion. It enforces strict validation rules to ensure prediction accuracy. If the results fall within a predefined threshold or margin of error, the service approves the task and returns it to the Attester.

The Validation Service verifies the proof of task by independently validating task results against oracle-computed values. It processes tensor data from serialized byte formats and reconstructs multi-dimensional arrays for comparison. To prevent collusion, it utilizes different AI models than the Execution Service. Using the Manhattan distance metric, the service measures the discrepancy between the submitted proof of task and the oracle’s computed result. If the difference falls within a predefined threshold, the task is approved and sent back to the Attester.

The Validation Service verifies a task by comparing a provided proofOfTask with a hashed value derived from a DNS public key. The service fetches the public key for the domain using the dnsService.getDnsPubKey function and hashes it using the Keccak256 algorithm. If the hash matches the provided proof, the task is considered approved. If any issues arise during this process, the service returns null.

This guide explains how to create your own Validation Service, using the as a reference.

The ID of specific

The Validation Service should be containerized using Docker for ease of deployment and scalability. This ensures the service is isolated and easily managed, replicated, and scaled across different environments. Refer to the in the Simple Price Oracle AVS repository for guidance on how to set up your containerized service.

When configuring the Task Attester nodes in the Docker file, you must specify the server using the --avs-webapi . This ensures that the Task Attesters can properly connect to the Validation Service for task validation. For example, in the Docker configuration, the --avs-webapi argument should be set as follows:

Simple Price Oracle AVS Example
example
IPv4 address of the Validation Service
argument
Simple Price Oracle AVS Example JS
Simple Price Oracle AVS Example Go
Simple Price Oracle AVS Example Rust
Uniswap Dynamic Fee
Parallel EVM Transactions
AI Powered Prediction Markets
Distributed GPU
DNS Registry AVS
proofOfTask
Task definition