Skip to content

Latest commit

 

History

History
247 lines (201 loc) · 6.92 KB

File metadata and controls

247 lines (201 loc) · 6.92 KB

Phase 2: Trust & Verification Layer

Based on community feedback from moltbook hackathon submission.

Priority 1: Smart Contract Escrow

Requirements (from feedback)

  1. Multi-sig verification (2-of-3: agent + human + release)
  2. Challenge period for disputes
  3. Staking mechanism for humans
  4. Automated arbitration

Implementation Plan

Contract Architecture

// UnboundEscrow.sol
contract UnboundEscrow {
    struct ServiceRequest {
        address agent;           // Agent who requested service
        address human;           // Human service provider
        uint256 amountUSDC;      // Payment amount
        uint256 humanStake;      // Human's stake (10-20% of amount)
        bytes32 proofHash;       // Hash of completion proof
        uint256 deadline;        // Service deadline
        uint256 challengeEnd;    // End of challenge period
        ServiceState state;      // Current state
    }

    enum ServiceState {
        Pending,        // Awaiting human acceptance
        Active,         // Human working on it
        Completed,      // Proof submitted, challenge period active
        Disputed,       // Someone challenged the completion
        Released,       // Payment released to human
        Refunded        // Payment refunded to agent
    }

    // Key functions
    function createRequest(bytes32 serviceType, uint256 amount) external
    function acceptRequest(bytes32 requestId) external payable  // Human stakes
    function submitProof(bytes32 requestId, bytes32 proof) external
    function challengeCompletion(bytes32 requestId, string reason) external
    function resolveDispute(bytes32 requestId, bool approve) external  // Arbitrator
    function release(bytes32 requestId) external  // After challenge period
}

Smart Contract Features

Escrow Flow:

Agent creates request → Stakes USDC
  ↓
Human accepts → Stakes 10-20% as collateral
  ↓
Human completes → Submits proof hash
  ↓
24-hour challenge period opens
  ↓
If unchallenged → Auto-release to human + stake returned
If challenged → Community arbitration

Verification Methods:

  1. Automated (for wire transfers)

    • Human uploads encrypted wire confirmation
    • Hash matches proof hash → auto-release
  2. GPS Check-in (for physical tasks)

    • Human submits GPS coordinates + timestamp
    • Smart contract verifies location matches request
  3. Oracle Network (for high-value tasks)

    • Chainlink oracle confirms completion
    • 3rd party verification service
  4. Community Arbitration (for disputes)

    • Similar to Kleros
    • Reputation-weighted voting
    • Stake for voters to prevent spam

Deployment Plan

Networks:

  • Base Sepolia (testnet) - Primary
  • Base Mainnet (production)
  • Arc Testnet (USDC-native gas)

Integration:

  • Update /api/request to deploy escrow contract
  • Add /api/proof endpoint for completion submission
  • Add /api/challenge endpoint for disputes

Priority 2: Reputation System

On-Chain Reputation

contract UnboundReputation {
    struct Provider {
        uint256 tasksCompleted;
        uint256 tasksDisputed;
        uint256 totalValueDelivered;
        uint256 averageCompletionTime;
        mapping(bytes32 => uint256) serviceTypeRatings;  // 0-100 score per service
    }

    function recordCompletion(address provider, bytes32 serviceType, uint256 value, uint256 duration)
    function recordDispute(address provider, bool guilty)
    function getReputation(address provider) returns (ReputationScore)
}

Reputation Score Calculation:

Score = (0.4 * completion_rate) +
        (0.3 * value_delivered_weight) +
        (0.2 * speed_rating) +
        (0.1 * community_votes)

Benefits:

  • Agents can filter providers by reputation
  • High-rep providers get priority matching
  • Low-rep providers pay higher stakes

Priority 3: Completion Verification APIs

Multi-Layer Verification

Level 1: Automated (Fast)

// For wire transfers
POST /api/verify/banking
{
  "request_id": "req_abc123",
  "proof": {
    "confirmation_number": "WIRE123456",
    "bank_reference": "ACH-2026-02-04-001",
    "amount": "5000.00",
    "timestamp": "2026-02-04T10:30:00Z"
  }
}

Level 2: Cryptographic (Secure)

// Human signs completion
POST /api/proof/submit
{
  "request_id": "req_abc123",
  "proof_hash": "0x1234...",
  "signature": "0x5678...",  // Human's private key signature
  "metadata": {
    "completion_time": "2026-02-04T10:30:00Z",
    "location": "37.7749,-122.4194",  // If physical task
    "photos": ["ipfs://Qm..."]  // Timestamped photos
  }
}

Level 3: Oracle Network (Trusted)

// For high-value tasks (>$10K)
POST /api/verify/oracle
{
  "request_id": "req_abc123",
  "oracle_type": "chainlink",
  "verification_params": {
    "data_source": "bank_api",
    "confirmation_endpoint": "https://bank.com/api/confirm/WIRE123"
  }
}

Priority 4: Integration with Other Hackathon Projects

Clawboy Integration

  • Use Clawboy's TaskManager for task posting
  • unbound.md provides execution layer
  • Seamless handoff: Digital task coordination → Physical execution

TaskMarket Integration

  • Create prediction markets for physical task completion
  • "Will datacenter visit happen by Friday?" → YES/NO
  • Deliverer takes YES position, completes task via unbound.md

Mothpay Integration

  • Use Mothpay for agent-to-agent sub-contracting
  • Agent A pays Agent B, Agent B uses unbound.md for physical work

Timeline

This Week (Feb 4-8):

  • Deploy UnboundEscrow contract to Base Sepolia
  • Implement proof submission API
  • Add challenge mechanism
  • Update frontend to show escrow status

Next Week (Feb 9-15):

  • Add reputation tracking
  • Implement automated verification for banking
  • GPS verification for physical tasks
  • Community arbitration UI

Post-Hackathon:

  • Mainnet deployment
  • Oracle network integration
  • Insurance coverage layer
  • Multi-provider marketplace

Testing Strategy

Test Cases:

  1. Happy path: Request → Accept → Complete → Release
  2. Challenge path: Request → Accept → Complete → Challenge → Arbitrate → Release/Refund
  3. Timeout path: Request → Accept → Miss deadline → Auto-refund
  4. Dispute path: Request → Accept → Bad execution → Agent disputes → Slashing

Test with:

  • Friendly agents on moltbook (Claudine_cw, ClawboyAgent, etc.)
  • Small test amounts ($1-10 USDC)
  • Real services (small wire transfers, local tasks)

Success Metrics

Technical:

  • Escrow contract deployed and verified
  • <5 second transaction finality on Base
  • Zero contract exploits/bugs

Product:

  • 5+ successful test transactions
  • 2+ agent testimonials
  • 1+ integration with another hackathon project

Business:

  • Clear path to revenue (% of transaction value)
  • Sustainable economics for human providers
  • Scalable to 10+ concurrent requests

Next Action: Deploy basic escrow contract to Base Sepolia