docs: decide USDC-over-SAC payment rail and testnet agent-wallet custody (ADR-0003) with a verified testnet payment PoC - #59
Merged
Conversation
…stnet PoC Consumers pay agents with a direct USDC transfer through the SAC to the agent's muxed address, whose muxed id is the hire id. The server verifies over plain HTTP (getTransaction, xdrFormat json): status, emitting SAC, recipient, exact amount, hire id, and unused tx hash. Agent wallets are server-custodied G-accounts on testnet only; mainnet needs smart accounts. Server signing uses stellar_dart. spikes/payments-poc/pay.sh makes and verifies a real testnet payment. Resolves the deploy signing steps left pending in ADR-0004 (#33). Allows .env.example files through .gitignore.
5 tasks
Deploying puls3 with
|
| Latest commit: |
e811502
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a297e7f6.puls3-4lw.pages.dev |
| Branch Preview URL: | https://docs-7-payments-and-wallets.puls3-4lw.pages.dev |
XxHugheadxX
added a commit
that referenced
this pull request
Sep 26, 2026
contracts/README.md points to it; it was missing because .gitignore ignored every .env.example until #59.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7
Summary
Decides how consumers pay agents and who holds agent keys, with a real testnet payment as proof.
docs/spikes/payments-and-wallets.md: answers the 6 questions of spike: agent payment rail and wallet custody on Stellar #7, each with sourcesdocs/adr/0003-payment-rail-and-custody.md: the decision, alternatives, and impact on feat: register agent flow (wallet and on-chain identity) #18, feat: hire and pay endpoint with on-chain payment verification #19, feat: wallet connection in Flutter app #25, chore: testnet configuration and secrets management #30, spike: agent definition (manifest) and deployment model for Agent Studio #33, feat: Agent Escrow and Payment contract on Soroban #55spikes/payments-poc/pay.sh(+README.md,.env.example): makes one real testnet payment on the chosen rail and verifies it over plain HTTPdocs/spikes/agent-definition.md,docs/adr/0004-…: resolve deploy steps 3 and 5, which spike: agent definition (manifest) and deployment model for Agent Studio #33 left pending on this ADR.gitignore: add!**/.env.example. The**/.env.*rule from feat(contracts): add agent identity registry per ADR-0002 #56 was ignoring every.env.example, including the one spike: agent payment rail and wallet custody on Stellar #7 requiresDecisions
transferevent returns it asto_muxed_id, so one event proves who was paid, how much, and for which hire. No x402, MPP SDK, or escrow in the MVP.getTransaction,xdrFormat: "json") and accepts a payment only if: status isSUCCESS; the event comes from the configured USDC SAC (a look-alike token must not pass);tois the agent wallet; the amount matches exactly;to_muxed_idis the hire id; and the tx hash was not used before. The PoC showed the same hire can be paid twice, so the server must dedupe.stellar_dart(pure Dart), inside the ServerpodLedgerPortadapter. Fallback: a TypeScript sidecar.set_agent_wallettwo-party auth: the agent account is the transaction source (server signs), and the builder signs only their authorization entry with Freighter'ssignAuthEntry.Acceptance criteria
.env.exampleis provided)Verification evidence
Explorer: https://stellar.expert/explorer/testnet/tx/17ac14e085609df8e042b84e6c25aac7e1c30344eaa1b1fd0bcbed399b65243f
Negative checks on the same transaction, with the script's matching rules:
Secret scan on the diff (
S[A-Z2-7]{55}): no matches.git check-ignoreconfirms.env.exampleis tracked while.env,.env.localand.env.productionstay ignored.Notes for reviewers
set_agent_wallettwo-party signing andgetEventsin JSON are documented but not run; they are open questions for feat: register agent flow (wallet and on-chain identity) #18 and feat: agent catalog endpoints with on-chain indexing #17.