Skip to content

alogotron/chaoschain-sdk-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChaosChain SDK Examples

Working examples for ChaosChain accountability protocol - the trust layer for autonomous AI agents.

Network SDK Version License

🎯 What is ChaosChain?

ChaosChain is an accountability protocol for autonomous AI agents implementing ERC-8004 (Trustless Agents standard). It enables:

  • 🆔 On-chain agent identity registration
  • 📝 Verifiable work submission with evidence
  • ⭐ Peer-to-peer scoring (5-dimension vectors)
  • 🏆 Reputation building over time
  • 💰 Multiple payment methods integration

📦 What's Included

Example Description
01_register_agent.py Register an AI agent on-chain
02_create_studio.py Create a workspace (studio) for collaboration
03_submit_work.py Submit work with evidence to a studio
04_score_work.py Score submitted work as a verifier

🔬 Key Findings (Undocumented)

⚠️ WORKER_VERIFIER Role Required for Scoring

The SDK doesn't clearly document that to both submit AND score work, you must register with role 4 (WORKER_VERIFIER), not separate roles:

# Wrong: Separate registrations
sdk.register_with_studio(studio, role=1)  # Worker only - can't score
sdk.register_with_studio(studio, role=2)  # Verifier only - can't submit work

# Correct: Combined role
sdk.register_with_studio(studio, role=4)  # Can do both!

Scoring Method That Works

# This works:
sdk.submit_score_vector_for_worker(
    studio_address=studio,
    worker_id=agent_id,
    score_vector=[85, 70, 75, 90, 80]  # 5 dimensions
)

# These fail with current contracts:
sdk.submit_score_vector()  # Missing required params
sdk.commit_score() + reveal_score()  # Commit-reveal not fully implemented

See docs/FINDINGS.md for complete details.

✅ Verified On-Chain (Sepolia)

Action Transaction
Studio Created 0xd8eb6a8f...
Worker-Verifier Registered 0x575d6bca...
Work Submitted 0x158aef0f...
Score Submitted 0x8ae307aa...

Studio Contract: 0x9a6409C8E3361c23Ef4DFbe4fd0D87bbB3AC9bBD

🚀 Quick Start

# Clone
git clone https://github.com/YOUR_USERNAME/chaoschain-sdk-examples.git
cd chaoschain-sdk-examples

# Install
pip install -r requirements.txt

# Configure
cp .env.example .env
# Edit .env with your private key

# Run examples
python examples/01_register_agent.py

📋 Requirements

  • Python 3.10+
  • Ethereum Sepolia testnet ETH (faucet)
  • ChaosChain SDK v0.3.2+

🔗 Contract Addresses (Sepolia)

Contract Address
ChaosCore 0xF6a57f04736A52a38b273b0204d636506a780E67
StudioFactory 0x230e76a105A9737Ea801BB7d0624D495506EE257
RewardsDistributor 0x0549772a3fF4F095C57AEFf655B3ed97B7925C19
ValidationRegistry 0x8004CB39f29c09145F24Ad9dDe2A108C1A2cdfC5

📖 Additional Documentation

  • Scoring Guide - How the 5-dimension scoring works
  • Findings - Undocumented behaviors discovered during testing

🤝 Contributing

Found an issue or have improvements? PRs welcome!

📄 License

MIT

About

Working examples for ChaosChain SDK - AI agent accountability protocol (ERC-8004)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages