docs: add MPP on Stellar documentation - #2327
Conversation
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.
There was a problem hiding this comment.
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.
| currency: USDC_SAC_TESTNET, | ||
| network: 'testnet', | ||
| feePayer: Keypair.fromSecret(process.env.FEE_PAYER_SECRET), // pays tx fees | ||
| }), |
There was a problem hiding this comment.
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.
| | 402 Payment Required | | ||
| | (channel: C..., amount: 0.1) | | ||
| |<-----------------------------| | ||
| | | | ||
| | Sign commitment off-chain | | ||
| | (cumulative: 0.1 XLM) | | ||
| |----------------------------->| |
There was a problem hiding this comment.
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.
| const mppx = Mppx.create({ | ||
| secretKey: process.env.MPP_SECRET_KEY ?? 'my-channel-secret', | ||
| methods: [ | ||
| stellar.channel({ |
There was a problem hiding this comment.
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).
|
Preview is available here: |
|
Preview is available here: |
|
Preview is available here: |
1 similar comment
|
Preview is available here: |
|
Preview is available here: |
marcelosalloum
left a comment
There was a problem hiding this comment.
LGTM!
💡 Now that we have both MPP and x402, we should nest them under the same "Agentic Payments" umbrella.
marcelosalloum
left a comment
There was a problem hiding this comment.
Some improvements
| ``` | ||
| 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] | | ||
| ``` |
There was a problem hiding this comment.
This flow should cover interactions with the Stellar blockchain
There was a problem hiding this comment.
Why is this file called quickstart-guide? It should be called charge-guide
There was a problem hiding this comment.
Can we additionally add a flowchart here, like what we have in the channel guide
|
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 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
|
|
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 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
|
|
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 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
|
|
Preview is available here: |
1 similar comment
|
Preview is available here: |
|
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 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
|
|
Preview is available here: |
|
Preview is available here: |
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 Requiredstatus code for machine-to-machine payments. The Stellar implementation viastellar-mpp-sdksettles payments directly on-chain via Soroban SAC transfers — no external facilitator needed.Files added
docs/build/apps/mpp/_category_.jsondocs/build/apps/mpp/README.mdxdocs/build/apps/mpp/quickstart-guide.mdxdocs/build/apps/mpp/channel-guide.mdxKey differences from x402
Related