From e4b7a88a91f9a2b344724ddee3065dce0d687327 Mon Sep 17 00:00:00 2001 From: iLoveChicken Date: Wed, 29 Apr 2026 17:15:07 +0100 Subject: [PATCH 1/2] feat(samples): add human-present crypto-solana scenario (AP2 + Solana Pay reference binding) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a new human-present A2A scenario settling on-chain USDC on Solana, parallel to the existing cards, x402, and crypto-algo scenarios. ## What this adds code/samples/python/scenarios/a2a/human-present/crypto-solana/ README.md — full flow documentation run.sh — launcher script (starts Merchant, CP, MPP, Shopping Agent) ## Key design choice: Solana Pay reference pubkey binding Solana has no native memo field with reliable wallet support across all agentic clients. This scenario uses a Solana Pay 'reference' pubkey as the on-chain binding primitive: a fresh ed25519 pubkey is generated per checkout and included as a non-signer account on the SPL USDC transfer. solana:?amount=&spl-token=&reference= After settlement the Merchant Payment Processor Agent resolves the transaction deterministically via getSignaturesForAddress(reference). This is wallet-universal, agent-friendly, and cryptographically unique per checkout without amount-uniqueness gymnastics. ## Prerequisites GOOGLE_API_KEY or GOOGLE_GENAI_USE_VERTEXAI=true ALGOVOI_API_KEY (sign up at https://cloud.algovoi.co.uk) SOLANA_RPC_URL (defaults to public mainnet endpoint) --- .../a2a/human-present/crypto-solana/README.md | 142 ++++++++++++++++++ .../a2a/human-present/crypto-solana/run.sh | 130 ++++++++++++++++ 2 files changed, 272 insertions(+) create mode 100644 code/samples/python/scenarios/a2a/human-present/crypto-solana/README.md create mode 100644 code/samples/python/scenarios/a2a/human-present/crypto-solana/run.sh diff --git a/code/samples/python/scenarios/a2a/human-present/crypto-solana/README.md b/code/samples/python/scenarios/a2a/human-present/crypto-solana/README.md new file mode 100644 index 00000000..dac96938 --- /dev/null +++ b/code/samples/python/scenarios/a2a/human-present/crypto-solana/README.md @@ -0,0 +1,142 @@ + + +# Agent Payments Protocol Sample: Human Present Purchases with On-Chain Solana USDC + +This sample demonstrates the A2A `ap2-extension` for a human-present transaction +where the buyer settles with on-chain USDC on Solana (or native SOL for +micropayments). It mirrors the existing `x402` scenario but uses Solana Pay +semantics — specifically the **`reference` pubkey** primitive — to bind the +settling transaction to a specific AP2 `PaymentMandate`. + +**Note:** This sample pairs with the separate `crypto-algo` human-present +scenario. Together they cover non-EVM settlement on Algorand and Solana as a +complement to the EVM-focused `x402` path. + +## Scenario + +Human-present flows are commerce flows where the user is present to confirm +purchase details. The user signs the `PaymentMandate` giving all parties high +confidence in the transaction. + +The Solana variant adds one additional primitive on top of the standard AP2 +mandate chain: + +### Solana Pay `reference` binding + +Solana has no native transaction memo field (unlike Algorand or Hedera), and +the SPL Memo Program is unreliable across wallets. Instead, Solana Pay defines +a `reference` pubkey mechanism: + +1. The merchant (or its Merchant Agent) generates a fresh, single-use ed25519 + keypair per checkout. +2. The public key is embedded in the Solana Pay URL: + + ```text + solana: + ?amount= + &spl-token= + &reference= + &label=