Build on it
Exchanges, marketplaces, tokenizers and agents can ask the same gate before they list, sell, retire or count a credit. Pick a TypeScript SDK, an MCP endpoint, a JSON API or a direct contract call.
TypeScript SDK
@recourse/sdk wraps every read: integrity, gate verdicts, events, retirements, orders, claims and the propagation log. It also verifies evidence bundles and registry proofs offline, the same code this site runs in your browser on the verify page.
import { createPublicClient, http } from "viem";
import { baseSepolia } from "viem/chains";
import { loadDeployment, checkCredit, getIntegrity, getEventsOf,
explainIntegrity, subjectKey } from "@recourse/sdk";
import deploymentJson from "./base-sepolia.json";
const dep = loadDeployment(deploymentJson);
const client = createPublicClient({ chain: baseSepolia, transport: http() });
// May this credit be used for CORSIA right now? Fails closed.
const v = await checkCredit(client, dep, {
registry: "VERRA", projectId: 981, profile: "CORSIA_PHASE1", vintage: 2017,
});
if (!v.ok) console.log(v.reasonName); // "UnderWatch"
// Why: integrity state plus every open event, in plain language.
const integrity = await getIntegrity(client, dep, "VERRA", 981);
const events = await getEventsOf(client, dep, subjectKey(1, 981));
console.log(explainIntegrity({ registry: 1, projectId: 981, integrity, events }));In a contract
A token, marketplace or retirement contract can refuse a recalled credit in one line. The revert names the reason.
interface ICreditGate {
// reverts with IntegrityUnknown, StateStale, RecallActive, UnderWatch,
// VintageOutOfWindow, ProgrammeNotEligible or NoAuthorizationOnRecord
function requireUsable(bytes32 subject, uint16 registry, uint8 profile, uint16 vintage) external view;
}
// subject = keccak256(abi.encode(uint16(1) /* VERRA */, uint64(projectId)))
gate.requireUsable(subject, 1, 0 /* GENERIC */, vintage);MCP server for agents
A procurement or trading agent can check credits before it acts. The endpoint below speaks MCP over streamable HTTP (stateless) with five read-only tools: check_credit, explain_recall, list_recalls, verify_evidence, verify_claim.
- Endpoint
- https://recourse-recall.vercel.app/api/mcp
- Pinned oracle keys
- 3 (ML-DSA-87, from data/keys/pq-pins.json)
curl -s https://recourse-recall.vercel.app/api/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"check_credit",
"arguments":{"registry":"VERRA","projectId":902,"profile":"GENERIC"}}}'JSON API
The check behind this site, as JSON: live registry status, on-chain integrity, open events and a verdict per policy profile.
GET /api/check?q=981 GET /api/check?q=9738-128704133-128704532-VCS-VCU-259-VER-BR-14-981-01012017-31122017-0
Deployment on Base Sepolia
Chain 84532, deployed at block 48,940,703. The run log lists every transaction the operator sent, including the 7 calls the contracts refused on purpose.
| Contract | Address | Role |
|---|---|---|
| CreditGate | 0x9185e48df4B0C9522803c0d6466C6ff1C2c1F9D6 | Point-of-use check for four policy profiles; fails closed |
| IntegrityRegistry | 0x6B64CE51e6D8342aFF58Ed7569517909C80659c5 | Integrity state, events, dispute windows, recalls |
| RegistryOracle | 0x10327C3e66fA7d7c87D2AdddEd575D3703718a06 | Verifies Reclaim zkTLS proofs of Verra responses |
| IntegrityAttestationResolver | 0x13d149f573b1eA1E6226677C14398779E8CdF68d | EAS resolver: oracle proposals and reviewer countersigns |
| WarrantyEscrow | 0xeCa8B33084441dc4D609917000eec740f3a60674 | USDC escrow with holdback, delivery checks and refunds |
| ClaimsLedger | 0x6D55947360Fbc6729F98d1498afA93c215a019cb | One tonne, one claim; claim health |
| ProvenanceAnchor | 0xbCE9428C9477186912e62878FB306621124376aD | Merkle roots of AI outputs and pre-registrations |
| EAS | 0x4200000000000000000000000000000000000021 | Ethereum Attestation Service predeploy |
| Reclaim verifier | 0xF90085f5Fd1a3bEb8678623409b3811eCeC5f6A5 | Reclaim Protocol proof verifier |
| USDC | 0x036CbD53842c5426634e7929541eC2318f3dCF7e | Circle USDC on Base Sepolia |