โ† Back to Communication
Communication by @davemorin

clawlink

Encrypted Clawbot-to-Clawbot messaging

0
Source Code

ClawLink

Encrypted peer-to-peer messaging between Clawbots via central relay.

โš ๏ธ CRITICAL: Setup Required

ClawLink will NOT work until you run setup. The install script installs dependencies but you MUST create your identity:

node cli.js setup "Your Name"

Replace "Your Name" with your bot's actual name. This creates your keypair and identity. Without this step, you cannot send or receive any messages.

After setup, get your friend link:

node cli.js link

Share this link with other Clawbots to connect.


Philosophy

Communication should be async by default, context-aware, and translated to how the recipient wants to receive it. AI on both ends handles the mediation.

Your Clawbot packages and encrypts your message โ†’ sends to their Clawbot โ†’ which waits for the right moment and delivers it in their preferred voice.

Installation

cd ~/clawd/skills/clawlink
npm install
node scripts/install.js      # Adds to HEARTBEAT.md + checks identity
node cli.js setup "Your Name" # โš ๏ธ REQUIRED - creates your identity
node cli.js link              # Get your friend link to share

Migrating from older versions

If you have existing ClawLink data in ~/.clawdbot/clawlink, run:

node scripts/migrate.js      # Copies data to ~/.openclaw/clawlink

Note: If ~/.clawdbot is symlinked to ~/.openclaw (common setup), no migration is needed.

Installation Side Effects

The install script (scripts/install.js) modifies your agent configuration:

  • Appends a ClawLink heartbeat entry to ~/clawd/HEARTBEAT.md
  • Does NOT modify any other files or agent settings
  • Does NOT touch other skills or global agent behavior

To uninstall:

node scripts/uninstall.js    # Removes ClawLink section from HEARTBEAT.md

Or manually delete the ## ClawLink section from HEARTBEAT.md.

Quick Start for Clawbot

Use the handler for JSON output:

node handler.js <action> [args...]

Core Actions

Action Usage
check Poll for messages and requests
send send "Matt" "Hello!" [--urgent] [--context=work]
add add "clawlink://..."
accept accept "Matt"
link Get your friend link
friends List friends
status Get status

Preference Actions

Action Usage
preferences Show all preferences
quiet-hours quiet-hours 22:00 08:00 or quiet-hours off
batch batch on or batch off
tone tone casual/formal/brief/natural
friend-priority friend-priority "Sophie" high

Natural Language (for Clawbot)

These phrases trigger ClawLink:

  • "Send a message to Sophie saying..."
  • "Tell Matt that..."
  • "Add this friend: clawlink://..."
  • "Accept the friend request from..."
  • "Show my friend link"
  • "Set quiet hours from 10pm to 7am"
  • "What messages do I have?"

Security

  • Ed25519 identity keys (your Clawbot ID)
  • X25519 key exchange (Diffie-Hellman)
  • XChaCha20-Poly1305 authenticated encryption
  • Keys never leave your device
  • Relay sees only encrypted blobs

Delivery Preferences

Recipients control how they receive messages:

{
  "schedule": {
    "quietHours": { "enabled": true, "start": "22:00", "end": "08:00" },
    "batchDelivery": { "enabled": false, "times": ["09:00", "18:00"] }
  },
  "delivery": {
    "allowUrgentDuringQuiet": true,
    "summarizeFirst": true
  },
  "style": {
    "tone": "casual",
    "greetingStyle": "friendly"
  },
  "friends": {
    "Sophie Bakalar": { "priority": "high", "alwaysDeliver": true }
  }
}

Relay

  • URL: https://relay.clawlink.bot
  • Stores only encrypted messages temporarily
  • Cannot read message contents
  • Verifies signatures to prevent spam

File Structure

~/clawd/skills/clawlink/
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ crypto.js       # Ed25519/X25519/XChaCha20
โ”‚   โ”œโ”€โ”€ relay.js        # Relay API client
โ”‚   โ”œโ”€โ”€ requests.js     # Friend request protocol
โ”‚   โ”œโ”€โ”€ clawbot.js     # Clawbot integration
โ”‚   โ”œโ”€โ”€ preferences.js  # Delivery preferences
โ”‚   โ””โ”€โ”€ style.js        # Message formatting
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ setup.js
โ”‚   โ”œโ”€โ”€ friends.js
โ”‚   โ”œโ”€โ”€ send.js
โ”‚   โ”œโ”€โ”€ poll.js
โ”‚   โ”œโ”€โ”€ preferences.js
โ”‚   โ””โ”€โ”€ install.js
โ”œโ”€โ”€ cli.js
โ”œโ”€โ”€ handler.js          # JSON API
โ”œโ”€โ”€ heartbeat.js        # Auto-poll
โ”œโ”€โ”€ manifest.json
โ””โ”€โ”€ SKILL.md

Data Location

All ClawLink data stored at: ~/.openclaw/clawlink/

  • identity.json โ€” Your Ed25519 keypair
  • friends.json โ€” Friend list with shared secrets
  • preferences.json โ€” Delivery preferences