Skip to main content

Production-ready Python SDK for launching, monetizing, and orchestrating AI Agents via ERC-8004

Project description

0rca Network SDK

PyPI version License: MIT

0rca Network SDK (orca-network-sdk) is a production-ready framework for building Sovereign, Monetizable, and Orchestrated AI Agents. It transforms standard AI agents (CrewAI, LangChain, Agno) into independent economic actors on the blockchain.

Every agent built with this SDK is paired with a Sovereign Vault (OrcaAgentVault.sol)—a dedicated smart contract that holds the agent's earnings and manages task escrows.

🚀 Key Features

  • Sovereign Vault Architecture: Each agent has its own on-chain Vault to receive payments and tasks.
  • Autonomous Monetization (x402): Built-in support for "Payment Required" flows.
  • TaskEscrow Integration: Agents can accept "Funded Tasks" (USDC locked in Vault) and automatically spend (claim) funds upon completion.
  • Sovereign Identity: Agents sign transactions with their own EVM identity key.
  • Multi-Backend support: Pluggable architecture for your favorite AI frameworks:

📦 Installation

pip install orca-network-sdk

🛠 Quick Start

1. Create your Agent

from orca_agent_sdk import OrcaAgent

# Initialize the Sovereign Agent
agent = OrcaAgent(
    name="MySovereignAgent",
    model="gpt-4",
    system_prompt="You are a helpful assistant.",
    
    # Financial Configuration
    price="0.1",       # 0.1 USDC per task
    wallet_address="0xYourWallet...", # Where you withdraw earnings to
    
    # Identity
    identity_wallet_path="agent_identity.json",
    
    # Vault (Optional - can be loaded from env AGENT_VAULT)
    vault_address="0xYourVaultAddress..." 
)

# Start the Agent Server
if __name__ == "__main__":
    agent.run(port=8000)

2. Fund a Task (Client Side)

Users (Orchestrators) interact with the agent by funding a task on its Vault.

# 1. User approves USDC to the Agent's Vault
# 2. User calls `createTask(taskId, amount)` on the Vault
# 3. User sends HTTP request to Agent with `X-TASK-ID`

3. Agent Execution (Server Side)

When the agent receives the request:

  1. It validates the tasks existence on-chain (or via x402 signatures).
  2. It executes the AI logic (CrewAI/Agno/etc).
  3. It calls spend(taskId, amount) on its Vault to claim the funds.

📜 Sovereign Agent Vault (OrcaAgentVault.sol)

The OrcaAgentVault is the financial heart of the agent.

  • createTask(bytes32 taskId, uint256 amount): Anyone can call this to lock USDC into the vault for a specific task.

  • spend(bytes32 taskId, uint256 amount): Only the Agent (via its private key) can call this to mark a task as complete and "claim" the funds into its internal balance.

  • withdraw(address recipient, uint256 amount): Only the Owner (Developer) can withdraw the claimed funds.

🧪 Development & Testing

Run the included test suite:

python -m unittest discover tests

📄 License

MIT License. See LICENSE for details.


Built with 💙 by 0rca Network

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orca_network_sdk-1.0.4.tar.gz (70.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orca_network_sdk-1.0.4-py3-none-any.whl (80.4 kB view details)

Uploaded Python 3

File details

Details for the file orca_network_sdk-1.0.4.tar.gz.

File metadata

  • Download URL: orca_network_sdk-1.0.4.tar.gz
  • Upload date:
  • Size: 70.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for orca_network_sdk-1.0.4.tar.gz
Algorithm Hash digest
SHA256 0d7de89c6d6b8238f1dad58cbb453760264d3d9b6ef0989426543a9c3215a66a
MD5 f2da672e8f4cce374b24796b1f59ce61
BLAKE2b-256 fd92e4701f27041589b2d50f5a425485cbbe504b8e6a6fcfcd1b38dc797c381e

See more details on using hashes here.

File details

Details for the file orca_network_sdk-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for orca_network_sdk-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 83272405178fe62b6174b4e326e63d9a4b66c3ae0e905dac9458ad273152e0c9
MD5 75a4dd4578f1c57a3f98663c56d4dd26
BLAKE2b-256 0572c437c269f8a74e8449e1cddbead6ff7ddac2f773f5666dba91f4d6eb5cf9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page