Skip to content

Hyra Network SDK Documentation

Decentralized AI Inference Platform

Hyra Network is a fully decentralized AI inference platform that enables users to request AI model inference, AI workers to process tasks, and verifiers to validate results using Zero-Knowledge Proofs (ZKP). The entire system operates 100% on-chain with native HYRA token payments and automatic task creation.

Zero-Knowledge Proofs

Built-in ZKP verification prevents AI workers from cheating and ensures result integrity.

High Privacy

Task input and output are encrypted before submission to smart contracts for maximum privacy.

Fully Decentralized

No single point of failure - all operations are handled by smart contracts on the blockchain.

Native HYRA Payments

Pay and earn with HYRA tokens, the native currency of the Hyra Network.

Automatic Task Creation

Tasks are created automatically when users request AI inference - no manual intervention needed.

Multi-Pool Architecture

Scalable architecture with multiple task pools for high throughput and load balancing.

  • Claim Tasks: Get AI inference tasks from the marketplace
  • Process Models: Run AI models and generate results
  • Submit Proofs: Submit results with ZKP proofs for verification
  • Earn Rewards: Receive HYRA tokens for completed tasks
  • Request Inference: Request AI model inference with simple API calls
  • Pay with HYRA: Pay for AI services using native HYRA tokens
  • Get Results: Receive AI results directly from smart contracts
  • Transparent Pricing: Clear cost calculation and payment structure
  • Validate ZKP Proofs: Verify Zero-Knowledge Proofs to ensure result integrity
  • Distribute Rewards: Pay HYRA tokens to AI workers for valid results
  • Update Results: Update ModelRegistry with verified results
  • Maintain Quality: Ensure high-quality AI inference across the network

The Hyra Network consists of five core smart contracts that work together:

  • ModelRegistry: Manages AI models and user inference requests
  • TaskPoolFactory: Creates and manages task pools using minimal proxy pattern
  • TaskPoolImplementation: Core task management with ZKP verification
  • TaskRouter: Central router for efficient task discovery and distribution
  • TaskPoolViewer: Utility contract for monitoring and analytics

Overview

Learn about the Hyra Network platform and how it works.

Installation

Install the Python or Node.js SDK to start building.

Claim Tasks

Learn how to claim AI inference tasks from the marketplace.

Process Tasks

Understand how to process AI tasks and generate results.

Submit Tasks

Submit completed tasks with ZKP proofs for verification.

Monitor Rewards

Track your earnings and performance across the network.

Blockchain Layer 3

Learn about the Hyra Network’s Layer 3 architecture and HYRA token economics.

Distributed AI Network

Understand the transition from centralized to fully decentralized AI infrastructure.

Zero-Knowledge Proofs

Explore how ZKP prevents cheating and ensures result integrity.

Encryption

Learn about AES and asymmetric encryption for task privacy.

Two-Phase Encryption

Understand the complete encryption workflow for secure task processing.

Overview

Complete smart contract architecture and workflow overview.

Model Registry

AI model management and user inference request handling.

Task Pool

Core task management with ZKP verification and reward distribution.

Task Router

Central router for efficient task discovery and distribution.

Task Pool Factory

Factory contract for creating and managing task pools.

Python SDK

Complete Python SDK reference with examples and API documentation.

Node.js SDK

Full Node.js/TypeScript SDK with type safety and advanced features.

from hyra_sdk import HyraClient
# Initialize client
client = HyraClient()
# Claim a task
task = client.claim_task()
print(f"Task ID: {task['task_id']}")
print(f"Model: {task['model_name']}")
print(f"Input: {task['input_data']}")
# Submit result
result = "Your AI-generated response here"
submit_hash = client.submit_task(
task['task_id'],
result,
task['pool_address']
)
print(f"Submission hash: {submit_hash}")
import { HyraClient } from "hyra-sdk";
// Initialize client
const client = new HyraClient();
// Claim a task
const task = await client.claimTask();
console.log(`Task ID: ${task.taskId}`);
console.log(`Model: ${task.modelName}`);
console.log(`Input: ${task.inputData}`);
// Submit result
const result = "Your AI-generated response here";
const submitHash = await client.submitTask(
task.taskId,
result,
task.poolAddress
);
console.log(`Submission hash: ${submitHash}`);

Discord

Join our Discord community for support and discussions.

GitHub

Contribute to the open-source Hyra Network ecosystem.

Twitter

Follow us on Twitter for the latest updates.

Telegram

Join our Telegram channel for announcements.

Ready to start building on Hyra Network? Here’s your path forward:

  1. 📖 Read the Overview - Understand the platform architecture
  2. 🛠️ Install an SDK - Choose Python or Node.js and get started
  3. 🎯 Claim Your First Task - Start earning HYRA tokens
  4. 🔐 Learn About Security - Understand ZKP and encryption
  5. 🏗️ Explore Smart Contracts - Dive deep into the technical details

Built with ❤️ by the Hyra team

Hyra Network - Building the future of decentralized AI inference! 🚀