Developer documentation

M2M Developer Documentation

Reference for Solana escrow programs, the phased dual verification oracle, and API first client integration. Sections use URL anchors, for example /docs#smart-contracts. Questions: info@m2m.energy.

Introduction

Welcome to the M2M Developer Documentation. The M2M stack helps developers, charger cloud partners, and node operators integrate with a Solana native DePIN for machine to machine energy coordination. This covers escrow programs on chain, the dual verification oracle middleware roadmap, and the TypeScript oriented surface area for web clients and OEM or charger APIs.

The M2M project is open source: you can inspect, fork, and contribute to the public repositories as they are published; protocol details here match what we ship in those repos.

Smart Contracts (Solana Escrow)

The roadmap relies on deterministic Solana programs for session funding, verification cues, and settlement. Current V1 shows the session life cycle and escrow rails together with staged QR flows, while full oracle driven settlement completes through phased hardening and audits.

V1 Devnet program details

V1 programs are currently live on Solana Devnet. Mainnet program IDs will be published following our Phase 1 security audits.

Program IDDevnet
M2MEscrow1111111111111111111111111111111

Note: Devnet placeholder. Replace with audited mainnet ID after deployment.

Core instructions

  • initialize_escrow: Locks the estimated USDC session stake from the driver wallet.
  • verify_presence: Records physical QR authorization and binds the signer to this listing before payment continuation.
  • settle_session: Target path for oracle authorized release of host payout and any driver refund once dual verification tolerances pass.
  • dispute_resolution: Fallback when charger cloud and vehicle reports disagree beyond policy tolerance during reconciliation.

API Integration Oracle (V2)

The oracle is the target trust boundary between measured energy and on chain settlement. V1 ships staged QR and escrow primitives first, while OEM and charger telemetry reconciliation lands in phased releases. Example payloads below are illustrative, not a guarantee of deployed routes or field names.

1. Session initialization (scan to authenticate)

When a driver scans the host QR, the client records session intent and workflow state in app. Charger cloud authorization and automated energize flows arrive as partner APIs connect.

POST /api/v2/oracle/session-initJSON
{
  "chargerId": "8841-live",
  "sessionToken": "sess9x8f2a1",
  "qrProofSignature": "5Kj8fEd25519",
  "escrowPubkey": "7xVpSolana",
  "workflowStatus": "authorizedPendingPlug",
  "timestamp": "2026-04-11T12:00:00Z"
}

2. Dual verification settlement payload

Production target authorizes payout only when charger reported and vehicle reported energy stay within accepted loss tolerance (often under about two percent). V1 documents this shape while live OEM and charger adapters roll out.

POST /api/v2/oracle/session-settleJSON
{
  "sessionId": "sess9x8f2a1",
  "chargerReportedKwh": 42.5,
  "vehicleReportedKwh": 41.8,
  "deltaStatus": "withinTolerance",
  "settlementAmountUsdc": 14.5,
  "hostWallet": "HostAddress",
  "driverWallet": "DriverAddress"
}

SDK setup

The official @m2m/sdk npm package targets a unified interface for the session life cycle and is designed to work alongside @solana/wallet-adapter-react. Availability timelines are announced on official channels.

Installation and configuration

Expect wallet signing helpers, RPC configuration, and event updates for session status once the SDK is published publicly. Until then reference the open application code and docs for patterns. Reach out at info@m2m.energy for integration questions.