Skip to content

docs: add MPP on Stellar documentation - #2327

Merged
sagpatil merged 9 commits into
mainfrom
docs/add-mpp
Mar 31, 2026
Merged

docs: add MPP on Stellar documentation#2327
sagpatil merged 9 commits into
mainfrom
docs/add-mpp

Conversation

@sagpatil

Copy link
Copy Markdown
Contributor

Summary

Adds documentation for the Machine Payments Protocol (MPP) on Stellar, mirroring the existing x402 docs at docs/build/apps/x402/.

MPP is an HTTP-native payment protocol that uses the 402 Payment Required status code for machine-to-machine payments. The Stellar implementation via stellar-mpp-sdk settles payments directly on-chain via Soroban SAC transfers — no external facilitator needed.

Files added

File Description
docs/build/apps/mpp/_category_.json Docusaurus sidebar config
docs/build/apps/mpp/README.mdx Overview: what is MPP, charge vs channel modes, install, examples, learn more
docs/build/apps/mpp/quickstart-guide.mdx Step-by-step server + client tutorial with testnet wallet setup and fee sponsorship option
docs/build/apps/mpp/channel-guide.mdx Off-chain payment channel guide: deploy channel, open, make payments, close and settle

Key differences from x402

  • No external facilitator — the server verifies and broadcasts directly
  • Two payment modes: charge (per-request on-chain) and channel (off-chain cumulative commitments)
  • Optional feePayer sponsored path: client signs only Soroban auth entries; server rebuilds and broadcasts

Related

Adds documentation for the Machine Payments Protocol (MPP) on Stellar,
mirroring the existing x402 docs structure at docs/build/apps/x402/.

Files added:
- docs/build/apps/mpp/_category_.json  — Docusaurus sidebar config
- docs/build/apps/mpp/README.mdx       — Overview: what is MPP, charge vs channel modes, install, examples
- docs/build/apps/mpp/quickstart-guide.mdx — Step-by-step server + client tutorial with fee sponsorship
- docs/build/apps/mpp/channel-guide.mdx    — Off-chain payment channel guide (open, pay, close)

MPP uses stellar-mpp-sdk for direct on-chain settlement (no external
facilitator), supporting both one-time charge payments and high-frequency
off-chain channel commitments.
Copilot AI review requested due to automatic review settings March 26, 2026 02:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “MPP on Stellar” documentation section under docs/build/apps/mpp/, mirroring the existing x402 docs structure, to explain how to build paid HTTP APIs using MPP with on-chain (charge) and off-chain (channel) settlement on Stellar.

Changes:

  • Adds an MPP overview page (README.mdx) describing MPP, charge vs channel modes, and links to examples/resources.
  • Adds a step-by-step quickstart for charge mode with Node.js/Express server + client (quickstart-guide.mdx).
  • Adds a channel-mode guide including channel server/client setup and settlement/close flow (channel-guide.mdx).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
docs/build/apps/mpp/category.json Creates the Docusaurus category for the new MPP docs section.
docs/build/apps/mpp/README.mdx Introduces MPP on Stellar and links to key resources and examples.
docs/build/apps/mpp/quickstart-guide.mdx Provides a charge-mode quickstart with server/client examples and optional fee sponsorship.
docs/build/apps/mpp/channel-guide.mdx Documents channel mode flows, setup, and closing/settlement guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/build/apps/mpp/quickstart-guide.mdx Outdated
Comment thread docs/build/apps/mpp/quickstart-guide.mdx Outdated
Comment on lines +204 to +207
currency: USDC_SAC_TESTNET,
network: 'testnet',
feePayer: Keypair.fromSecret(process.env.FEE_PAYER_SECRET), // pays tx fees
}),

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the sponsored fees snippet, Keypair.fromSecret(process.env.FEE_PAYER_SECRET) will throw if FEE_PAYER_SECRET is unset/empty. For a copy/paste-ready example, add a small guard (similar to the STELLAR_RECIPIENT check above) or show how to export/set FEE_PAYER_SECRET before running.

Copilot uses AI. Check for mistakes.
Comment thread docs/build/apps/mpp/channel-guide.mdx Outdated
Comment thread docs/build/apps/mpp/channel-guide.mdx Outdated
Comment on lines +21 to +27
| 402 Payment Required |
| (channel: C..., amount: 0.1) |
|<-----------------------------|
| |
| Sign commitment off-chain |
| (cumulative: 0.1 XLM) |
|----------------------------->|

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guide mixes USDC and XLM in the channel flow description (e.g., prerequisites mention an XLM or USDC deposit, but the sequence diagram and pricing comment label commitments as XLM). Since the commitment amount is denominated in the channel’s funded token, consider picking one token for the worked example (e.g., USDC) or explicitly stating that the units follow the channel deposit asset.

Copilot uses AI. Check for mistakes.
Comment thread docs/build/apps/mpp/channel-guide.mdx Outdated
Comment on lines +84 to +87
const mppx = Mppx.create({
secretKey: process.env.MPP_SECRET_KEY ?? 'my-channel-secret',
methods: [
stellar.channel({

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This server example also defaults secretKey to a hard-coded value ('my-channel-secret'). To avoid encouraging insecure deployments, prefer requiring MPP_SECRET_KEY to be set (or clearly label the fallback as local-only and not suitable for production).

Copilot uses AI. Check for mistakes.
@stellar-jenkins-ci

Copy link
Copy Markdown

@stellar-jenkins-ci

Copy link
Copy Markdown

@stellar-jenkins-ci

Copy link
Copy Markdown

1 similar comment
@stellar-jenkins-ci

Copy link
Copy Markdown

@stellar-jenkins-ci

Copy link
Copy Markdown

@marcelosalloum marcelosalloum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

💡 Now that we have both MPP and x402, we should nest them under the same "Agentic Payments" umbrella.

@marcelosalloum marcelosalloum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some improvements

Comment on lines +13 to +49
```
Client (Funder) Server (Recipient)
| |
| [Deploy channel contract |
| with commitment key + USDC |
| deposit on-chain] |
| |
| GET /resource |
|----------------------------->|
| |
| 402 Payment Required |
| (channel: C..., amount: 0.1) |
|<-----------------------------|
| |
| Sign commitment off-chain |
| (cumulative: 0.1 USDC) |
|----------------------------->|
| |
| Verify ed25519 sig, 200 OK |
|<-----------------------------|
| |
| GET /resource |
|----------------------------->|
| |
| 402 (cumulative: 0.1 USDC) |
|<-----------------------------|
| |
| Sign commitment |
| (cumulative: 0.2 USDC) |
|----------------------------->|
| |
| Verify, 200 OK |
|<-----------------------------|
| |
| [Server closes channel |
| when convenient to settle] |
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flow should cover interactions with the Stellar blockchain

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file called quickstart-guide? It should be called charge-guide

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we additionally add a flowchart here, like what we have in the channel guide

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great points, updating!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@github-actions

Copy link
Copy Markdown
Contributor

Warning

This change removes routes. The diff of routes is below. Please verify that these changes to the routes are intentional and that redirects are in place if needed. Redirects can be added to nginx/includes/redirects.conf.

diff --git a/routes.txt b/routes.txt
index b6a0cd2e..038abe92 100644
--- a/routes.txt
+++ b/routes.txt
@@ -30,6 +30,10 @@
 /docs/build/apps/ingest-sdk
 /docs/build/apps/ingest-sdk/ingestion-pipeline-code
 /docs/build/apps/ingest-sdk/overview
+/docs/build/agentic-payments
+/docs/build/agentic-payments/mpp
+/docs/build/agentic-payments/mpp/channel-guide
+/docs/build/agentic-payments/mpp/charge-guide
 /docs/build/apps/overview
 /docs/build/apps/swift-payment-app
 /docs/build/apps/wallet
@@ -42,9 +46,9 @@
 /docs/build/apps/wallet/sep6
 /docs/build/apps/wallet/sep7
 /docs/build/apps/wallet/stellar
-/docs/build/apps/x402
-/docs/build/apps/x402/built-on-stellar
-/docs/build/apps/x402/quickstart-guide
+/docs/build/agentic-payments/x402
+/docs/build/agentic-payments/x402/built-on-stellar
+/docs/build/agentic-payments/x402/quickstart-guide
 /docs/build/apps/zk
 /docs/build/guides
 /docs/build/guides/archival

@github-actions

Copy link
Copy Markdown
Contributor

Warning

This change removes routes. The diff of routes is below. Please verify that these changes to the routes are intentional and that redirects are in place if needed. Redirects can be added to nginx/includes/redirects.conf.

diff --git a/routes.txt b/routes.txt
index b6a0cd2e..038abe92 100644
--- a/routes.txt
+++ b/routes.txt
@@ -30,6 +30,10 @@
 /docs/build/apps/ingest-sdk
 /docs/build/apps/ingest-sdk/ingestion-pipeline-code
 /docs/build/apps/ingest-sdk/overview
+/docs/build/agentic-payments
+/docs/build/agentic-payments/mpp
+/docs/build/agentic-payments/mpp/channel-guide
+/docs/build/agentic-payments/mpp/charge-guide
 /docs/build/apps/overview
 /docs/build/apps/swift-payment-app
 /docs/build/apps/wallet
@@ -42,9 +46,9 @@
 /docs/build/apps/wallet/sep6
 /docs/build/apps/wallet/sep7
 /docs/build/apps/wallet/stellar
-/docs/build/apps/x402
-/docs/build/apps/x402/built-on-stellar
-/docs/build/apps/x402/quickstart-guide
+/docs/build/agentic-payments/x402
+/docs/build/agentic-payments/x402/built-on-stellar
+/docs/build/agentic-payments/x402/quickstart-guide
 /docs/build/apps/zk
 /docs/build/guides
 /docs/build/guides/archival

@github-actions

Copy link
Copy Markdown
Contributor

Warning

This change removes routes. The diff of routes is below. Please verify that these changes to the routes are intentional and that redirects are in place if needed. Redirects can be added to nginx/includes/redirects.conf.

diff --git a/routes.txt b/routes.txt
index b6a0cd2e..038abe92 100644
--- a/routes.txt
+++ b/routes.txt
@@ -30,6 +30,10 @@
 /docs/build/apps/ingest-sdk
 /docs/build/apps/ingest-sdk/ingestion-pipeline-code
 /docs/build/apps/ingest-sdk/overview
+/docs/build/agentic-payments
+/docs/build/agentic-payments/mpp
+/docs/build/agentic-payments/mpp/channel-guide
+/docs/build/agentic-payments/mpp/charge-guide
 /docs/build/apps/overview
 /docs/build/apps/swift-payment-app
 /docs/build/apps/wallet
@@ -42,9 +46,9 @@
 /docs/build/apps/wallet/sep6
 /docs/build/apps/wallet/sep7
 /docs/build/apps/wallet/stellar
-/docs/build/apps/x402
-/docs/build/apps/x402/built-on-stellar
-/docs/build/apps/x402/quickstart-guide
+/docs/build/agentic-payments/x402
+/docs/build/agentic-payments/x402/built-on-stellar
+/docs/build/agentic-payments/x402/quickstart-guide
 /docs/build/apps/zk
 /docs/build/guides
 /docs/build/guides/archival

@stellar-jenkins-ci

Copy link
Copy Markdown

1 similar comment
@stellar-jenkins-ci

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Warning

This change removes routes. The diff of routes is below. Please verify that these changes to the routes are intentional and that redirects are in place if needed. Redirects can be added to nginx/includes/redirects.conf.

diff --git a/routes.txt b/routes.txt
index b6a0cd2e..2c19c02e 100644
--- a/routes.txt
+++ b/routes.txt
@@ -2,6 +2,13 @@
 /404.html
 /docs
 /docs/build
+/docs/build/agentic-payments
+/docs/build/agentic-payments/mpp
+/docs/build/agentic-payments/mpp/channel-guide
+/docs/build/agentic-payments/mpp/charge-guide
+/docs/build/agentic-payments/x402
+/docs/build/agentic-payments/x402/built-on-stellar
+/docs/build/agentic-payments/x402/quickstart-guide
 /docs/build/apps
 /docs/build/apps/application-design-considerations
 /docs/build/apps/dapp-frontend
@@ -42,9 +49,6 @@
 /docs/build/apps/wallet/sep6
 /docs/build/apps/wallet/sep7
 /docs/build/apps/wallet/stellar
-/docs/build/apps/x402
-/docs/build/apps/x402/built-on-stellar
-/docs/build/apps/x402/quickstart-guide
 /docs/build/apps/zk
 /docs/build/guides
 /docs/build/guides/archival

@stellar-jenkins-ci

Copy link
Copy Markdown

@stellar-jenkins-ci

Copy link
Copy Markdown

@sagpatil
sagpatil merged commit b057ae6 into main Mar 31, 2026
10 checks passed
@sagpatil
sagpatil deleted the docs/add-mpp branch March 31, 2026 15:20
zachfedor pushed a commit to zachfedor/stellar-docs that referenced this pull request Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants