Skip to content

Latest commit

 

History

150 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unification home. This vhspace/zkx402 repo is the living home for hackathon unification (docs + issues). Pre-unify tree: archive/pre-unify-2026-08-22. See docs/unify/. Licenses are not a constraint (owner code).

zkx402

CI Vercel Deploy Release Please License Ethereum Solana

zkx402 is an extension of the x402 payment protocol that adds proof-aware pricing and access control.

In practice: your API can require payment via x402 and optionally apply discounts (or reject access) based on canonical proof claims (starting with chain-only “human”).

What’s in this repo

  • packages/x402-zkx402/: the reusable middleware package (production code lives here)
  • apps/demo/: a demo application showing how to use the middleware
    • apps/demo/server/: Express server using x402-zkx402
    • apps/demo/local-chain/: local Anvil + MockUSDC + E2E runner
    • apps/demo/contracts/: Foundry contracts (MockUSDC, bridge receiver/sender, etc.)

Quick start (local E2E)

This is the fastest way to validate changes end-to-end:

cd apps/demo/local-chain
node run-e2e-test.js

It runs:

  • packages/x402-zkx402 unit tests
  • starts Anvil and deploys test contracts
  • starts the demo server
  • executes a full 402 → pay → settle flow (including the proofPolicy/router discount path)

Run the demo app (dev servers)

From repo root:

corepack enable
pnpm install --ignore-scripts

Then:

pnpm run dev:server

In another terminal:

pnpm run dev:client

Using x402-zkx402 in your own server

The middleware is exported from packages/x402-zkx402.

See:

  • packages/x402-zkx402/README.md
  • packages/x402-zkx402/examples/basic-usage.js

Proof policy and JSON formats

See:

  • docs/specs/JSON_SPECS.md (policy JSON envelope + integrity hashing)
  • docs/specs/PROOF_VERIFICATION_PLAN.md (design/roadmap)
  • docs/proof-concepts.md (claims vs policy vs proofs vs contentMetadata)
  • docs/guides/VIBE_CODE_SETUP.md (setup guide for Cursor/Claude/v0/Lovable)

Contributing

See CONTRIBUTING.md.

Links

  • Demo movie: https://youtu.be/kEA0Jhq6qjM
  • Demo site: https://zkx402.io

Releases

Packages

Contributors

Languages