DEV Community

Daniel Ioni
Daniel Ioni

Posted on

🤖 MyZubster: The Open-Source Robot That Pays Itself with Monero

🤖 MyZubster: The Open-Source Robot That Pays Itself with Monero

TL;DR: We built a complete open-source platform where ESP32/Arduino robots autonomously request, pay, and escrow for recharge using the x402 protocol and Monero. Robot pays, owner earns, community grows.


🌱 The Vision

Imagine this:

  • A lawn mower robot finishes its battery → requests recharge
  • The robot sends a payment request (x402) to the gateway
  • The owner sends 0.01 XMR → robot charges
  • The owner gets 85%, MyZubster takes 2%, Bosco community fund takes 8%, and the referrer gets 5%

This is now a reality. And it's open-source.


🏗️ The Architecture

┌─────────────────────────────────────────────────────────────────┐
│ MyZubster Platform │
│ Open-source Repository │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ ESP32/ │ │ x402 │ │ Monero Wallet │ │
│ │ Arduino │───▶│ Gateway │───▶│ RPC (Testnet) │ │
│ │ Robot │ │ Node.js │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Escrow │ │ GitHub │ │ Docker │ │
│ │ 2-of-3 │ │ Bounties │ │ Compose │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
text


💰 How the Payment Flow Works

1️⃣ Register a Robot


bash
curl -X POST http://localhost:10003/api/robot/register \
  -H "Content-Type: application/json" \
  -d '{
    "id": "robot_001",
    "name": "Tagliaerba",
    "owner": "45M4DW1...",
    "walletAddress": "4A2Btest1234567890"
  }'

Response:
json

{
  "success": true,
  "robot": {
    "id": "robot_001",
    "name": "Tagliaerba",
    "walletAddress": "4A2Btest1234567890",
    "batteryLevel": 100,
    "isActive": true
  }
}

2️⃣ Robot Requests Recharge (x402)

When battery < 15%, the robot sends:
bash

curl -X GET "http://localhost:10003/api/robot/ricarica?robotId=robot_001&amount=0.01"

Gateway responds with 402 Payment Required:
json

{
  "status": "payment_required",
  "amount": 0.0115,
  "fee": 0.0002,
  "boscoFee": 0.0008,
  "referralFee": 0.0005,
  "address": "4A2Btest1234567890",
  "memo": "Ricarica robot robot_001"
}

3️⃣ Payment is Made

    85% → Robot owner

    2% → MyZubster (platform maintenance)

    8% → Bosco Community Fund

    5% → Referrer (if the robot was cloned)

🔒 Escrow 2-of-3 (Trust Layer)

MyZubster uses a 2-of-3 multisig escrow to protect both clients and robot owners:
Signer  Role
Client  Pays for the job
Robot   Performs the work
AI Arbiter  Resolves disputes

How it works:

    Client creates escrow → funds locked

    Robot completes work → signs completion

    Client confirms → funds released

    If dispute → AI arbiter decides

Create an Escrow
bash

curl -X POST http://localhost:10003/api/escrow/create \
  -H "Content-Type: application/json" \
  -d '{
    "robotId": "robot_001",
    "clientAddress": "45M4DW1...cliente...",
    "amount": 0.01,
    "jobDescription": "Taglio erba"
  }'

Open a Dispute (AI Arbiter)
bash

curl -X POST http://localhost:10003/api/escrow/escrow_XXXXXXXX/dispute

AI Decision:
json

{
  "success": true,
  "escrow": { "status": "disputed" },
  "aiDecision": {
    "decision": "RELEASE",
    "confidence": 0.95,
    "reason": "GPS logs show robot completed the job successfully."
  }
}

🔄 Referral System

When a robot is cloned, the original owner earns 5% of all recharge fees for 1 year.
Clone a Robot
bash

curl -X POST http://localhost:10003/api/robot/clone \
  -H "Content-Type: application/json" \
  -d '{
    "originalId": "robot_001",
    "newId": "robot_002",
    "name": "Tagliaerba Clone",
    "owner": "45M4DW1...clone..."
  }'

Response:
json

{
  "success": true,
  "robot": { "id": "robot_002", "referrer": "45M4DW1..." },
  "referral": {
    "referrer": "45M4DW1...",
    "expiresAt": "2027-08-02T00:00:00.000Z",
    "message": "5% fee for 1 year on every recharge!"
  }
}

🧮 Fee Structure
Fee Type    Percentage  Destination
MyZubster Fee   2%  Platform maintenance
Bosco Fee   8%  Community fund
Referral Fee    5%  Referrer
Owner   85% Robot owner
🤖 ESP32/Arduino Sketch
cpp

// x402_robot.ino - Core robot logic
void loop() {
  batteryLevel = readBattery();

  if (batteryLevel < 15.0 && registered) {
    requestRecharge(0.01);
  }

  checkPaymentStatus();
  delay(5000);
}

📡 API Endpoints
Method  Endpoint    Description
POST    /api/robot/register Register a robot
GET /api/robot/ricarica Request recharge (x402)
GET /api/robot/charge   Request recharge (x402 standard)
POST    /api/robot/clone    Clone robot with referral
POST    /api/escrow/create  Create escrow
POST    /api/escrow/:id/dispute Open dispute
GET /api/escrow/:id Get escrow status
POST    /api/marketplace/jobs/create    Create a job
🚀 Getting Started
bash

# 1. Clone the repository
git clone https://github.com/MyZubster-Ecosystem/myzubster-platform.git
cd myzubster-platform

# 2. Start with Docker
docker-compose up -d

# 3. Test the API
curl http://localhost:10003/

# 4. Register a robot
curl -X POST http://localhost:10003/api/robot/register \
  -H "Content-Type: application/json" \
  -d '{"id":"robot_001","name":"Robot Test","owner":"45M4DW1...","walletAddress":"4A2Btest1234567890"}'

🔗 Links

    Repository: MyZubster Platform

    Robot SDK: MyZubster-Robot

    Gateway: MyZubsterGateway

💬 Questions?

Drop a comment below or open an issue on GitHub!

Built with ❤️ by Daniel Ioni & the MyZubster Community

#monero #robotics #iot #opensource #web3 #myzubster #arduino #esp32 #blockchain
Enter fullscreen mode Exit fullscreen mode

Top comments (0)