{"id":50329340,"url":"https://github.com/hummusonrails/arbitrum-x402-aws","last_synced_at":"2026-05-29T08:32:50.461Z","repository":{"id":355837956,"uuid":"1223608111","full_name":"hummusonrails/arbitrum-x402-aws","owner":"hummusonrails","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-28T17:26:06.000Z","size":406,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-28T19:21:12.866Z","etag":null,"topics":["arbitrum","aws","aws-lambda","cloudfront","lambda-edge","x402"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hummusonrails.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-28T13:37:54.000Z","updated_at":"2026-05-28T17:26:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hummusonrails/arbitrum-x402-aws","commit_stats":null,"previous_names":["hummusonrails/arbitrum-x402-aws"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hummusonrails/arbitrum-x402-aws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hummusonrails%2Farbitrum-x402-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hummusonrails%2Farbitrum-x402-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hummusonrails%2Farbitrum-x402-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hummusonrails%2Farbitrum-x402-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hummusonrails","download_url":"https://codeload.github.com/hummusonrails/arbitrum-x402-aws/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hummusonrails%2Farbitrum-x402-aws/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33644306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arbitrum","aws","aws-lambda","cloudfront","lambda-edge","x402"],"created_at":"2026-05-29T08:32:50.385Z","updated_at":"2026-05-29T08:32:50.453Z","avatar_url":"https://github.com/hummusonrails.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Banner --\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\".github/banner.svg\" alt=\"arbitrum-x402-aws\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n\u003c!-- Badges --\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square\" alt=\"License: MIT\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://nodejs.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Node-20.x-339933.svg?style=flat-square\" alt=\"Node 20\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pnpm.io/\"\u003e\u003cimg src=\"https://img.shields.io/badge/pnpm-9.x-F69220.svg?style=flat-square\" alt=\"pnpm 9\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.python.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Python-3.10+-3776AB.svg?style=flat-square\" alt=\"Python 3.10+\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://docs.astral.sh/uv/\"\u003e\u003cimg src=\"https://img.shields.io/badge/uv-0.x-261230.svg?style=flat-square\" alt=\"uv\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.typescriptlang.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/TypeScript-5.x-3178C6.svg?style=flat-square\" alt=\"TypeScript 5\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://aws.amazon.com/cdk/\"\u003e\u003cimg src=\"https://img.shields.io/badge/AWS_CDK-2.x-FF9900.svg?style=flat-square\" alt=\"AWS CDK 2\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://aws.amazon.com/bedrock/agentcore/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Bedrock_AgentCore-preview-FF9900.svg?style=flat-square\" alt=\"Bedrock AgentCore\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://arbitrum.io/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Arbitrum-One-12AAFF.svg?style=flat-square\" alt=\"Arbitrum One\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.x402.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/x402-v2-8B5CF6.svg?style=flat-square\" alt=\"x402 v2\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eEnd-to-end x402 payments on Arbitrum One. AWS CloudFront + Lambda@Edge merchant, paid by an AWS Bedrock AgentCore Python agent. USDC settles on Arbitrum One via Coinbase CDP.\u003c/strong\u003e\n\u003c/p\u003e\n\n## What's in this repo\n\n| App | Path | Language | Role |\n|:----|:-----|:---------|:-----|\n| Merchant | [`apps/merchant`](apps/merchant/README.md) | TypeScript (pnpm) | Returns HTTP 402, verifies + settles via CDP facilitator, serves gated JSON |\n| Agent | [`apps/agent`](apps/agent/README.md) | Python (uv) | Holds embedded wallet via AgentCore, pays on 402, retries with proof |\n| `@x402-aws/shared` | [`packages/shared`](packages/shared) | TypeScript (pnpm) | x402 v2 protocol types + Arbitrum constants |\n\n## Architecture\n\n```mermaid\ngraph LR\n    subgraph AC[AWS AgentCore]\n      A[Python Agent\u003cbr/\u003ePaymentManager]\n      W[Embedded Wallet\u003cbr/\u003eCoinbase CDP]\n      A --\u003e W\n    end\n    subgraph AWS[AWS us-east-1]\n      CF[CloudFront]\n      LE[Lambda Edge\u003cbr/\u003e402 Handler]\n      AG[API Gateway]\n      OL[Origin Lambda]\n    end\n    CDP[CDP Facilitator]\n    L1[Arbitrum One USDC]\n\n    A --\u003e|GET /report| CF\n    CF -.-\u003e|viewer-request| LE\n    LE --\u003e|verify+settle| CDP\n    CDP --\u003e|EIP 3009| L1\n    LE --\u003e|on payment| AG\n    AG --\u003e OL\n\n    classDef aws fill:#FF9900,stroke:#fff,color:#0b1018\n    classDef arb fill:#12AAFF,stroke:#fff,color:#0b1018\n    classDef agent fill:#8B5CF6,stroke:#fff,color:#fff\n    classDef cdp fill:#1652F0,stroke:#fff,color:#fff\n    class CF,LE,AG,OL,AC aws\n    class L1 arb\n    class A,W agent\n    class CDP cdp\n```\n\n## End-to-end flow\n\n```mermaid\nsequenceDiagram\n    autonumber\n    participant A as Python Agent\n    participant ACore as AgentCore\u003cbr/\u003ePaymentManager\n    participant CF as CloudFront\n    participant LE as Lambda Edge\n    participant CDP as CDP Facilitator\n    participant L1 as Arbitrum One\n\n    A-\u003e\u003eCF: GET /report\n    CF-\u003e\u003eLE: viewer-request\n    LE--\u003e\u003eA: 402 + accepts[]\n    A-\u003e\u003eACore: generate_payment_header(402 body)\n    Note over ACore: Check session budget,\u003cbr/\u003esign via embedded wallet\n    ACore--\u003e\u003eA: X-PAYMENT header\n    A-\u003e\u003eCF: GET /report (X-PAYMENT)\n    CF-\u003e\u003eLE: viewer-request\n    LE-\u003e\u003eCDP: verify + settle\n    CDP-\u003e\u003eL1: transferWithAuthorization\n    L1--\u003e\u003eCDP: tx hash\n    CDP--\u003e\u003eLE: success + txHash\n    LE--\u003e\u003eA: 200 + gated JSON + Arbiscan link\n```\n\n\u003c!-- Featured --\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://x.com/hummusonrails/status/2049363842283544939\"\u003e\n    \u003cimg src=\".github/x402-on-arbitrum-meets-aws.jpg\" alt=\"x402 on Arbitrum meets AWS — read the article on X\" width=\"640\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003csub\u003e\u003cstrong\u003eFeatured on X\u003c/strong\u003e \u0026middot; \u003ca href=\"https://x.com/hummusonrails/status/2049363842283544939\"\u003eThe narrative behind this synthesis of x402, Arbitrum, and AWS \u0026rarr;\u003c/a\u003e\u003c/sub\u003e\n\u003c/p\u003e\n\n## Quick Start\n\n```bash\n# 1. Install both stacks\nmake install\n\n# 2. Configure\ncp .env.example .env\n$EDITOR .env   # set RECIPIENT_ADDRESS, AGENTCORE_*, etc.\n\n# 3. Print CDP env for the merchant\npnpm --filter @x402-aws/merchant print-cdp-env /path/to/cdp_api_key.json\n# Paste the printed lines into .env\n\n# 4. Bootstrap CDK\npnpm --filter @x402-aws/merchant exec cdk bootstrap aws://$ACCOUNT_ID/us-east-1\n\n# 5. Deploy the merchant\nmake deploy-merchant\n\n# 6. Set RESOURCE_URL in .env from the merchant's DistributionDomainName output\n\n# 7. Bootstrap the agent (creates AgentCore resources, prompts you to fund the wallet)\nmake setup-agent\n\n# 8. Paste the printed PAYMENT_* IDs into .env\n\n# 9. Run the agent\nmake run-agent\n```\n\n## Makefile\n\n| Target | What it does |\n|:-------|:-------------|\n| `make install` | `pnpm install` + `uv sync` |\n| `make test` | All tests across both stacks |\n| `make synth` | CDK synth for the merchant |\n| `make deploy-merchant` | CDK deploy |\n| `make destroy-merchant` | CDK destroy |\n| `make setup-agent` | Bootstrap AgentCore resources (one-time) |\n| `make run-agent` | Run the agent against the merchant |\n| `make teardown-agent` | Delete AgentCore resources |\n| `make clean` | Remove all build artifacts and venvs |\n\n## Tests\n\n```bash\nmake test\n```\n\n26 tests: 17 in the merchant (vitest), 2 in `@x402-aws/shared` (vitest), 7 in the agent (pytest).\n\n## Stack\n\n| Layer | Tool |\n|:------|:-----|\n| Workspace | pnpm 9+ (apps/merchant, packages/*) + uv (apps/agent) + root Makefile |\n| Merchant IaC | AWS CDK 2 (TypeScript) |\n| CDN / edge | CloudFront + Lambda@Edge (Node 20, x86_64) |\n| Origin | API Gateway HTTP API + Lambda (Node 20, ARM) |\n| Settlement | CDP x402 facilitator |\n| Agent runtime | Python 3.10+, `boto3`, `bedrock-agentcore[strands-agents]`, `httpx` |\n| Wallet | AgentCore embedded wallet, Coinbase CDP |\n| Chain | Arbitrum One (CAIP-2 `eip155:42161`) |\n| Asset | Native USDC (`0xaf88d065e77c8cC2239327C5EDb3A432268e5831`) |\n\n## Contributing\n\nPRs welcome. Open an issue first for anything non-trivial.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhummusonrails%2Farbitrum-x402-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhummusonrails%2Farbitrum-x402-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhummusonrails%2Farbitrum-x402-aws/lists"}