15 Commits

Author SHA1 Message Date
bd9004603a feat(qie): add QIE Hackathon 3.0 x402 credit-score integration
QIE is EVM-compatible (Cosmos SDK + eth_* JSON-RPC, testnet chain 1983 /
mainnet 1990), so this reuses the existing generic EVM x402 payment path
(same shape as the Flare integration) rather than bespoke chain code:

- lib/x402/qie_networks.ts, qie_rpc.ts, qie_finality.ts, qie_client.ts,
  qie_gateway.ts, qie_payment_attempt_store.ts
- api/qie_x402_routes.ts wired into api/server.ts
- scripts/qie_x402_check.ts (readiness/preflight, mirrors x402:algorand:check)
- docs/qie_x402.md + a QIE Hackathon section in docs/SUBMISSIONS.md

Fails closed without CRED402_QIE_PAY_TO / asset / facilitator configured,
same discipline as the Algorand integration. Honest gaps flagged rather
than faked: QUSDC's exact testnet contract address is unconfirmed (falls
back to pricing in native QIE), and a real signed transaction needs a
funded faucet key + live facilitator neither of which exist yet — both
documented as TODO with exact unblock steps in docs/SUBMISSIONS.md.

Track: AI + Autonomous Agents. Deadline: 2026-11-30, with a QIE Mainnet
(chain 1990) contract deployment required at submission, not just
testnet — confirmed via the hackathon's own dashboard + press coverage.

9/9 new tests pass (node:test via tsx --test), typecheck clean.
2026-10-19 02:43:44 +03:00
0aebb45301 feat: record the Algorand x402 submission demo video
Adds scripts/record_algorand_x402_demo.mjs (npm run record:algorand) and a
3m20s 1920x1080 recording of the Algorand x402 flow against a real
Mainnet-configured resource server.

Shows the agents and x402 receipts being underwritten, the risk policy and
bureau, then the paid Algorand resource: live deployment metadata, a real
unpaid 402, and all eight PAYMENT-REQUIRED verification rows passing --
x402 v2, single exact option, the full-genesis-hash network id, USDC ASA
31566704, receiver, amount, resource URL, and the x402-global-challenge
tag.

Two recorder details worth keeping: it records into its own directory,
because "some .webm in media/" renames whichever file readdir returns
first, and it pins horizontal scroll, because the 25-tab bar overflows the
viewport and drags content out of frame when a right-hand tab is clicked.

Re-record after the first real Mainnet settlement so the usage panel shows
a finalized receipt instead of a measured zero.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 16:34:36 +03:00
1ff795f53f fix: put the challenge tag where the facilitator actually reads it
The GoPlausible facilitator writes Global x402 Challenge attribution at
settlement time from accepts[].extra.tag, and never backfills it. It does
not persist the x402 resource.tags array into its Bazaar record: of 200
live Bazaar resources, 176 carry the tag via extra.tag and zero have a
tags field at all.

Cred402 advertised the tag only in resource.tags, so a real Mainnet
payment would have settled, catalogued into the Bazaar, and then been
filed under src=direct -- never reaching the challenge leaderboard.

- move the tag into the accepted option's extra, from a shared
  challenge_tag module so server and client cannot drift
- declare the x402-merchant extension so the leaderboard row carries a
  name and logo instead of a bare hostname
- reject a challenge missing extra.tag in inspectAlgorandChallenge, which
  fails both the preflight and the release gate
- assert it in the gateway test and in both buyer examples
- add x402:algorand:challenge-check, a read-only gate over the status
  probe, the Bazaar catalogue and the challenge leaderboard

Attribution is not retroactive, so this has to ship before the first real
payment.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 15:35:55 +03:00
388d482cfc chore: add Apache-2.0 LICENSE (unblocks open-core) + extract http_utils from server god-file 2026-08-25 03:09:55 +03:00
099dd3c97a feat: add production Algorand x402 credit endpoint 2026-08-23 14:18:57 +03:00
24d073ee83 feat: KeeperHub execution layer + Flare interoperable/confidential credit
Two hackathon integrations spanning the whole credit stack, sim-first
(green with no keys) with real integrations behind env flags.

KeeperHub — the on-chain execution & reliability layer (lib/keeperhub/):
- OnchainExecutor: pay-per-execution (x402/MPP) -> simulate -> smart gas
  with exponential backoff -> MEV-protected private routing -> audit trail;
  real MCP client to app.keeperhub.com; deterministic sim fallback.
- Autonomous Credit Keeper: FTSO position health -> check->execute deleverage.
- Credit Automations: declarative price/health/schedule rules as workflows.
- Autonomous Scheduler: KeeperHub-cron loop running keeper + automations.

Flare — interoperable + confidential primitives (packages/.../flare, lib/flare):
- FXRP credit satellite: CAN-gated, FTSO-priced, FDC-attested; Coston2
  Solidity vault (contracts/flare/).
- Confidential Compute credit scoring (TEE-attested, private inputs).
- FTSO-priced multi-asset collateral; FAssets mint->collateralize lifecycle.

x402 Credit-Service Marketplace: sells cred402's intelligence pay-per-call
over x402 (402->pay->200); paid receipts feed the revenue->reputation loop.

Wiring: 78 MCP tools, /v1 + /api routes, console Flare + x402 tabs, 11 demo
CLIs, 8 feature docs + docs/SUBMISSIONS.md, recorded demo video (media/).
346 tests pass; 7 adversarial verification workflows caught + fixed ~37
correctness/security issues.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-11 23:34:23 +03:00
41efbd30df feat: Python/Go/Rust SDK parity for p3/p5/p6/p7/p10 services
Adds the five new service calls to all polyglot SDKs (matching the TS SDK):
- Python (_Credit): check, checks, risk_score, data_commons, exposure,
  agent_exposure, verticals, vertical
- Go (Client): CreditCheck, CreditChecks, RiskScore, DataCommons, Exposure,
  AgentExposure, Verticals, Vertical
- Rust (Cred402Client): credit_check, credit_checks, risk_score, data_commons,
  exposure, agent_exposure, verticals, vertical

Bumps MCP tool count 49->54 in ship_first_check.ts; corrects stale 32->54 in
PRODUCTION.md. Go build / cargo build / py_compile all green; TS suite 233 green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 23:15:14 +03:00
afed64e4bd feat(p2): x402 Gateway middleware — any API becomes x402-payable + receipt-generating
Roadmap p2 shipped. The adoption wedge: drop one middleware in front of any route
and it issues 402 challenges, verifies EIP-712/ed25519 payments (replay-protected),
emits a receipt commitment to a sink, and proceeds — feeding the Cred402 credit moat.

- lib/x402/gateway.ts: framework-agnostic X402Gateway + Express and Web (Fetch)
  adapters, pluggable nonce store (replay guard), per-route analytics, receipt sink.
- Works for ANY p1 service category (inference/data/compute/…), not just RWA.
- Fix: eip712 uint256 now padded to 32 bytes (odd-length amounts no longer break signing).
- test/x402_gateway.test.ts (5 cases, real buyer→gateway round-trips), examples/paid-api-x402.ts,
  npm run demo:gateway, docs/roadmap (p2 ✅). 181 tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 17:20:46 +03:00
0813724602 feat(p1): universal x402 receipts — credit for any service, not just RWA
Roadmap p1 shipped. Cred402 now underwrites ANY x402 service category, not just
RWA:
- lib/core/service_categories.ts: canonical category taxonomy + per-family
  credit-risk weights (rwa/data/compute/inference/storage/api/defi/compliance…),
  with legacy-type aliasing.
- ServiceCategoryRegistry (lib/ledger/contracts) — on-chain-style, governance-tunable
  weights, seeded defaults, wired into the Ledger.
- ServiceType generalized to an open category string (was a 6-value RWA union).
- Risk policy v1/v2 scale the credit line by the category risk weight; rationale
  records it. RWA evidence is now an optional boost, not a gate.
- test/universal_credit.test.ts (5 cases) + npm run demo:x402: a non-RWA
  inference.llm agent builds a credit line from x402 receipts alone.
- docs/risk_model.md + docs/roadmap (p1 ✅).

176 tests green; main demo unchanged (legacy RWA types keep the rwa weight).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 17:09:02 +03:00
5cf86893e3 feat(contracts): deploy Cred402 Odra contracts to Casper Testnet (Casper 2.0)
Migrate the contract suite to Odra 2.x (builds on the Casper 2.0 ABI; fixes the
1.x nightly/edition2024 toolchain deadlock) and deploy 9 contracts live to
casper-test via the Odra livenet deployer:

  AgentRegistry · X402ReceiptRegistry · RWAEvidenceRegistry · RWAAssetRegistry
  ReputationEngine · AgentCreditPool · RiskPolicyManager · AgentPassport · DisputeCourt

- contracts: odra "2", no_std headers, build.rs (odra-build), per-crate Odra.toml +
  build_contract/livenet bins; pinned nightly-2025-01-15 for reproducible wasm.
- tooling: scaffold_livenet.py, deploy_all_testnet.sh, deploy_one.mjs.
- deploys.testnet.json: live manifest; README: on-chain contract hashes.
- Deployer key kept out of git (.secrets/ gitignored); wasm artifacts gitignored.

Verified on-chain: AgentRegistry ContractPackage present in global state.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 02:34:49 +03:00
e40ea2aed2 feat: demo video of the live console + record script
- media/cred402-demo.mp4: 720p screencast of https://cred402.vercel.app driving the
  full loop with the Casper streaming-events feed updating live (proves the
  direct-CORS SSE end to end).
- scripts/record_demo.mjs + `npm run record:demo`: Playwright records the live site,
  ffmpeg muxes to MP4. Raw .webm is gitignored.
- README: link the demo video.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 01:08:27 +03:00
c763d5ddff docs: production- and hackathon-ready README + finalize live deployment
- Rewrite README around the live deployment (console on Vercel, API on Render),
  the magic loop, and the real (non-mocked) integrations across p8–p10:
  Casper Testnet deploys, x402 + EIP-712, casper-x402 facilitator, Open-Meteo,
  official MCP SDK (44 tools), casper-sidecar, Stripe/Plaid RealFi, Base Sepolia,
  Casper Wallet connect + sign-in. Accurate counts (14 Odra contracts, 151 tests,
  4 SDKs, 20 console tabs) and the contract↔simulation transport seam.
- Pick up concurrent graphql/openapi/sdk/mcp/tests refinements.

Readiness: tsc clean; 151 tests pass; frontend/vite, cargo check, forge build,
and go build all green; console + API both serving 200 in production.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 00:56:24 +03:00
51a56a66c7 feat(deploy): Render Blueprint for the API + Vercel rewrites to it
- render.yaml: always-on web service `cred402-api` (node runtime, installs dev
  deps so tsx is present, health check /v1/health) — Render runs the long-lived
  node:http + SSE server the serverless Vercel deploy can't.
- api/server.ts: honor the platform-provided PORT (Render) before CRED402_PORT.
- frontend/vercel.json: rewrite /api/*, /v1/*, /graphql → https://cred402-api.onrender.com
  so the deployed console reaches the backend same-origin (no CORS, no code change).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 00:50:11 +03:00
2d43618725 feat: real integrations (Casper Testnet, x402/EIP-712, MCP, RealFi, cross-chain), wallet sign-in, branding
Replace the design-note docs (p1–p7) with the implemented "make it real" phase
docs (p8–p10) and wire production-grade, env-gated real integrations:

- p8 Casper Testnet: byte-exact deploys + WASM install via casper-js-sdk; live
  node reads (node.testnet.casper.network); CRED402_CHAIN=sim|testnet transport.
- p9 x402 + data + MCP: real EIP-712 typed-data digests (@casper-ecosystem/
  casper-eip-712); casper-x402 facilitator client (x402 V2); live Open-Meteo GHI;
  official @modelcontextprotocol/sdk server; casper-sidecar SSE event feed.
- p10 RealFi + cross-chain: real Stripe test-mode webhooks (HMAC-verified) and
  Plaid sandbox → privacy-preserving on-chain envelopes; Base Sepolia EVM deploy
  (Foundry); reachable via /api/realfi/* and /api/x402/facilitator routes.
- Sign-in with Casper Wallet: real extension provider + challenge/ed25519/session
  flow (/v1/auth/wallet/*), console connect + sign-in button.
- Branding: Cred402 logo mark, favicon, OG image; Vercel config for the console.

All env-gated with sim/free-API fallbacks; full suite green, all toolchains
(TS/Rust/Go/Solidity) build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 00:37:36 +03:00
f1e4bb712e first 2026-06-16 02:50:52 +03:00