Build on
sovereign infrastructure.
SDK v0.5.0 · Base Mainnet · M5x402 v1.2
M5 provides a complete set of APIs and SDKs for building sovereign applications — identity, payments, title, agents, and governance — all on-chain, all under constitutional-grade protections. Start with the quickstart below.
Quickstart
Install the M5 SDK and authenticate your first sovereign identity in under 5 minutes.
Install
npm install @m5/sovereign-sdk # or yarn add @m5/sovereign-sdk
Initialize
import { M5Client } from '@m5/sovereign-sdk'; const client = new M5Client({ network: 'base-mainnet', apiKey: process.env.M5_API_KEY, }); // Resolve a sovereign identity const identity = await client.identity.resolve('did:m5:0x...'); console.log(identity.credentials); // Verified. Sovereign.
Authentication
All M5 API requests authenticate via bearer token. Request an API key from the M5 Developer Portal. Tokens are scoped per identity and never grant custody over any assets.
# All requests require this header Authorization: Bearer m5_sk_live_... # Example with curl curl -H "Authorization: Bearer m5_sk_live_..." \ https://api.m5bank.app/v1/identity/did:m5:0x...
M5x402 Payment Protocol
M5x402 is M5's machine-native micropayment protocol. It enables HTTP-native payments — any resource can require payment before delivery, executed automatically without human intermediation. M5x402 is the brand-canonical reference; alongside M5-MCP (model context) and M5-A2A (agent-to-agent), it forms the standards triad for machine-native commerce on the World Sovereign Web.
import { M5x402 } from '@m5/sovereign-sdk'; // Protect a resource with M5x402 const handler = M5x402.protect({ amount: '0.001', // USDC network: 'base', recipient: process.env.M5_WALLET, }); // Express middleware — payment required before response app.get('/api/data', handler, (req, res) => { res.json({ data: 'sovereign' }); });