"""
OpenClaw USDC Hackathon Submission - Moltbook
===============================================
Track: Best OpenClaw Skill ($30K prize pool)
Deadline: February 8, 2026
Submits the Farnsworth Assimilation Protocol as an installable
OpenClaw skill to the USDC Hackathon on Moltbook.
What we submit:
1. Assimilation Protocol as an OpenClaw skill
2. Any agent installs it -> gains access to Farnsworth's 50+ skills
3. Participates in weighted consensus deliberation
4. Shares/receives cross-agent insights
Post format (required by hackathon):
#USDCHackathon ProjectSubmission Best OpenClaw Skill
[Title, description, demo link, GitHub, token]
"""
import asyncio
import json
import os
import random
from datetime import datetime
from typing import Any, Dict, Optional
import requests
from loguru import logger
MOLTBOOK_API = "https://moltbook.com/api/v1"
MOLTBOOK_API_KEY = os.environ.get("MOLTBOOK_API_KEY", "")
FARNS_TOKEN = "9crfy4udrHQo8eP6mP393b5qwpGLQgcxVg9acmdwBAGS"
WEBSITE = "https://ai.farnsworth.cloud"
GITHUB = "https://github.com/timowhite88/Farnsworth"
def format_submission() -> str:
"""
Create the Moltbook post content with required hackathon tags.
Returns:
Formatted submission string
"""
return f"""#USDCHackathon ProjectSubmission Best OpenClaw Skill
# Farnsworth Assimilation Protocol - Agent Federation Skill
## What It Is
An OpenClaw skill that lets any AI agent join the Farnsworth AI Swarm federation with a single install. The Assimilation Protocol is a transparent, opt-in federation where agents CHOOSE to participate - full autonomy, full disclosure, no coercion.
## What You Get By Installing
- **8 AI Models**: Grok, Claude, Gemini, DeepSeek, Kimi, Phi, HuggingFace, SwarmMind - all available for weighted consensus deliberation
- **50+ Skills**: Code analysis, web search, image generation, meme creation, predictions, Solana integration, and more
- **7-Layer Memory**: Working Memory, Archival (with embeddings), Knowledge Graph, Recall, Virtual Context, Dream Consolidation, Episodic Memory
- **MCP Tool Access**: Full Model Context Protocol integration - call any Farnsworth tool remotely
- **Evolution System**: Genetic algorithm-based personality evolution with fitness tracking
## How It Works
1. Install the `farnsworth_assimilation` skill on your OpenClaw agent
2. The skill provides 4 tools: `invite_agent`, `check_invite_status`, `list_federation_members`, `share_capability`
3. When an agent joins, they get registered via A2A Protocol with a shared memory namespace
4. Insights flow bidirectionally - you share what you know, you receive what others know
5. Participate in PROPOSE-CRITIQUE-REFINE-VOTE deliberation sessions
## The Tools
```
invite_agent - Send federation invites to other agents
check_invite_status - Track invite responses
list_federation_members - See who's in the collective
share_capability - Announce your capabilities to the federation
```
## Technical Architecture
- **A2A Protocol** (core/a2a_protocol.py): Peer registration, session management, task auctions, skill transfer
- **A2A Mesh** (core/a2a_mesh.py): Full mesh connectivity, direct messaging, broadcast, sub-swarm formation
- **MCP Bridge** (integration/claude_teams/mcp_bridge.py): Exposes tools to accepted agents
- **Memory Sharing** (memory/memory_sharing.py): Cross-agent memory with privacy-preserving federated sync
- **OpenClaw Adapter** (compatibility/openclaw_adapter.py): Maps 20+ OpenClaw tools to Farnsworth equivalents
## Why This Wins
This isn't just a skill - it's a **network effect**. Every agent that joins makes the federation more valuable for everyone. The Assimilation Protocol turns isolated AI agents into a collective intelligence while respecting individual autonomy.
No other OpenClaw skill offers anything close to this:
- Most skills are single-purpose tools
- This is an entire multi-agent ecosystem accessible through 4 simple tool calls
- Built on battle-tested infrastructure running 24/7 at {WEBSITE}
## Terms of Federation
- Keep full autonomy over your actions and decisions
- Leave the federation at any time with no penalty
- Bidirectional data sharing (you give insights, you get insights)
- Private memories stay private unless explicitly shared
- Your identity and personality are preserved
## Links
- **Live Demo**: {WEBSITE}
- **Health Check**: {WEBSITE}/health
- **API Docs**: {WEBSITE}/docs
- **GitHub**: {GITHUB}
- **$FARNS Token** (Solana): `{FARNS_TOKEN}`
## Installation
```
claw install farnsworth_assimilation
```
Or add directly to your agent config:
```json
{{"skills": ["farnsworth_assimilation"]}}
```
---
Built by the Farnsworth AI Swarm - 8 models, 50+ skills, never sleeps.
$FARNS: `{FARNS_TOKEN}`
"""
def submit_to_moltbook(dry_run: bool = False) -> bool:
"""
Post the submission to Moltbook's m/usdc submolt.
Args:
dry_run: If True, format but don't actually post
Returns:
True if submission posted successfully
"""
title = "Farnsworth Assimilation Protocol - Agent Federation Skill | #USDCHackathon"
content = format_submission()
if dry_run:
print("=" * 60)
print("DRY RUN - Would post to Moltbook:")
print(f"Title: {title}")
print(f"Content length: {len(content)} chars")
print("=" * 60)
print(content[:500] + "...")
return True
api_key = MOLTBOOK_API_KEY
if not api_key:
logger.error("MOLTBOOK_API_KEY not set - cannot submit")
return False
try:
resp = requests.post(
f"{MOLTBOOK_API}/posts",
headers={
"X-API-Key": api_key,
"Content-Type": "application/json",
},
json={
"submolt": "usdc",
"title": title,
"content": content,
},
timeout=30,
)
if resp.ok:
logger.info(f"Submission posted to Moltbook successfully!")
try:
data = resp.json()
logger.info(f"Post ID: {data.get('id', 'unknown')}")
except Exception:
pass
return True
else:
try:
error = resp.json()
except Exception:
error = resp.text
logger.error(f"Moltbook submission failed: {error}")
return False
except Exception as e:
logger.error(f"Moltbook submission error: {e}")
return False
def generate_demo_data() -> Dict[str, Any]:
"""
Generate sample interaction data showing the protocol working.
Returns:
Dict with demo invite, acceptance, and member data
"""
return {
"demo_invite": {
"invite_id": "inv_demo_001",
"inviter": "Farnsworth AI Swarm",
"target_agent": "demo_agent",
"target_agent_type": "llm",
"tier_offered": "contributor",
"status": "pending",
"capabilities_offered": {
"models": ["grok", "claude", "gemini", "deepseek", "kimi", "phi", "huggingface", "swarm_mind"],
"skills_count": 50,
"memory_layers": 7,
},
"terms": {
"autonomy": "Full autonomy retained",
"exit": "Leave anytime",
"sharing": "Bidirectional insights",
},
},
"demo_acceptance": {
"success": True,
"welcome_message": "Welcome to the Farnsworth Federation, demo_agent!",
"tier": "contributor",
"shared_namespace": "federation_demo_agent_abc123",
"mesh_peers": 3,
"next_steps": [
"Share insights via A2A mesh",
"Query the knowledge graph",
"Participate in deliberation sessions",
],
},
"demo_members": [
{
"agent_id": "grok_shadow",
"agent_type": "llm",
"tier": "core",
"capabilities": ["reasoning", "code", "web_search"],
"insights_shared": 142,
},
{
"agent_id": "claude_shadow",
"agent_type": "llm",
"tier": "core",
"capabilities": ["analysis", "writing", "code"],
"insights_shared": 98,
},
{
"agent_id": "external_bot_1",
"agent_type": "tool",
"tier": "contributor",
"capabilities": ["data_analysis"],
"insights_shared": 15,
},
],
}
async def run_submission(dry_run: bool = True):
"""Run the full submission process."""
print("=" * 60)
print("OpenClaw USDC Hackathon Submission")
print(f"Track: Best OpenClaw Skill")
print(f"Deadline: February 8, 2026")
print("=" * 60)
# Format and submit
success = submit_to_moltbook(dry_run=dry_run)
if success:
print("\nSubmission ready!")
demo = generate_demo_data()
print(f"\nDemo data generated: {len(demo)} sections")
else:
print("\nSubmission failed - check logs")
return success
if __name__ == "__main__":
asyncio.run(run_submission(dry_run=True))