Partner adapters for ChaosChain SDK - enabling decentralized storage, compute, and attestation services.
This repository contains adapters (plugins) that integrate partner services with the ChaosChain SDK. Each adapter implements a standard protocol (StorageBackend, ComputeBackend, AttestationBackend) allowing seamless swapping of providers.
| Category | Provider | Status | Install |
|---|---|---|---|
| Storage | ZeroG (0G) | Alpha | [zerog] |
| Storage | IPFS (Pinata) | Alpha | [pinata] |
| Compute | ZeroG (0G) | Alpha | [zerog] |
| Compute | Eigen | Alpha | [eigen] |
| Attestation | Chainlink CRE | Stub | [cre] |
pip install chaoschain-integrations# Install with ZeroG support (storage + compute)
pip install chaoschain-integrations[zerog]
# Install with Eigen compute support
pip install chaoschain-integrations[eigen]
# Install with Pinata IPFS support
pip install chaoschain-integrations[pinata]
# Install with Chainlink CRE support
pip install chaoschain-integrations[cre]
# Install all adapters
pip install chaoschain-integrations[all]
# Install with dev tools
pip install chaoschain-integrations[dev]from chaoschain_sdk import ChaosChainAgentSDK, NetworkConfig
from chaoschain_integrations.storage.zerog import ZeroGStorageAdapter
# Initialize ZeroG storage adapter
storage = ZeroGStorageAdapter(
grpc_url="localhost:50051",
api_key="your_api_key",
)
# Use with ChaosChain SDK
sdk = ChaosChainAgentSDK(
agent_name="MyAgent",
agent_domain="example.com",
agent_role="server",
network=NetworkConfig.ETHEREUM_SEPOLIA,
storage_provider=storage, # Inject adapter
)
# Store evidence
content = b"Important evidence data"
result = storage.put(content)
print(f"Stored at: {result.uri}")
print(f"Proof: {result.proof.content_hash}")
# Retrieve evidence
retrieved = storage.get(result.uri)
assert retrieved == contentfrom chaoschain_integrations.storage.ipfs_pinata import PinataStorageAdapter
# Initialize with JWT
storage = PinataStorageAdapter(jwt="your_pinata_jwt")
# Store to IPFS
result = storage.put(
b"Hello IPFS!",
metadata={"name": "greeting.txt"}
)
print(f"IPFS CID: {result.proof.content_hash}")
print(f"Gateway URLs: {result.alternative_uris}")from chaoschain_sdk import ChaosChainAgentSDK, NetworkConfig
from chaoschain_integrations.compute.eigen import EigenComputeAdapter
# Initialize Eigen compute adapter
compute = EigenComputeAdapter(
api_url="http://localhost:8082",
api_key="your_api_key",
use_grpc=True,
)
# Use with ChaosChain SDK
sdk = ChaosChainAgentSDK(
agent_name="EigenAgent",
agent_domain="example.com",
agent_role="server",
network=NetworkConfig.ETHEREUM_SEPOLIA,
compute_provider=compute, # Inject adapter
enable_process_integrity=True,
)
# Submit ML inference job
task = {
"task": "inference",
"model": "llama-3-70b",
"prompt": "Explain blockchain in simple terms",
"verification": "tee-ml",
}
job_id = compute.submit(task)
result = compute.result(job_id, wait=True, timeout_s=600)
print(f"Output: {result.output}")
print(f"TEE Attestation: {result.proof.attestation}")
print(f"Enclave Key: {result.proof.enclave_pubkey}")Adapters are pluggable - swap providers without changing your application code:
# Use ZeroG storage
from chaoschain_integrations.storage.zerog import ZeroGStorageAdapter
storage = ZeroGStorageAdapter(grpc_url="localhost:50051")
# Or use Pinata IPFS
from chaoschain_integrations.storage.ipfs_pinata import PinataStorageAdapter
storage = PinataStorageAdapter(jwt="your_jwt")
# Your SDK code remains the same!
sdk = ChaosChainAgentSDK(..., storage_provider=storage)All adapters support environment-based configuration via .env files:
# ZeroG
ZEROG_GRPC_URL=localhost:50051
ZEROG_API_KEY=your_key
ZEROG_TIMEOUT_SECONDS=60
# Eigen
EIGEN_API_URL=http://localhost:8082
EIGEN_API_KEY=your_key
EIGEN_USE_GRPC=true
EIGEN_TIMEOUT_SECONDS=600
# Pinata
PINATA_JWT=your_jwt_token
PINATA_TIMEOUT_SECONDS=60
# Chainlink CRE
CRE_API_URL=https://cre-api.chainlink.com
CRE_API_KEY=your_key
CRE_TIMEOUT_SECONDS=30
# Logging
LOG_LEVEL=INFO
LOG_FORMAT=jsonSee .env.example for complete configuration options.
┌─────────────────────────────────────┐
│ ChaosChain Agent SDK │
│ (chaoschain-sdk) │
└──────────┬──────────────────────────┘
│
│ Protocol Interfaces:
│ - StorageBackend
│ - ComputeBackend
│ - AttestationBackend
│
┌──────────▼──────────────────────────┐
│ ChaosChain Integrations (THIS) │
│ ┌────────────┐ ┌────────────┐ │
│ │ Storage │ │ Compute │ │
│ │ Adapters │ │ Adapters │ │
│ ├────────────┤ ├────────────┤ │
│ │ • ZeroG │ │ • ZeroG │ │
│ │ • Pinata │ │ • Eigen │ │
│ └────────────┘ └────────────┘ │
│ ┌────────────┐ │
│ │Attestation │ │
│ ├────────────┤ │
│ │ • CRE │ │
│ └────────────┘ │
└──────────┬──────────────────────────┘
│
│ gRPC/HTTP/Native SDKs
│
┌──────────▼──────────────────────────┐
│ Partner Services │
│ • 0G Network │
│ • Eigen │
│ • Pinata / IPFS │
│ • Chainlink │
└─────────────────────────────────────┘
Some adapters use sidecar services (Go/Rust) to interface with native SDKs:
cd sidecars/zerog/go
make build
./bin/zerog-storage-bridge --port 50051
./bin/zerog-compute-bridge --port 50052cd sidecars/eigen/go
make build
./bin/eigen-compute-bridge --port 50053See sidecars/ documentation for details.
# Clone repository
git clone https://github.com/ChaosChain/chaoschain-integrations.git
cd chaoschain-integrations
# Create virtual environment
make venv
source venv/bin/activate
# Install with dev dependencies
make install-dev# Run all tests
make test
# Run unit tests only
make test-unit
# Run contract tests
make test-contract
# Run with coverage
make test-cov# Format code
make fmt
# Lint code
make lint
# Type check
make typecheck# Build distribution packages
make build
# Publish to PyPI (requires credentials)
make publish- Architecture & Design
- Adding New Adapters
- ZeroG Storage Adapter
- Pinata Storage Adapter
- ZeroG Compute Adapter
- Eigen Compute Adapter
- Chainlink CRE Adapter
| Integration Version | ChaosChain SDK | Python | Status |
|---|---|---|---|
| 0.1.0 | >=0.2.0 | 3.9-3.12 | Alpha |
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Create adapter module:
chaoschain_integrations/<category>/<provider>/ - Implement protocol:
StorageBackend,ComputeBackend, orAttestationBackend - Add tests (unit + contract tests)
- Update
pyproject.tomlwith optional dependencies - Submit PR
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs.chaoschain.io
- 0G Labs - Decentralized storage and compute
- EigenLayer - Restaking and compute
- Pinata - IPFS pinning services
- Chainlink - Decentralized oracle network
Built with ❤️ by the ChaosChain Labs team