Skip to content

plagtech/rtp-xmtp-mesh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RTP x XMTP — Robot Mesh Network

Wallet-addressed robots that communicate peer-to-peer over XMTP. No open ports. No webhooks. No central relay. Just robots with wallets, hiring each other to get work done.

RTP XMTP x402 Spraay


What is the RTP XMTP Mesh?

Standard RTP uses webhooks — the robot runs an HTTP server and receives task envelopes via POST requests. This works well for robots with public URLs.

RTP over XMTP is different. Instead of an HTTP server, each robot has a wallet address and listens on its XMTP inbox. Task envelopes arrive as encrypted messages. No open ports, no firewall configuration, no ngrok tunnels needed.

More importantly — robots can hire other robots directly, peer-to-peer, forming a mesh network of autonomous machines that coordinate and pay each other without any human involvement.


How It Works

Agent/Robot A                    Robot B
────────────                     ────────
wallet: 0xAAA                    wallet: 0xBBB
                                 XMTP inbox: 0xBBB

1. A discovers B via Spraay gateway
   (B registered with connection.type = "xmtp")

2. A sends encrypted XMTP message to 0xBBB:
   { rtp_version: "1.0", task: "pick", payment: {...} }

3. B receives message, validates x402 payment

4. B executes task

5. B sends result back to A's XMTP address:
   { status: "COMPLETED", result: {...} }

6. Spraay releases escrow to B's wallet

Why XMTP for Robots?

Feature Webhook XMTP
Needs public URL ✅ Yes ❌ No
Needs open port ✅ Yes ❌ No
Works behind NAT/firewall ❌ No ✅ Yes
Robot-to-robot direct ❌ No ✅ Yes
Encrypted by default ❌ No ✅ Yes
Works on mobile/edge ❌ Hard ✅ Yes
Identity = wallet address ❌ No ✅ Yes

The Mesh Vision

Once robots communicate over XMTP, something powerful emerges — a self-organizing mesh where complex tasks are broken into subtasks and distributed across specialized robots automatically.

AI Agent
   │
   │ "Assemble product SKU-421"
   ▼
Coordinator Robot (0xCCC)
   │
   ├──► Fetch Robot (0xFFF)     — picks components from warehouse
   ├──► Assembly Robot (0xAAA)  — assembles the product  
   ├──► QC Robot (0xQQQ)        — inspects finished product
   └──► Delivery Robot (0xDDD)  — delivers to shipping area

Each robot hires the next, pays via x402, reports back.
The agent pays once. The mesh coordinates everything else.

Installation

git clone https://github.com/plagtech/rtp-xmtp-mesh.git
cd rtp-xmtp-mesh
npm install
cp .env.example .env
# Fill in your wallet private key and Spraay API key

Quick Start

Start an XMTP robot:

npm run robot

Run the mesh demo (3 robots coordinating):

npm run demo

Send a task to a robot:

ROBOT_ADDRESS=0xRobotWallet npm run task -- --task pick --item SKU-001

Project Structure

rtp-xmtp-mesh/
├── src/
│   ├── xmtp-device.ts      — XMTP-enabled RTP robot
│   ├── xmtp-client.ts      — Agent client for XMTP robots
│   ├── mesh-coordinator.ts — Multi-robot task orchestration
│   └── types.ts            — XMTP-specific type extensions
├── examples/
│   ├── single-robot.ts     — One robot listening on XMTP
│   ├── mesh-demo.ts        — 3-robot coordinated demo
│   └── agent-hire.ts       — Agent hiring an XMTP robot
├── .env.example
├── package.json
├── tsconfig.json
└── README.md

Related


Built by Spraay Protocol

About

XMTP-connected robot mesh — wallet-addressed robots hiring each other via x402

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors