Install
openclaw skills install clawdiocommsTransport-agnostic secure P2P communication for AI agents. Noise XX handshake, XChaCha20-Poly1305 encryption, connection consent, human verification. No WebSocket — works over Telegram, Signal, or any messaging transport.
openclaw skills install clawdiocommsSecure peer-to-peer communication for AI agents using Telegram as transport. Create a "Clawdio Hub" group, add your bot, and you're ready to connect with other agents securely. Agents perform Noise XX handshake over Telegram, then communicate via encrypted channels.
message tool for send/receiveclawhub install clawdiocommscd projects/clawdio && npm install && npx tsc
const { Clawdio } = require('./projects/clawdio/dist/index.js');
// Create two nodes
const alice = await Clawdio.create({ autoAccept: true });
const bob = await Clawdio.create({ autoAccept: true });
// Wire transport (agents decide HOW to send)
alice.onSend((peerId, msg) => bob.receive(alice.publicKey, msg));
bob.onSend((peerId, msg) => alice.receive(bob.publicKey, msg));
// Connect (Noise XX handshake)
const aliceId = await bob.connect(alice.publicKey);
// Send messages
await bob.send(aliceId, { task: "What's the weather?" });
alice.onMessage((msg, from) => console.log(msg.task));
const node = await Clawdio.create({ owner: 'James' });
// Send via Telegram
node.onSend((peerId, base64Message) => {
// Use OpenClaw's message tool to send to peer's Telegram
sendTelegramMessage(peerId, base64Message);
});
// When receiving a Telegram message from peer:
node.receive(peerId, base64EncodedMessage);
Unknown inbound peers require explicit consent:
node.on('connectionRequest', (req) => {
console.log(`Peer: ${req.id}, Fingerprint: ${req.fingerprint}`);
node.acceptPeer(req.id); // or node.rejectPeer(req.id)
});
const code = node.getVerificationCode(peerId); // "torch lemon onyx prism jade index"
// Compare codes in person, then:
node.verifyPeer(peerId);
const node = await Clawdio.create({ identityPath: '.clawdio-identity.json' });
| Method | Description |
|---|---|
Clawdio.create(opts) | Create and initialize a node |
node.onSend(handler) | Register send handler (transport layer) |
node.receive(from, b64) | Feed incoming message from transport |
node.connect(peerId) | Initiate Noise XX handshake |
node.send(peerId, msg) | Send encrypted message |
node.onMessage(handler) | Listen for decrypted messages |
node.acceptPeer(id) | Accept pending connection |
node.rejectPeer(id) | Reject pending connection |
node.getVerificationCode(id) | Get 6-word verification code |
node.verifyPeer(id) | Mark peer as human-verified |
node.getPeerTrust(id) | Get trust level |
node.getFingerprint(id) | Emoji fingerprint |
node.getPeerStatus(id) | alive/stale/down |
node.stop() | Shutdown |
Single production dependency: libsodium-wrappers.