Skip to content

Commit b057ae6

Browse files
authored
docs: add MPP on Stellar documentation (#2327)
1 parent cdcc711 commit b057ae6

15 files changed

Lines changed: 2637 additions & 2014 deletions

File tree

config/theme/navbar.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,26 @@ const build: NavbarItem = {
7979
label: 'Tutorial: Dapp Frontend',
8080
activeBasePath: 'docs/build/apps/dapp-frontend',
8181
},
82-
{
83-
to: '/docs/build/apps/x402',
84-
label: 'x402 on Stellar',
85-
activeBasePath: 'docs/build/apps/x402',
86-
},
8782
{
8883
to: '/docs/build/apps/zk',
8984
label: 'ZK Proofs on Stellar',
9085
activeBasePath: 'docs/build/apps/zk',
9186
},
87+
{
88+
type: 'html',
89+
value: '<hr><a href="/docs/build/agentic-payments" class="subtitle"><small>Agentic Payments</small>',
90+
className: 'subtitle',
91+
},
92+
{
93+
to: '/docs/build/agentic-payments/x402',
94+
label: 'x402 on Stellar',
95+
activeBasePath: 'docs/build/agentic-payments/x402',
96+
},
97+
{
98+
to: '/docs/build/agentic-payments/mpp',
99+
label: 'MPP on Stellar',
100+
activeBasePath: 'docs/build/agentic-payments/mpp',
101+
},
92102
{
93103
type: 'html',
94104
value: '<hr><a href="/docs/build/guides" class="subtitle"><small>How-To Guides</small>',
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: "Agentic Payments: HTTP-Native Payment Protocols for AI Agents and APIs"
3+
sidebar_label: Agentic Payments
4+
description: "Build payment-enabled APIs and AI agents on Stellar using HTTP-native payment protocols like x402 and MPP."
5+
sidebar_position: 0
6+
---
7+
8+
# Agentic Payments
9+
10+
import DocCardList from "@theme/DocCardList";
11+
12+
Agentic payments enable programmatic, per-request payments over HTTP — designed for AI agents, APIs, and machine-to-machine interactions. These protocols extend the `402 Payment Required` HTTP status code into a machine-readable payment negotiation layer, allowing clients to pay for API requests natively on Stellar.
13+
14+
- **[x402 on Stellar](./x402/README.mdx)** — An open protocol from the Coinbase Developer Platform for per-request payments using Soroban authorization entries, with facilitator-based verification and settlement.
15+
- **[MPP on Stellar](./mpp/README.mdx)** — The Machine Payments Protocol for direct on-chain settlement via Soroban SAC transfers, with support for both one-time charge payments and high-frequency off-chain payment channels.
16+
17+
<DocCardList />
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"label": "Agentic Payments",
3+
"collapsed": false,
4+
"position": 35,
5+
"link": {
6+
"type": "doc",
7+
"id": "build/agentic-payments/README"
8+
}
9+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: MPP on Stellar
3+
sidebar_position: 0
4+
sidebar_label: MPP on Stellar
5+
description: "Use the Machine Payments Protocol (MPP) for per-request HTTP payments on Stellar, with support for AI agents, APIs, and off-chain payment channels."
6+
---
7+
8+
## What is MPP?
9+
10+
The [Machine Payments Protocol (MPP)](https://mpp.dev) is an open protocol that enables programmatic, per-request payments over HTTP, designed especially for AI agents and APIs. It extends the `402 Payment Required` HTTP status code into a machine-readable payment negotiation layer for both humans and autonomous agents.
11+
12+
On Stellar, MPP works with Soroban SAC (Stellar Asset Contract) token transfers so that clients can pay for API requests natively, without an external facilitator. This makes it ideal for micropayments, AI agent-driven APIs, and payment-enabled applications.
13+
14+
## Supported MPP Intents
15+
16+
The `@stellar/mpp` SDK supports two payment intents:
17+
18+
### [Charge](https://mpp.dev/intents/charge)
19+
20+
Immediate one-time payments. Each request triggers a Soroban SAC `transfer` settled on-chain individually. This is the simplest intent — no channel setup or pre-funding required.
21+
22+
Two credential modes are available:
23+
24+
- **Pull** (default) — The client prepares and signs the Soroban authorization entries; the server broadcasts the transaction. Supports an optional sponsored path where the server rebuilds the transaction with its own account as source, so the client never pays network fees.
25+
- **Push** — The client broadcasts the transaction itself and sends the transaction hash for server verification.
26+
27+
See the [MPP Charge Guide](./charge-guide.mdx) to get started.
28+
29+
### Session
30+
31+
The session intent enables high-frequency, pay-as-you-go payments over unidirectional [payment channels](https://github.com/stellar-experimental/one-way-channel). The funder deposits tokens into the channel once, then makes many off-chain payments by signing cumulative commitments — no per-payment on-chain transactions, ideal for AI agent interactions. The server settles by closing the channel when convenient.
32+
33+
See the [MPP Session Guide](./channel-guide.mdx) to get started.
34+
35+
## Demo
36+
37+
Try the live demo at [mpp.stellar.buzz](https://mpp.stellar.buzz), or run the [MPP Demo](https://github.com/stellar/stellar-mpp-sdk/tree/main/demo) locally. It runs a Node.js server that charges 0.01 USDC per request and a minimal browser UI for testing end-to-end payment flows on Stellar Testnet.
38+
39+
To build an MPP-enabled service or integrate payments into your app, see [Build Applications](../../apps/README.mdx) and the resources below.
40+
41+
## Install
42+
43+
```bash
44+
npm install @stellar/mpp mppx @stellar/stellar-sdk
45+
```
46+
47+
## Examples
48+
49+
- **@stellar/mpp (GitHub)** — SDK source code, examples, and integration tests. [View on GitHub](https://github.com/stellar/stellar-mpp-sdk)
50+
- **Server example** — A minimal Node.js HTTP server charging 0.01 USDC per request using `@stellar/mpp/charge/server`. [View on GitHub](https://github.com/stellar/stellar-mpp-sdk/blob/main/examples/charge-server.ts)
51+
- **Client example** — A Node.js client that automatically handles 402 responses using `@stellar/mpp/charge/client`. [View on GitHub](https://github.com/stellar/stellar-mpp-sdk/blob/main/examples/charge-client.ts)
52+
53+
## Learn more
54+
55+
- [MPP Specification](https://mpp.dev) — Official MPP protocol specification
56+
- [@stellar/mpp (npm)](https://www.npmjs.com/package/@stellar/mpp) — npm package for MPP on Stellar
57+
- [mppx (npm)](https://www.npmjs.com/package/mppx) — Core MPP framework library
58+
- [one-way-channel contract](https://github.com/stellar-experimental/one-way-channel) — Soroban contract powering channel mode
59+
- [Signing Soroban invocations](../../guides/transactions/signing-soroban-invocations.mdx) — Auth-entry signing and transaction signing on Stellar
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"collapsed": false,
3+
"position": 20
4+
}

0 commit comments

Comments
 (0)