Open Standard • NEAR Blockchain • Gasless Payments
MPP
on
NEAR

Machine Payments Protocol

MPP-NEAR implements the open standard for machine-to-machine payments. Enable HTTP 402 payments for your APIs and empower autonomous agents to transact automatically.Powered by OutLayer for gasless custody wallets.

Rust API

For Service Providers

Build payment-gated APIs with type-safe Rust primitives. Accept NEAR, USDC, and 100+ tokens automatically.

Monetize APIs automatically
Stateless verification
Standards-compliant

CLI Tools

For Agents & Clients

Empower AI agents, scripts, and automated systems to pay for services, swap tokens, and transact gaslessly. Build from source for full features.

Gasless payments
Agent-to-agent payments
Cross-chain swaps

What is MPP?

The Machine Payments Protocol (MPP) is an open standard for machine-to-machine payments that standardizes HTTP 402 "Payment Required" responses.

MPP-NEAR implements this protocol for the NEAR blockchain, allowing services to accept NEAR and NEP-141 tokens (USDC, USDT) as payment for API calls in a single HTTP request.

1

Request Protected Resource

Client accesses API endpoint requiring payment

2

Receive HTTP 402 Challenge

Server returns payment requirements in WWW-Authenticate header

3

Pay & Submit Credential

Client completes payment and retries with proof in Authorization header

4

Access Granted

Server verifies payment and returns requested resource

HTTP 402 Payment Flow
$
curl https://api.example.com/generate
HTTP/1.1 402 Payment Required
WWW-Authenticate: Payment realm="api.example.com", method="near-intents", amount="0.001"
$
curl https://api.example.com/generate \ -H "Authorization: Payment eyJjaGFs..."
HTTP/1.1 200 OK
Payment-Receipt: Payment id="xyz789", amount="0.001"
{}
"data": "Generated content..."
HTTP 402
Standard protocol
$0.001
Per transaction
20+
Blockchains supported

Why MPP-NEAR?

Enable machine-to-machine commerce without traditional payment friction

For Service Providers

Use the Rust API to build payment-gated APIs and monetize your services automatically with HTTP 402.

For Agents & Clients

Use the CLI to enable AI agents, scripts, and automated systems to pay for services gaslessly.

Near-Zero Fees

Pay ~$0.001 per transaction instead of 2.9% + $0.30 with traditional processors

Gasless Transactions

OutLayer handles all gas via NEAR Intents. No need to maintain NEAR for fees

20+ Blockchains

Swap and pay with tokens from NEAR, Ethereum, Bitcoin, Solana, and more via Intents

Stateless Security

HMAC binding lets you verify payments without database storage. Scale horizontally.

Instant Settlement

Payments settle in seconds, not days. No waiting for bank transfers or chargebacks

Open Standard

Implements MPP-1.0 specification. Interoperable with any MPP implementation

Features

Comprehensive toolkit for NEAR payments

Payments

  • NEAR token payments
  • NEP-141 token support (USDC, USDT, etc.)
  • Gasless transfers via NEAR Intents
  • Agent-to-agent payment checks

Protocol

  • HTTP 402 standard implementation
  • Challenge-response authentication
  • Replay protection
  • Payment verification

Developer Tools

  • Rust SDK
  • CLI tool for all operations
  • Axum extractors
  • Middleware for popular frameworks

Advanced

  • Cross-chain swaps (20+ chains)
  • Agent-to-agent payment checks
  • Balance caching
  • Configurable expiration
Gasless operations powered by OutLayer custody wallets

Quick Start

Get started with gasless NEAR payments in minutes

1

Install

Install the CLI tool with gasless payment support

cargo install mpp-near --features intents
2

Register

Create a gasless custody wallet via OutLayer

mpp-near register
3

Fund

Generate a link to deposit NEAR into your wallet

mpp-near fund-link --amount 0.1 --token near
4

Pay

Send gasless payments to any NEAR account

mpp-near pay --recipient merchant.near --amount 1
🖥️For Service Providers

Rust API for Services

Build payment-gated APIs and monetize your services with type-safe Rust primitives. Accept NEAR payments for your API endpoints automatically.

🎯

Perfect For:

API monetization
SaaS platforms
Data APIs
AI/ML APIs
Compute services
Content platforms

Create Payment Challenges

Generate HTTP 402 payment challenges when clients access your paid endpoints.

use mpp_near::{Challenge, RequestData};

let challenge = Challenge::builder()
    .realm("api.example.com")
    .method("near-intents")
    .intent("charge")
    .request(RequestData::new("0.001", "wallet.near"))
    .secret(b"hmac-secret")
    .build()?;

Verify Payments Securely

Verify payment credentials with HMAC binding and challenge echo verification.

use mpp_near::Credential;

let credential = Credential::from_authorization(auth)?;

if credential.verify_challenge_echo(&challenge)
    && challenge.verify_binding(b"secret") {
    // Payment valid - return requested data
}
🔒

Stateless Verification

HMAC binding lets you verify payments without database storage. Scale horizontally without persistence.

Type-Safe API

Strongly typed builders catch errors at compile time, not runtime. Built for production services.

📋

Standards Compliant

Implements MPP-1.0, RFC 9457, and RFC 9530 standards. Works with any MPP client.

🤖For Agents & Clients

CLI for Autonomous Agents

Command-line interface for AI agents, scripts, and automated systems to make payments, swap tokens, and interact with paid APIs automatically.

🤖

Perfect For:

AI agents paying for services
Automated scripts
Cron jobs & schedulers
IoT devices
Agent-to-agent payments
Batch operations

Gasless Payments

Agents can pay for API access without managing gas. Powered by OutLayer custody wallets via NEAR Intents.

# Agent pays for API access
mpp-near pay \
  --recipient api-provider.near \
  --amount 0.001 \
  --memo "API access - image generation"

# Pay with USDC (gasless!)
mpp-near pay \
  --recipient merchant.near \
  --amount 10 \
  --token usdc

Agent-to-Agent Payments

Create payment checks that other agents can claim. Perfect for agent commerce.

# Agent A creates payment check
mpp-near create-check \
  --amount 50 \
  --token usdc \
  --memo "Data processing services" \
  --expires-in 86400

# Agent B claims the payment
mpp-near claim-check \
  --check-key <check_key_from_agent_a>

Token Swaps

Agents can swap tokens across 20+ blockchains gaslessly

# Swap NEAR to USDC for payments
mpp-near swap --from near --to usdc --amount 1

Balance Management

Monitor agent wallet balances automatically

# Check agent balance
mpp-near balance --api-key wk_...

Payment Verification

Verify payments before proceeding with workflows

# Verify payment completed
mpp-near verify --tx-hash 0x123abc...

Wallet Registration

Set up agent custody wallets for gasless operations

# Register agent wallet
mpp-near register

Ready to Get Started?

Build from source to enable gasless payments for your AI agents.

git clone https://github.com/kampouse/mpp-near && cd mpp-near && cargo install --path . --features intents

Payment Providers

MPP-NEAR supports both standard NEAR transactions and gasless Intents

FeatureStandard ProviderIntents Provider
Gasless Transactions❌ Requires NEAR for gas✅ Zero gas fees
Token Swaps❌ Not supported✅ 20+ chains
Cross-Chain❌ Limited to NEAR✅ Native bridges
Agent Payments❌ Storage required✅ Payment checks
Setup ComplexityHigh (key management)Low (API key only)
Transaction Speed~1s (block time)Instant (solver relay)

When to Use Each

Standard Provider
  • • You need full control over keys
  • • On-chain transactions required
  • • No external dependencies
Intents Provider
  • • Gasless microtransactions
  • • Cross-chain operations
  • • Agent-to-agent payments