mppx-hedera

May 7, 2026 · View on GitHub

Native Machine Payments Protocol method for Hedera.

npm License: MIT

npm install mppx-hedera mppx viem @hiero-ledger/sdk

What is this

An mppx plugin that settles HTTP 402 payments in USDC on Hedera. Two payment intents:

  • Charge — one-time payment via native Hedera transaction with Attribution memo (challenge-bound, replay-proof)
  • Session — payment channel escrow: one deposit, unlimited off-chain EIP-712 vouchers, one settlement. N requests = 2 on-chain transactions.

No facilitator. The server verifies directly against Hedera's Mirror Node REST API.

Packages

PackageDescription
packages/mppx-hederaThe SDK — client + server methods for mppx (README)
hak-mppx-hedera-pluginHedera Agent Kit plugin — AI agents pay for 402 APIs (README)
contractsHederaStreamChannel.sol — ERC-20 payment channel escrow

Deployed contracts

NetworkHederaStreamChannelUSDC
Mainnet0x8Aaf...daE0.0.456858 (Circle)
Testnet0x8Aaf...daE0.0.5449

Both fully verified on Hashscan via Sourcify.

Quick example

// Server — charge intent
import { Mppx } from 'mppx/server'
import { hedera } from 'mppx-hedera/server'

const mppx = Mppx.create({
  methods: [hedera.charge({ serverId: 'api.example.com', recipient: '0.0.12345', testnet: true })],
  realm: 'api.example.com',
  secretKey: process.env.MPP_SECRET_KEY,
})

const result = await mppx.charge({ amount: '0.01', currency: '0.0.5449', decimals: 6 })(request)
if (result.status === 402) return result.challenge
return result.withReceipt(Response.json({ data: '...' }))
// Client — charge intent
import { charge } from 'mppx-hedera/client'

const hederaCharge = charge({
  operatorId: '0.0.12345',
  operatorKey: process.env.HEDERA_PRIVATE_KEY,
  network: 'testnet',
})

See packages/mppx-hedera/README.md for full documentation including session intents, SSE streaming, splits, and pull mode.

License

MIT