This monorepo hosts two parallel implementations of the x402 payment protocol for the Casper Network. Both add Casper as a supported network to the x402 ecosystem so HTTP APIs can require micropayments settled on-chain using CEP-18 tokens authorized via EIP-712 signatures.
| Implementation | Path | Description |
|---|---|---|
| Go | go/ |
x402 server middleware, Casper signers and reference facilitator / resource server / client / CSPR.click React app built on the official Casper Go SDK |
| TypeScript | js/ |
@make-software/casper-x402 package — drop-in mechanism for Node.js, plus Express-based facilitator / server / client demos backed by casper-js-sdk |
Both implementations target the same casper:* CAIP-2 family and the same
CEP-18 transfer_with_authorization entry point, so a client built against
one interoperates with a server or facilitator written in the other.
x402 is an open standard for internet-native payments over HTTP. When a client requests a paid resource:
- The resource server responds with
402 Payment RequiredplusPaymentRequirementsdescribing accepted networks, schemes, prices and assets. - The client builds a
PaymentPayload— an EIP-712 signed authorization — and replays the request with aPAYMENT-SIGNATUREheader. - The resource server forwards the payload to a facilitator for verification and, on success, for on-chain settlement.
- The facilitator submits a Casper
transfer_with_authorizationdeploy to the CEP-18 contract and waits for confirmation. - The resource server returns the protected response.
Both implementations support the exact scheme on the casper:* CAIP-2
family, backed by the
casper-ecosystem/casper-eip-712
typed-data specification.
Source: go/docs/architecture.mmd
casper-x402/
├── go/ # Go implementation — see go/README.md
├── js/ # TypeScript implementation — see js/README.md
└── infra/ # Local NCTL stack + Dockerfiles for the Go examples and CSPR.click React demo
- go/README.md — Go module, internal packages, demo apps (facilitator, resource server, client, CSPR.click React app) and per-binary configuration.
- js/README.md —
@make-software/casper-x402package, Express-based facilitator / server / client demos and TypeScript toolchain. - infra/ — Docker Compose stack that wires a local NCTL node, the CEP-18 token deployer, and Dockerfiles that build the Go binaries and the CSPR.click React app.
This project is licensed under the Apache License 2.0.
