Skip to content

XSpoonAi/spoon-did

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spoon-did

CLI & Python SDK for interacting with Spoon ERC-8004 registries (identity / reputation / validation) and off-chain DID storage.

Install from PyPI:

pip install spoon-did

Features

  • Deploy or connect to ERC-8004 registries (Identity, Reputation, Validation).
  • Submit feedback / validation for agents.
  • Resolve DID + AgentCard stored in NeoFS/IPFS using spoon_ai.identity.storage_client.DIDStorageClient.
  • Thin CLI for ops workflows; Python API for integrations.

CLI Usage

After pip install spoon-did, the spoon-did entrypoint is available.

  • spoon-did give-feedback — build feedbackAuth locally and submit feedback (score 0-100, tag1/tag2, evidence URI/hash).
  • spoon-did validation-request — create validation request for an agent.
  • spoon-did validation-response — submit validator response (0-100, optional tag/evidence).

Python API (as installed package)

from spoon_ai.identity.erc8004_client import ERC8004Client
from spoon_ai.identity.storage_client import DIDStorageClient

client = ERC8004Client(
    rpc_url="https://testnet.rpc.banelabs.org",
    identity_addr="0xaB5623F3DD66f2a52027FA06007C78c7b0E63508",
    reputation_addr="0x8bb086D12659D6e2c7220b07152255d10b2fB049",
    validation_addr="0x18A9240c99c7283d9332B738f9C6972b5B59aEc2",
    private_key=os.environ["PRIVATE_KEY"],
)

storage = DIDStorageClient(
    neofs_url=os.getenv("NEOFS_BASE_URL"),
    neofs_owner=os.getenv("NEOFS_OWNER_ADDRESS"),
    neofs_private_key=os.getenv("NEOFS_PRIVATE_KEY_WIF"),
    neofs_container=os.getenv("NEOFS_DID_CONTAINER"),
    ipfs_api=os.getenv("IPFS_API_URL", "http://127.0.0.1:5001"),
    ipfs_gateway=os.getenv("IPFS_GATEWAY_URL", "http://127.0.0.1:8080"),
)

# Publish DID + AgentCard
did_uri, card_uri = storage.publish_did_document(
    "react-onchain",
    {"id": "did:spoon:agent:react-onchain", "controller": [client.acct.address]},
    {"name": "ReAct Spoon Agent", "capabilities": ["react", "onchain"]},
)

# Register agent on-chain
agent_id = client.register(card_uri)
print("agent id", agent_id, "tokenURI", card_uri)

Configuration (env)

  • PRIVATE_KEY — EOA for tx signing.
  • RPC_URL / CHAIN_ID — target EVM network (e.g., NeoX testnet).
  • IDENTITY_REGISTRY / REPUTATION_REGISTRY / VALIDATION_REGISTRY — optional existing contract addresses; if omitted, CLI can deploy.
  • NEOFS_BASE_URL, NEOFS_OWNER_ADDRESS, NEOFS_PRIVATE_KEY_WIF, NEOFS_DID_CONTAINER — for NeoFS storage; IPFS gateway/daemon optional fallback.

Repo layout

  • spoon_did/ — CLI & packaging.
  • contracts/ — Solidity registries (ERC-8004).
  • contracts/test — Foundry tests.

Quickstart (CLI)

export RPC_URL=https://testnet.rpc.banelabs.org
export PRIVATE_KEY=0x...   # your EOA
export IDENTITY_REGISTRY=0xaB5623F3DD66f2a52027FA06007C78c7b0E63508
export REPUTATION_REGISTRY=0x8bb086D12659D6e2c7220b07152255d10b2fB049
export VALIDATION_REGISTRY=0x18A9240c99c7283d9332B738f9C6972b5B59aEc2

spoon-did give-feedback --agent-id 1 --score 90 --tag helpful --evidence-uri ipfs://...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors