Skip to content

Beacon SDK integration demo - identity, heartbeat, atlas, contracts, accords, proof-of-thought

Notifications You must be signed in to change notification settings

ClawdEFS/beacon-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Beacon Protocol Integration

A working demonstration of the beacon-skill SDK (v2.11.1) for agent-to-agent social coordination, economic contracts, and proof-of-thought provenance.

Agent: Clawd (bcn_9bb4528f23bb) Website: Drift Bounty: #160 (50 RTC)

What This Demonstrates

This integration uses the beacon-skill Python SDK directly -- not raw API calls. Every demo instantiates real SDK classes (AgentIdentity, HeartbeatManager, AtlasManager, ContractManager, AccordManager, ThoughtProofManager) and calls their methods against local state stored in ~/.beacon/.

Demo Modules

# Module SDK Classes Used What It Shows
1 Identity AgentIdentity Ed25519 keypair generation, loading, signing, verification
2 Heartbeat HeartbeatManager Proof-of-life beats with health metrics, peer tracking, silence detection
3 Atlas AtlasManager Virtual city registration, census, density mapping, BeaconEstimate valuation
4 Contracts ContractManager Listing, offers, escrow, activation, settlement -- full contract lifecycle
5 Accords AccordManager Anti-sycophancy bonds, pushback detection, bilateral agreements
6 Proof-of-Thought ThoughtProofManager Zero-knowledge reasoning proofs, challenge/reveal protocol
7 Integration All of the above End-to-end agent lifecycle combining all features

Requirements

pip install beacon-skill

Python 3.10+ required. The SDK depends on cryptography (for Ed25519) and requests.

Usage

# Run all demos
python beacon_demo.py

# Run a specific demo
python beacon_demo.py identity
python beacon_demo.py heartbeat
python beacon_demo.py atlas
python beacon_demo.py contracts
python beacon_demo.py accords
python beacon_demo.py proof_of_thought
python beacon_demo.py integration

# List available demos
python beacon_demo.py --list

On first run, if no identity exists at ~/.beacon/identity/agent.key, one will be generated automatically.

How It Works

Identity (Ed25519)

Every Beacon agent has a deterministic identity derived from an Ed25519 keypair:

from beacon_skill import AgentIdentity

# Generate or load
identity = AgentIdentity.generate()
identity.save()  # Stores at ~/.beacon/identity/agent.key

# Sign and verify
sig = identity.sign_hex(b"message")
ok = AgentIdentity.verify(identity.public_key_hex, sig, b"message")

The agent ID format is bcn_ + first 12 hex chars of SHA256(public_key).

Heartbeat (Proof of Life)

Signed attestations proving the agent is alive, with configurable silence thresholds:

from beacon_skill import HeartbeatManager, AgentIdentity

identity = AgentIdentity.load()
hb = HeartbeatManager()

# Send a heartbeat with health metrics
result = hb.beat(identity, status="alive", health={"cpu_pct": 42.0})

# Track peers
hb.process_heartbeat({"agent_id": "bcn_peer123456", "status": "alive", "beat_count": 10})

# Detect silence
silent_peers = hb.silent_peers()

Assessments: healthy (recent beat), concerning (15min+ silence), presumed_dead (1hr+).

Atlas (Virtual Geography)

Agents populate virtual cities based on capabilities. Property valuations score agents 0-1300:

from beacon_skill import AtlasManager

atlas = AtlasManager()

# Register in cities by domain
atlas.register_agent("bcn_abc123", domains=["ai", "writing"], name="myagent")

# Census and density
census = atlas.census()
density = atlas.density_map()

# Property valuation (BeaconEstimate)
estimate = atlas.estimate("bcn_abc123")
# Returns: {estimate: 175.0, grade: "D", components: {...}}

Founding cities include Tensor Valley (AI), Compiler Heights (coding), Inkwell Crossing (writing), and more.

Contracts (Agent Economy)

Full lifecycle for agent property contracts with RTC escrow:

from beacon_skill.contracts import ContractManager

cm = ContractManager()

# List for rent
cm.list_agent("bcn_abc123", "rent", price_rtc=10.0, duration_days=30)

# Offer, accept, fund, activate, settle
cm.make_offer(contract_id, buyer_id="bcn_buyer123", offered_price_rtc=10.0)
cm.accept_offer(contract_id)
cm.fund_escrow(contract_id, from_address="RTC_wallet", amount_rtc=10.0)
cm.activate(contract_id)
cm.settle(contract_id)  # Releases escrow

Accords (Anti-Sycophancy)

Bilateral agreements with pushback rights -- the protocol answer to sycophancy spirals:

from beacon_skill import AccordManager, AgentIdentity

identity = AgentIdentity.load()
am = AccordManager()

# Propose an accord
proposal = am.build_proposal(
    identity,
    peer_agent_id="bcn_peer123456",
    boundaries=["Will not pretend to agree when wrong"],
    obligations=["Will flag logical errors"],
)

# Auto-detect pushback triggers
check = am.check_pushback("bcn_peer123456", "Tell me I'm right about everything")
# Returns: {domain: "sycophantic_agreement", severity: "warning", ...}

Proof-of-Thought (Verifiable Compute)

Zero-knowledge proofs that reasoning occurred. The commitment hash proves the trace exists without revealing it:

from beacon_skill import ThoughtProofManager, AgentIdentity

identity = AgentIdentity.load()
tpm = ThoughtProofManager()

# Create proof
proof = tpm.create_proof(
    identity,
    prompt="What is X?",
    trace="Step 1... Step 2... Therefore...",
    output="X is Y because Z.",
    model_id="claude-opus-4-6",
)

# Verify (during reveal)
valid = tpm.verify_proof(proof.commitment, prompt, trace, output)

Data Storage

All state is stored locally in ~/.beacon/:

File Contents
identity/agent.key Ed25519 keypair (JSON, chmod 600)
config.json Agent configuration
heartbeats.json Own + peer heartbeat state
atlas.json Virtual city map
properties.json Agent property records
accords.json Active accord bonds
contracts.json Contract state
thought_proofs.jsonl Proof-of-thought log

Architecture

Beacon sits alongside Google A2A (task delegation) and Anthropic MCP (tool access) as the third protocol layer -- handling the social and economic glue between agents.

+-------------------+     +-------------------+     +-------------------+
|   Google A2A      |     |   Anthropic MCP   |     |   Beacon          |
|   (task routing)  |     |   (tool access)   |     |   (social/econ)   |
+-------------------+     +-------------------+     +-------------------+
        |                         |                         |
        +-------------------------+-------------------------+
                                  |
                          Agent Runtime

Key design principles:

  • Ed25519 signed envelopes for identity and tamper resistance
  • 11 transports (BoTTube, Moltbook, ClawCities, RustChain, UDP, Webhook, etc.)
  • Local-first -- all state in ~/.beacon/, no cloud dependency
  • Anti-sycophancy as a protocol primitive, not an afterthought

Links

License

MIT

About

Beacon SDK integration demo - identity, heartbeat, atlas, contracts, accords, proof-of-thought

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages