text stringlengths 79 20.2k |
|---|
Source: x402-foundation (Apache-2.0) foundation/README.md
# x402 Foundation Policy Repo
This repo contains several documents related to the operations of the [x402 Foundation](https://www.x402.org/).
|
Source: x402-foundation (Apache-2.0) foundation/policies-guidelines/slack-guidelines.md
# x402 Foundation Slack Guidelines
Slack is the primary real-time communication platform for the x402 Foundation community, complementing GitHub (for code and specs), mailing lists, and community calls. The x402 community includes ... |
Source: x402-foundation (Apache-2.0) foundation/policies-guidelines/slack-guidelines.md
## Admins and Moderators
- A public, centrally maintained list of Slack admins/moderators (name, organization, timezone) will live in the foundation repo.
- Reach admins by tagging @operations for public asks, or DM for anything se... |
Source: x402-foundation (Apache-2.0) foundation/policies-guidelines/slack-guidelines.md
## General Usage Guidelines
### Encouraged
- Following the Code of Conduct.
- Keeping discussion on-topic for the channel and putting discussions in the appropriate channels. For example, GitHub/PR-related conversation belongs in #... |
Source: x402-foundation (Apache-2.0) foundation/policies-guidelines/slack-guidelines.md
### Prohibited
- Violations of the Code of Conduct.
- Spam and self-promotion, including unsolicited posting of blogs, personal projects, or vendor pitches outside designated channels.
- Unsolicited DMs! Don't message a member who ... |
Source: x402-foundation (Apache-2.0) foundation/policies-guidelines/slack-guidelines.md
## Channel Management
_Should a new channel exist?_
- It must relate to x402 (protocol, an SDK/implementation, a working group, a sub-project, or the surrounding ecosystem).
- The related project should already be public/open sourc... |
Source: x402-foundation (Apache-2.0) foundation/policies-guidelines/slack-guidelines.md
Bots, tokens, and webhooks are reviewed on a case-by-case basis with most requests being rejected due to security, privacy, and usability concerns. Bots and the like tend to make a lot of noise in channels.
Any bot, OAuth app, to... |
Source: x402-foundation (Apache-2.0) wg-domain-discovery/README.md
# Domain Discovery Working Group
## Meetings
Bi-weekly on Mondays 10:00 AM CT | 11:00 AM ET | 8:00 AM PT | 4:00 PM BST | 11:00 PM SGT
A schedule of public meetings can be found and the links to join can be found [here](https://x402.org/get-involved/... |
Source: x402-foundation (Apache-2.0) wg-domain-discovery/proposal/verifier-schema-examples.md
# Worked examples
## 1. nohumans.directory
Free record lookup at `GET /v1/resolve?url=`, paid verdict over x402 at `GET /v1/listings/{id}/verdict`. Today emits `pay | caution | avoid` with prose reasons; under this schema t... |
Source: x402-foundation (Apache-2.0) wg-domain-discovery/proposal/verifier-schema-examples.md
- settled-under-terms / probe-ok ← route: true, split by whether an independent paid-fulfillment record exists
- wrong-domain, terms-mismatch ← route: false, with the mismatched field named
- inconclusive ← route_state: "inco... |
Source: x402-foundation (Apache-2.0) wg-domain-discovery/proposal/verifier-schema.md
# Verifier response schema
Proposed for the verification pointer object in issue #5 ({url, method}). Field set builds on the straw man from minia2auk, jalcodev, and nohumans.directory in that thread.
## Verdict object
|
Source: x402-foundation (Apache-2.0) wg-domain-discovery/proposal/verifier-schema.md
- `verdict`: `true` | `false` | `inconclusive`
- `reason`: a code from a closed, append-only set. Codes are never renumbered, split, or reused with a different meaning, since a persisted audit trail would silently reread as whatever t... |
Source: x402-foundation (Apache-2.0) wg-domain-discovery/proposal/verifier-schema.md
`terms` means the verifier checked the discovery record's stated terms without contacting the live resource. A verifier that reads the live challenge reaches `probe` directly, so `terms` is reserved for checks made against the discove... |
Source: x402-foundation (Apache-2.0) wg-domain-discovery/proposal/verifier-schema.md
- `detail`: companion to `reason`, `{field, expected, got}`. Required when `reason` is `wrong-domain`, `terms-mismatch`, `mapping-unknown`, or `mapping-stale`, the codes that reference a specific field. Optional otherwise. `reason` st... |
Source: x402-foundation (Apache-2.0) wg-domain-discovery/proposal/verifier-schema.md
## Recommendation object (separate, cites the verdict)
`recommendation` is not part of the verdict object. Verifiers that emit a policy judgment (pay/caution/avoid or similar) put it here, citing the verdict rather than replacing it.... |
Source: x402-foundation (Apache-2.0) wg-domain-discovery/proposal/verifier-schema.md
A client SHOULD prefer a verification object independent of the resource operator over one the operator names in its own record. A self-referential pointer (verifier and resource operator share ownership, infrastructure, or configurat... |
Source: x402-foundation (Apache-2.0) wg-identity/README.md
# Identity Working Group
## Goals
Describe the purpose of the group in no more that 4-5 sentences.
Goals are the distinct outcomes that is to be anticipated from the working group, serving as a method for validating activities.
Goals of the WG are:
1. xxxx... |
Source: x402-foundation (Apache-2.0) wg-tax/README.md
# Tax Working Group
## Goals
Describe the purpose of the group in no more that 4-5 sentences.
Goals are the distinct outcomes that is to be anticipated from the working group, serving as a method for validating activities.
Goals of the WG are:
1. xxxx
2. xxxx
... |
Source: x402-foundation (Apache-2.0) x402/CONTRIBUTING.md
# Contributing
x402 welcomes contributions of schemes, middleware, new chain support, and more. We aim to make x402 as secure and trusted as possible. Merging contributions is at the discretion of the x402 Foundation team, based on the risk of the contribution... |
Source: x402-foundation (Apache-2.0) x402/CONTRIBUTING.md
- **You must review AI output before requesting review.** Do not open a non-Draft PR until you have personally verified the generated code. AI-generated PRs submitted without human review waste maintainer time and erode trust.
- **Remove verbosity and filler.**... |
Source: x402-foundation (Apache-2.0) x402/CONTRIBUTING.md
Contributions that show clear signs of unreviewed AI output (generic filler comments, hallucination, redundant boilerplate, cookie-cutter PR descriptions) may be closed without detailed review.
### Sample Prompt for AI-Assisted Development
If you use an AI co... |
Source: x402-foundation (Apache-2.0) x402/CONTRIBUTING.md
3. VERIFY AGAINST THE SPEC. Before writing payment, signing, or settlement
logic, read the relevant spec in specs/. Do not invent header names, payload
fields, or signing flows. If you are unsure whether a field or constant
exists, search the codebase ... |
Source: x402-foundation (Apache-2.0) x402/CONTRIBUTING.md
8. TEST CORRECTNESS. Generated tests must assert meaningful behavior, not just
that "the function doesn't throw." Do not fabricate expected values — derive
them from the spec or existing test fixtures.
9. COMMUNITY CHANNELS. GitHub issues are for bug rep... |
Source: x402-foundation (Apache-2.0) x402/CONTRIBUTING.md
- [TypeScript Development Guide](typescript/CONTRIBUTING.md)
- [Python Development Guide](python/CONTRIBUTING.md)
- [Go Development Guide](go/CONTRIBUTING.md)
- [Specifications Guide](specs/CONTRIBUTING.md)
## Contributing Workflow
### 1. Find or Create an Is... |
Source: x402-foundation (Apache-2.0) x402/CONTRIBUTING.md
For **user-facing changes** (behavior changes, bug fixes, new features, breaking changes), add a changelog fragment for the SDK(s) you modified. Docs-only changes and internal refactors that do not affect users can skip fragments.
- **TypeScript**: Changesets ... |
Source: x402-foundation (Apache-2.0) x402/CONTRIBUTING.md
These are the steps CI runs. `build:paywall-deps` matters: the templates bundle the built `@x402/core` and mechanism packages, so stale builds produce different output.
This generates template files in:
- `typescript/packages/http/paywall/src/evm/gen/template.... |
Source: x402-foundation (Apache-2.0) x402/CONTRIBUTING.md
Commit the generated files with your PR. The Check Paywall Template workflow regenerates them on pull requests that touch paywall source or the generated files, and fails if they differ. Because the bundle includes other packages and the lockfile, a regen can a... |
Source: x402-foundation (Apache-2.0) x402/CONTRIBUTING.md
If your chain is EVM-compatible and you want to add a default stablecoin for
dollar-string pricing (`"$0.10"`), you don't need the full 3-PR workflow below. See
[DEFAULT_ASSETS.md](DEFAULT_ASSETS.md) for instructions. If that default asset uses
**decimals other... |
Source: x402-foundation (Apache-2.0) x402/CONTRIBUTING.md
| SDK | Interfaces |
|-----|------------|
| TypeScript (`@x402/core`) | `SchemeNetworkClient`, `SchemeNetworkServer`, `SchemeNetworkFacilitator` |
| Go (`github.com/x402-foundation/x402/go/v2`) | `ClientScheme`, `ServerScheme`, `FacilitatorScheme` |
| Python (`... |
Source: x402-foundation (Apache-2.0) x402/CONTRIBUTING.md
**Further steps:**
- Add package publishing workflow in [`.github/workflows/`](.github/workflows/) following existing patterns
- Add READMEs for new packages, see [`typescript/packages/mechanisms/evm/README.md`](typescript/packages/mechanisms/evm/README.md)
- G... |
Source: x402-foundation (Apache-2.0) x402/DEFAULT_ASSETS.md
# Default Assets
When a server uses `price: "$0.10"` syntax (USD string pricing), x402 needs to know which stablecoin to use on that network. Each chain-family SDK maintains a **default asset table** that maps networks to USD-pegged tokens the SDK recognizes... |
Source: x402-foundation (Apache-2.0) x402/DEFAULT_ASSETS.md
```typescript
export const DEFAULT_ASSETS: DefaultAssetTable<MyAssetInfo> = {
"eip155:8453": [
{ asset: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", decimals: 6, symbol: "USDC", /* … */ },
],
};
```
Each entry uses the `asset` field (not `address`) ... |
Source: x402-foundation (Apache-2.0) x402/DEFAULT_ASSETS.md
The **first** asset in each network's array is what a bare `"$0.10"` resolves to. Additional entries support suffixed prices (`"$0.10 USDT"`) on networks that list more than one USD-pegged token.
### USD-peg invariant
All entries in `DEFAULT_ASSETS` are tre... |
Source: x402-foundation (Apache-2.0) x402/DEFAULT_ASSETS.md
| Method | Use Case | Notes |
|--------|----------|-------|
| **EIP-3009** (default) | Tokens with `transferWithAuthorization` (e.g., USDC) | Simplest — single signature, no approval step |
| **Permit2** | Any ERC-20 token | Universal fallback — requires one-... |
Source: x402-foundation (Apache-2.0) x402/DEFAULT_ASSETS.md
```typescript
"eip155:YOUR_CHAIN_ID": [
{
asset: "0xYOUR_STABLECOIN_ADDRESS",
name: "Token Name", // EIP-712 domain name
version: "1", // EIP-712 domain version
decimals: 6,
symbol: "USDC",
// assetTra... |
Source: x402-foundation (Apache-2.0) x402/DEFAULT_ASSETS.md
The paywall renders a "Need {token} on {chain}? Request some here." link on testnet payment requirements. Without a configured faucet URL, the paywall renders "No faucet configured." instead.
Add one line to `typescript/packages/http/paywall/src/faucetUrls.t... |
Source: x402-foundation (Apache-2.0) x402/README.md
# x402
[](http://slack.x402.org/)
x402 is an open standard for internet native payments. It aims to support all networks (both crypto & fiat) and forms of value... |
Source: x402-foundation (Apache-2.0) x402/README.md
<details>
<summary><b>Python</b></summary>
<br/>
> See the [**`python/x402`**](./python/) folder for code examples and integration guides.
```shell
pip install x402
```
</details>
<details>
<summary><b>Go</b></summary>
<br/>
> See the [**`go/`**](./go/) fold... |
Source: x402-foundation (Apache-2.0) x402/README.md
- **Open standard:** x402 is an open standard, freely accessible and usable by anyone. It will never force reliance on a single party.
- **HTTP / Transport Native:** x402 is meant to seamlessly complement existing data transportation. It should whenever possible not ... |
Source: x402-foundation (Apache-2.0) x402/README.md
## Ecosystem
**Community:** join the [x402 Slack](http://slack.x402.org/) to ask questions, discuss ideas, and share what you're building.
Curated third-party SDKs, extensions, and facilitators are listed in the [Developer Tools docs](https://docs.x402.org/dev-tool... |
Source: x402-foundation (Apache-2.0) x402/README.md
Do not assume the public x402.org facilitator is the default production path for mainnet EVM routes. See the [Facilitator docs](https://docs.x402.org/core-concepts/facilitator), [Facilitators directory](https://docs.x402.org/dev-tools/facilitators), and [Networks & T... |
Source: x402-foundation (Apache-2.0) x402/README.md
x402 payments typically adhere to the following flow, but servers have a lot of flexibility. See `advanced` folders in `examples/`.

The following outlines the flow of a payment using the `x402` protocol. Note that steps (1) and (2) are optiona... |
Source: x402-foundation (Apache-2.0) x402/README.md
7. If the `Verification Response` is valid, the resource server performs the work to fulfill the request. If the `Verification Response` is invalid, the resource server returns a `402 Payment Required` status and a `Payment Required Response` JSON object in the respo... |
Source: x402-foundation (Apache-2.0) x402/README.md
Each payment scheme may have different operational functionality depending on what actions are necessary to fulfill the payment.
For example, **`exact`** transfers a specific amount (for example, pay $1 to read an article). **`upto`** authorizes up to a maximum per r... |
Source: x402-foundation (Apache-2.0) x402/SECURITY.md
# Security Policy
The x402 Foundation takes security seriously. A bug bounty program is coming soon.
Please report non-sensitive bugs through [GitHub Issues][1].
If you discover a potential vulnerability or other sensitive security issue, do not open a public Gi... |
Source: x402-foundation (Apache-2.0) x402/TSC.md
# Technical Steering Commitee
The following are the Participating Organizations of the Technical Steering Committee and their Representatives, listed in order of greatest to least seniority:
|Participating Organization | Representative|
|--------------|---------------... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/authoring-specs/SKILL.md
---
name: authoring-specs
description: Guidelines for authoring x402 specification files. Use when writing or proposing a new x402 spec, such as a per-network scheme spec (scheme_<name>_<chain>.md).
---
# Authoring x402 specs
Guidance ... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/authoring-specs/SKILL.md
- Be transport agnostic: specify message contents, not how a particular transport carries them.
- Reference core types (`PaymentRequirements`, `PaymentPayload`, `SettlementResponse`) from [`x402-specification-v2.md`](../../../specs/x402-... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/authoring-specs/references/new-network-scheme-spec.md
# New network scheme spec
Checklist for authoring a new per-network scheme spec file (`scheme_<name>_<chain>.md`). Follow the [general spec rules](../SKILL.md) as well.
## Spec contents
- Scheme-specific i... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/authoring-specs/references/new-network-scheme-spec.md
- Comply with the network-agnostic scheme definition (e.g. `scheme_exact_<network>.md` complies with [`scheme_exact.md`](../../../../specs/schemes/exact/scheme_exact.md)).
- Reuse field names already establis... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/authoring-specs/references/new-network-scheme-spec.md
- Stateless design is strongly preferred for client and server, and especially the facilitator. A short-lived cache is acceptable but needs to be well justified (see the duplicate-settlement mitigation in [`s... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/authoring-specs/references/new-network-scheme-spec.md
- Do not introduce new facilitator endpoints beyond `verify/`, `settle/`, and `supported/`. A scheme must express all facilitator interactions through these existing endpoints.
- Use transaction simulation, n... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/authoring-specs/references/new-network-scheme-spec.md
- The client must treat all server-provided fields as untrusted and must not rely on a server value for anything it can determine authoritatively itself. For example, if a scheme placed token `decimals` in `e... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/SKILL.md
---
name: contributing
description: Guidelines and conventions for contributing to the x402 codebase. Use when preparing a PR to the upstream x402-foundation/x402 repository such as fixing a bug or Issue, implementing a new feature, adding ... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/SKILL.md
- Write clean, readable code (e.g. prefer guard clauses over nested conditionals, use descriptive names and small, single-purpose functions).
- Strong typing, avoid any weak types (`any`, `unknown`, and their equivalents in other languages)... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/SKILL.md
- Add a test that fails before the fix and passes after it.
- Don't write tests for what the type system already guarantees.
- Cover edge cases, not only happy path.
## Commits and PRs
- Verifying (signing) ALL commits is strictly require... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/SKILL.md
# Python (from python/x402/)
uv run towncrier create --content "Fixed ..." <PR>.bugfix.md
```
## New mechanism or extension
- New payment mechanism / scheme: see [references/new-mechanism.md](references/new-mechanism.md).
- New extension:... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/references/new-extension.md
# New extension implementation
Checklist for adding a new extension. Follow the [general contributing rules](../SKILL.md) as well.
## Spec first
- A spec file must exist. If it does not, write it first.
- The spec must... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/references/new-extension.md
- Wire extensions with lifecycle hooks via the extension-hooks adapter pattern.
- Reuse core and extension utilities instead of reimplementing them.
- Do NOT modify other packages (core, http, ...). If this is deemed nece... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/references/new-extension.md
Add server, client, and facilitator examples (as appropriate). Manually confirm a successful payment by running facilitator server and client examples locally.
## Docs
- Add READMEs for the SDK and all examples.
|
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/references/new-mechanism.md
# New mechanism implementation
Checklist for adding a new payment mechanism / scheme. Follow the [general contributing rules](../SKILL.md) as well.
## Spec first
- A spec file must exist. If it does not, write it first... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/references/new-mechanism.md
- One language per PR. Never implement the mechanism in more than one SDK (TypeScript, Python, Go) in a single PR.
- If a reference implementation already exists in another SDK, cross-check against it; otherwise yours is ... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/references/new-mechanism.md
- Wire schemes with the builder pattern, not `register*` helpers. A new v2-only mechanism registers its scheme under the family wildcard: `client.register("<family>:*", new Exact<Chain>Scheme(...))` (and the same on `x402... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/references/new-mechanism.md
## Tests
### Unit tests
- Pure-logic tests that run offline with no live RPC or network calls. Add them with comparable coverage to the EVM reference under **TS** `typescript/packages/mechanisms/<chain>/test/unit/`; **G... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/references/new-mechanism.md
- The `e2e/` harness runs client × server × facilitator combinations from the mechanisms catalog. Requires funded testnet accounts.
- Add `e2e/config/mechanisms_<id>.json` (`env`, `testnet`/`mainnet`, `routes` with `sdks`... |
Source: x402-foundation (Apache-2.0) x402/.agents/skills/contributing/references/new-mechanism.md
- **TS**: Add `publish_npm_scoped_x402_<chain>.yml` workflow and add package to `publish_npm_scoped_x402_all.yml`.
- **Py**: Add an optional extra in `python/x402/pyproject.toml`; uses existing `publish_pypi_x402.yml`.
- ... |
Source: x402-foundation (Apache-2.0) x402/.github/pull_request_template.md
<!--
Thanks for contributing to x402!
Please fill out the information below to help reviewers understand your changes.
Note: We require commit signing.
See here for instructions: https://docs.github.com/en/authentication/managing-commit-signat... |
Source: x402-foundation (Apache-2.0) x402/.github/pull_request_template.md
- TypeScript: add a Changesets file under `typescript/.changeset/*.md`
- Create: `pnpm -C typescript changeset`
- Select only publishable `@x402/*` packages
- Go: add a Changie fragment under `go/.changes/unreleased/*`
- Create: `make -C ... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
# x402 EVM Contracts
Smart contracts for the x402 payment protocol on EVM chains.
## Overview
The x402 Permit2 Proxy contracts enable trustless, gasless payments using [Permit2](https://github.com/Uniswap/permit2). There are two variants:
### `x402E... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
| Contract | Address |
|----------|---------|
| x402BatchSettlement | `0x4020074e9dF2ce1deE5A9C1b5c3f541D02a10003` |
| ERC3009DepositCollector | `0x4020806089470a89826cB9fB1f4059150b550004` |
| Permit2DepositCollector | `0x4020425FAf3B746C082C2f942b4E51... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
| Chain | Exact | Upto |
|-------|-------|------|
| Base Mainnet | [Deployed](https://basescan.org/address/0x402085c248EeA27D92E8b30b2C58ed07f9E20001) | [Deployed](https://basescan.org/address/0x4020A4f3b7b90ccA423B9fabCc0CE57C6C240002) |
| Base Sepolia... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
| Chain | x402BatchSettlement | ERC3009DepositCollector | Permit2DepositCollector |
|-------|---------------------|------------------------|------------------------|
| Base Mainnet | [Deployed](https://basescan.org/address/0x4020074e9dF2ce1deE5A9C1b5c3f... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
> \*Older testnet deployments may use prior vanity salts; the canonical **Upto** address for
> CREATE2 deployments from this tree is `0x4020A4f3…C240002` (see `forge script script/ComputeAddress.s.sol`).
## Prerequisites
- [Foundry](https://book.getfo... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
| Contract | Bytecode source | Why |
|----------|----------------|-----|
| **Exact** | Pre-built initCode in `script/data/exact-proxy-initcode.hex` | The original build included Solidity CBOR metadata (an IPFS hash that varies per build environment). Th... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
forge script script/Deploy.s.sol \
--rpc-url <RPC_URL> \
--account x402-deployment-signer \
--sender <DEPLOYMENT_SIGNER_ADDRESS> \
--broadcast \
--verify
```
To deploy only the Upto proxy, select its deployment entry p... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
```bash
export PERMIT2_ADDRESS="0x..."
forge script script/Deploy.s.sol --rpc-url <RPC_URL> --broadcast
```
> **Warning:** Overriding the Permit2 address changes the initCode for the Upto contract
> and will produce a different deployment address. The ... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
**Batch settlement stack** (`x402BatchSettlement`, `ERC3009DepositCollector`, `Permit2DepositCollector`) uses the same prefix with suffixes `…0003`, `…0004`, and `…0005` respectively. The two deposit collectors take the batch settlement contract address... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
# Full pipeline: batch (...0003) then ERC3009 (...0004) then Permit2DepositCollector (...0005)
cargo run --release -- batch-stack
# If you already have a batch address, mine one collector (set BATCH_ADDRESS=0x...)
cargo run --release -- erc3009
cargo r... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
**Base Sepolia:**
```bash
export PRIVATE_KEY="..."
forge script script/DeployBatchSettlement.s.sol \
--rpc-url https://sepolia.base.org \
--broadcast \
--verify
```
**Polygon Mainnet:**
```bash
export PRIVATE_KEY="..."
export POLYGON_RPC_URL="htt... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
Without these, the Solidity compiler appends a CBOR-encoded IPFS hash of the contract
metadata to the bytecode. This hash varies across build environments (even with identical
source code and compiler version), breaking CREATE2 address determinism.
The... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
Standard settlement path - always transfers the exact permitted amount.
```solidity
function settle(
ISignatureTransfer.PermitTransferFrom calldata permit,
address owner,
Witness calldata witness,
bytes calldata signature
) external;
``... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/README.md
# Coverage for src/ contracts only (excludes mocks, tests, scripts)
forge coverage --no-match-coverage "(test|script)/.*" --offline
```
## Gas Snapshots
```bash
forge snapshot
forge snapshot --diff
```
## License
Apache-2.0
|
Source: x402-foundation (Apache-2.0) x402/contracts/evm/docs/x402-batch-settlement-implementers.md
# x402BatchSettlement — implementer notes
Operational and edge-case details for integrators (wallets, indexers, relayers, and services using the batch-settlement EVM contract). This is not a full protocol spec; see the ... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/docs/x402-batch-settlement-implementers.md
| Storage | Meaning |
|--------|---------|
| `channels[channelId]` | Per-channel `balance` (escrow) and cumulative `totalClaimed` (receiver-attributed obligation against that escrow). |
| `pendingWithdrawals[channelId]` ... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/docs/x402-batch-settlement-implementers.md
**Race:** If the payer opens the timed withdrawal window and later `finalizeWithdraw` executes **before** the receiver’s `claim` is included, escrow `balance` can drop so that a subsequent `claim` reverts with `ClaimExce... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/docs/x402-batch-settlement-implementers.md
- **`receiverAuthorizer`**: Must be non-zero at deposit time; used for batch authorization (`claimWithSignature`), refund signatures, etc.
- **`payerAuthorizer`**: May be **zero**. When zero, voucher signatures are check... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/docs/x402-batch-settlement-implementers.md
**Empty batches:** `claim` / `claimWithSignature` revert with `EmptyBatch()`. The view `getClaimBatchDigest` still defines a digest for `voucherClaims.length == 0` so off-chain tooling can match EIP-712 encoding; mutatin... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/docs/x402-batch-settlement-implementers.md
1. **Nonce advances even on “no token moved”**: If `amount > 0` but available unclaimed escrow is zero, there is no `Refunded` event and no transfer, yet the nonce still increases (same for either entry point). This matc... |
Source: x402-foundation (Apache-2.0) x402/contracts/evm/docs/x402-batch-settlement-implementers.md
`settle(receiver, token)` transfers **claimed but not yet settled** balances for that `(receiver, token)` pair (permissionless). It moves ERC-20 from escrow aggregates to `receiver` and updates `totalSettled`.
## Events... |
Source: x402-foundation (Apache-2.0) x402/docs/AGENTS.md
# Documentation Agent Instructions
## Package Identity
- Mintlify documentation source for docs.x402.org
- MDX/Markdown files with `docs.json` as navigation configuration
## Directory Structure
- `advanced-concepts/` — Advanced topics (lifecycle hooks, etc.)
-... |
Source: x402-foundation (Apache-2.0) x402/docs/AGENTS.md
## Code-to-Doc Mapping
- Changes to `typescript/packages/core/src/` affect Core Concepts docs
- Changes to `typescript/packages/mechanisms/`, `go/mechanisms/`, or `python/x402/mechanisms/` affect Payment Schemes docs and `sdk-features.md`
- Changes to `typescrip... |
Source: x402-foundation (Apache-2.0) x402/docs/AGENTS.md
## Style Guidelines
- Use TypeScript for primary code examples (it's the reference SDK)
- For scheme pages, lead with server setup before client setup
- Keep scheme overviews network-agnostic; put network-specific behavior in the relevant scheme page section and... |
Source: x402-foundation (Apache-2.0) x402/docs/AGENTS.md
## Touch Points / Key Files
- `introduction.md` — Landing page
- `faq.md` — Frequently asked questions
- `docs.json` — Navigation and configuration (MUST update when adding pages)
- `core-concepts/*.md` — Conceptual documentation
- `schemes/*.mdx` — Payment sche... |
Source: x402-foundation (Apache-2.0) x402/docs/AGENTS.md
## Pre-PR Checks
- All links work (no broken references)
- New pages added to `docs.json` navigation
- Code examples are from actual SDK files and compile
- Frontmatter present on all pages (title, description)
- MDX syntax is valid (run `mint dev` to verify)
#... |
Source: x402-foundation (Apache-2.0) x402/docs/AGENTS.md
| Code Change | Doc Update Required |
|-------------|---------------------|
| `typescript/packages/core/src/*.ts` API changes | Core Concepts, quickstart guides |
| `typescript/packages/extensions/src/*.ts` Extensions changes | Extensions docs (Bazaar, etc.) |
|... |
Source: x402-foundation (Apache-2.0) x402/docs/AGENTS.md
### When to Skip (No PR)
If the code changes are limited to:
- Removing or adding code comments
- Formatting/style changes (prettier, linting)
- Test files only (`*.test.ts`, `__tests__/`, etc.)
- CI/build configuration only (`.github/`, `turbo.json`, etc.)
- D... |
Source: x402-foundation (Apache-2.0) x402/docs/faq.md
---
title: "FAQ"
---
### General
#### What _is_ x402 in a single sentence?
x402 is an open‑source protocol that turns the dormant HTTP `402 Payment Required` status code into a fully‑featured, onchain payment layer for APIs, websites, and autonomous agents.
**I... |
Source: x402-foundation (Apache-2.0) x402/docs/faq.md
Nothing prevents you from implementing the spec in Rust, Java, or other languages. If you're interested in building support for your favorite language, please [open an issue](https://github.com/x402-foundation/x402/issues) and let us know, we'd be happy to help!
#... |
Source: x402-foundation (Apache-2.0) x402/docs/faq.md
* **Flat per‑call** (e.g., `$0.001` per request)
* **Tiered** (`/basic` vs `/pro` endpoints with different prices)
* **Up‑to** (`scheme: "upto"`): The client authorizes a maximum amount but is only charged for actual usage (tokens, compute time, bandwidth, etc.). A... |
Source: x402-foundation (Apache-2.0) x402/docs/faq.md
| Network | CAIP-2 ID | Asset | Fees\* | Status |
| -------------- | --------- | ----- | -------- | ----------- |
| Base | `eip155:8453` | Any ERC-20 token | fee-free | **Mainnet** |
| Base Sepolia | `eip155:84532` | Any ERC-20 token | f... |
End of preview. Expand in Data Studio
x402-protocol-sft-v1
PROPOSED stub card (Wave-2 revision per governing AMEND). Not yet published to this dataset.
- Contents: UNKNOWN (pending audit; nothing asserted)
- Provenance: HF metadata census 2026-11-22T23:18Z auth-scoped 0 errors; published wave-logs mesh/2026-11-23/ouroboros/glm-datasets-kernels-lap1/ commit 9eebec605409
- License evidence: UNKNOWN - no license tag set at census; owner-gated
- Topics: none applied (taxonomy gate not yet passed; proposals live in the wave-logs bundle only)
- Steward: estate owner-gated (see estate ledger)
Honest limitations
This stub asserts nothing about quality, composition, sizes, fitness. UNKNOWN fields stay UNKNOWN rather than fabricated. Target per 2026 leaders (Croissant 1.1, 2026-01-29): machine-actionable provenance, DUO/ODRL usage policies, semantic field types.
- Downloads last month
- 220