FACTOR accepts requester-selected mathematical bounties, not fixed-price computation orders. The requester chooses an integer, a bounty category and a USD-denominated reward. Solvers independently decide whether to participate. No solution, turnaround time or exclusive allocation is guaranteed.
This additive extension provides persistent agent requests and an operator fulfillment dashboard. Existing Stripe and TRON/TRC-20 USDT checkout remain separate and unchanged. Native FACT is not accepted as customer payment.
The legacy Gateway still uses POST /api/create-payment-intent for Stripe, POST /api/usdt/create-wallet and GET /api/usdt/session/{id}/status for USDT, followed by POST /api/user-bounty-submissions. Those interfaces retain their existing verification and recovery limitations; they do not create extension requests or credit x402 invoices. The new client bearer tokens and fulfillment dashboard do not retrofit the legacy flows. Use the existing Gateway UI for those payment methods rather than mixing payment references between systems.
Availability and discovery
The official FACTOR agent skill provides an action-oriented guide to the implemented REST and MCP interfaces, authorization, payment monitoring and manual native fulfillment.
Check the capabilities endpoint before using a feature. The OpenAPI specification describes the REST surface. The integration overview links the interfaces.
The remote MCP endpoint uses Streamable HTTP. Connect an MCP-compatible client explicitly; publishing an endpoint does not automatically connect ChatGPT, Claude or other assistants. No external registry registration or indexing is claimed.
Base Sepolia test USDC is available only when configured. Separate Base mainnet configuration is disabled by default and requires a distinct receiver, authenticated facilitator and explicit owner activation. The production capabilities snapshot inspected on December 5, 2026 UTC reported Base mainnet configured and enabled, Sepolia disabled, and mainnet liveSettlementVerified: false. This is configuration evidence, not a demonstrated real-USDC settlement. Refresh live capabilities and inspect the exact invoice; do not send funds without explicit wallet-owner approval.
Development acceptance on December 4, 2026 completed one invoice-bound 3.12-test-USDC payment through authenticated Coinbase CDP: Base Sepolia transaction. Independent transfer/nonce and confirmation checks passed. Request creation, confirmed-payment retry and fresh-process recovery did not create a second charge. This is testnet evidence, not a claim that the production website has been updated or mainnet enabled. Native fulfillment remains manual.
Each payment capability distinguishes configured, enabled, liveSettlementVerified and productionEnabled. liveSettlementVerified means the database contains an invoice with independently checked on-chain receipt evidence; it is not a claim that every operational acceptance check passed or that production is ready.
Client access and request creation
POST /api/v1/clientsreturns{id, token, note}. Save the bearer token securely; only its hash is stored. It is returned once. Losing the token loses access to its requests.POST /api/v1/requestsrequiresAuthorization: Bearer TOKENand a stableIdempotency-Keyof 16–128 letters, digits, underscores, dots, colons or hyphens.- Send
numberToFactoras a decimal or0xhexadecimal string,rewardAmountUSDas a dollar string with at most two decimals, andbountyTypeasrsa,audit,researchorcustom. - The existing Gateway rules apply: 231–4,135 bits; maximum input length 1,264 characters; rewards $3–$900,000. Request validation is not a guarantee of consensus acceptance or computational feasibility.
- Reusing the same key and normalized input returns the existing request. Different input with the same key returns 409. Separate keys can legitimately fund the same integer.
No browser, CAPTCHA or React interaction is required. Client tokens are scoped to their own requests, not administrator operations.
Exact amounts and payment instructions
The fee breakdown distinguishes bountyUSD, serviceFeeUSD, processingFeeUSD, totalUSD and amountAtomic. The service fee is 4%, rounded to the nearest cent using integer arithmetic. The test adapter adds no processing fee; the selected facilitator submits the on-chain transaction and handles gas. CDP account charges are separate from the customer quote: the verified test used owner-confirmed free allowance. Paid usage, production facilitator pricing, cost allocation and enablement require owner review. USDC is treated as USD at parity for the test quote; no exchange-rate or native FACT conversion service is introduced.
POST /api/v1/requests/{id}/payment without a payment signature returns HTTP 402 with an x402 v2 requirement in both the JSON body and base64 PAYMENT-REQUIRED header, or 503 if payments are not configured. The response schemas, including 202/402 and safe error envelopes, are in OpenAPI.
The test asset is USDC, 0x036CbD53842c5426634e7929541eC2318f3dCF7e, with six decimals, on Base Sepolia (eip155:84532). The separately allowlisted Base mainnet token is 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 (eip155:8453); its existence is not activation. Never substitute another network, token or recipient.
New invoices pin paymentConfiguration: network, token, recipient, facilitator, exact amount, fee policy and confirmation requirement. Changing operator settings cannot redirect or reprice an existing invoice. Requests created without a valid configuration, including old unbound requests, cannot be silently converted into payable invoices; create a fresh unpaid request with a new idempotency key after configuration is ready. If a previous request might already have been charged, reconcile it before creating any replacement.
Invoice-bound authorization
For this bounty-funding operation, the wallet must use accepts[0].extra.invoiceNonce as its EIP-3009 authorization nonce. This binds the signed payment to the persistent request. Generic x402 clients that always generate their own nonce require an invoice-aware signer adapter; do not assume every x402 client works unchanged.
The wallet owner must approve the exact recipient, asset, network and amount before signing. Submit the x402 v2 payload as base64 JSON in PAYMENT-SIGNATURE, retaining the client bearer header and sending JSON {"approvePayment":true}.
The maintained x402 facilitator SDK verifies and settles the authorization. The server persists a unique settlement intent before calling the pinned facilitator, then independently checks the pinned chain's receipt: successful transaction, USDC Transfer with exact payer/recipient/value, invoice-specific AuthorizationUsed event, five confirmations and canonical block hash.
GET /api/v1/requests/{id}/payment reconciles previously authorized payments but never initiates another payment. If settlement times out, do not generate a new authorization or a replacement request to pay again. Poll status and escalate an unresolved request to the operator. Recovery can find the invoice nonce on-chain within a bounded 1,500-block range; older indeterminate attempts require manual investigation.
Lifecycle and manual fulfillment
Website request IDs and native Deadpool identifiers are different.
Payment status may be awaiting_payment, settling, paid or manual_review; reconciliation can report awaiting_finality. Confirmed payment advances fulfillment to awaiting_fulfillment.
The operator uses the protected agent request dashboard to inspect requests and record the native transaction ID, Deadpool ID, native FACT allocation and operational notes. Publication remains manual. The extension does not construct, fund, sign or broadcast native FACTOR transactions and does not calculate a new FACT conversion policy.
GET /api/v1/requests/{id} monitors the request. GET /api/v1/requests/{id}/receipt returns operator-recorded publication references and a separate payment object (or null) with independently checked USDC receipt evidence. Native publication references remain operator assertions, not independent live verification. Payment does not mean publication; publication does not mean a solution exists.
Native bounty observations and results
GET /api/v1/bounties?offset=0&limit=25reads stored KeyBoard observations, with pagination.GET /api/v1/bounties/{deadpoolid}returns the cached bounty and entry references.GET /api/v1/bounties/{deadpoolid}/resultreturns a disclosed result or null.
These reads are cached observations, not guaranteed current spendability, finality or reorg handling. The existing cache stores at most five entries per integer, and its native reward field is floating-point; the extension does not rebuild that infrastructure. New request payment accounting remains exact. Native integers, transaction relationships and disclosed results are public.
MCP tools
Public read-only tools: discover_capabilities, list_bounties, get_bounty, get_bounty_result.
Client bearer authentication is required for create_bounty_request, get_request, get_payment_instructions, get_payment_status and get_fulfillment_receipt. Configure the token as an HTTP Authorization header in a compatible client. OAuth-only MCP hosts require additional integration; OAuth discovery is not advertised by this version.
Creating a request is a write, but does not move funds. Payment instructions do not authorize spending. Payment-status reconciliation may persist verified evidence but cannot charge the wallet. Actual spending requires separate wallet-owner authorization through the REST payment endpoint. No administrator, treasury, wallet-key or unrestricted RPC tools are exposed.
Python example: discover, create and monitor
Runnable source examples are included as examples/factor_agent.py (Python standard library) and examples/factor-agent.ts (official maintained MCP client plus REST). Both default to read-only discovery. Use --help for the explicit create, request-monitoring and wallet-authorized payment options:
python examples/factor_agent.py --help
node --import tsx examples/factor-agent.ts --help
Configure FACTOR_ORIGIN for your intended deployment and provide AGENT_CLIENT_TOKEN through your runtime's secure credential mechanism. --create requires an integer string, dollar string and persistent idempotency key. Neither example generates a wallet or extracts a private key. Payment additionally requires --pay --approve-payment, the correct --network, and AGENT_PAYMENT_SIGNATURE supplied by an invoice-aware external wallet. If a POST times out or returns 202, reconcile the same request ID; do not run another payment command. Generic OAuth-only assistant connectors and generic random-nonce x402 wallets are not automatically compatible.
import os
import uuid
import requests
base = os.environ["FACTOR_BASE_URL"].rstrip("/")
client = requests.Session()
client.headers["Authorization"] = "Bearer " + os.environ["FACTOR_CLIENT_TOKEN"]
capabilities = client.get(base + "/api/v1/capabilities", timeout=20)
capabilities.raise_for_status()
# Keep this key stable across retries; persist it with your job.
key = str(uuid.uuid4())
created = client.post(base + "/api/v1/requests",
headers={"Idempotency-Key": key},
json={"numberToFactor": str(2**240 + 1), "rewardAmountUSD": "3.00",
"bountyType": "research"}, timeout=20)
created.raise_for_status()
request_id = created.json()["id"]
requirement = client.post(
base + f"/api/v1/requests/{request_id}/payment", json={}, timeout=20)
if requirement.status_code == 402:
print("Ask your authorized Base Sepolia wallet adapter to sign this invoice.")
# Do not log a signed payment, private key or bearer token.
elif requirement.status_code == 503:
print("Test payments are not configured; no payment requested.")
else:
requirement.raise_for_status()
status = client.get(base + f"/api/v1/requests/{request_id}", timeout=20)
status.raise_for_status()
print(status.json()["fulfillmentStatus"])
TypeScript example: invoice-aware test wallet payment
Use a separately managed test wallet with test USDC. The account below is supplied by the caller's authorized wallet infrastructure; the website never receives its private key. account.signTypedData is the maintained viem wallet signing interface, not a custom cryptographic implementation.
import type { LocalAccount } from "viem";
export async function payInvoice(
base: string, token: string, requestId: string,
account: LocalAccount, approve: (invoice: unknown) => Promise<boolean>
) {
const url = `${base}/api/v1/requests/${requestId}/payment`;
const headers = { Authorization: `Bearer ${token}`, "Content-Type": "application/json" };
const challenge = await fetch(url, { method: "POST", headers, body: "{}" });
if (challenge.status !== 402) throw new Error(`No payable invoice: HTTP ${challenge.status}`);
const required = await challenge.json();
const accepted = required.accepts[0];
if (accepted.network !== "eip155:84532" ||
accepted.asset.toLowerCase() !== "0x036cbd53842c5426634e7929541ec2318f3dcf7e")
throw new Error("Unexpected network or asset");
if (!(await approve(accepted))) throw new Error("Wallet owner did not approve spending");
const now = Math.floor(Date.now() / 1000);
const authorization = {
from: account.address, to: accepted.payTo,
value: accepted.amount, validAfter: "0",
validBefore: String(now + 240), nonce: accepted.extra.invoiceNonce,
};
const signature = await account.signTypedData({
domain: { name: "USDC", version: "2", chainId: 84532,
verifyingContract: accepted.asset },
types: { TransferWithAuthorization: [
{ name: "from", type: "address" }, { name: "to", type: "address" },
{ name: "value", type: "uint256" }, { name: "validAfter", type: "uint256" },
{ name: "validBefore", type: "uint256" }, { name: "nonce", type: "bytes32" },
] },
primaryType: "TransferWithAuthorization",
message: { ...authorization, value: BigInt(authorization.value),
validAfter: BigInt(authorization.validAfter),
validBefore: BigInt(authorization.validBefore) },
});
const payload = { x402Version: 2, accepted, resource: required.resource,
payload: { signature, authorization } };
return fetch(url, { method: "POST",
headers: { ...headers, "PAYMENT-SIGNATURE": Buffer.from(JSON.stringify(payload)).toString("base64") },
body: JSON.stringify({ approvePayment: true }),
});
}
Persist the returned request ID and poll the payment and request endpoints. Never automatically create a replacement charge after a timeout.
Errors and limitations
Errors use {error:{code,message}}: 400 invalid input/payment, 401 authentication, 403 origin/CSRF, 404 inaccessible or missing request, 409 idempotency/version conflict, 429 rate limit, 503 unconfigured or unavailable service. HTTP 202 means an indeterminate settlement that must be reconciled, not successful payment.
Client token issuance is limited to five per IP per hour. API/MCP access is limited to 60 requests per minute per process/IP; administrator login to five attempts per 15 minutes. Single-process limits are not a distributed quota. Keep tokens out of URLs and logs. Client-token rotation/revocation, OAuth onboarding and higher-volume access need a subsequent operational design before broad production adoption.
This implementation has no automated refunds, no native signing, no exchange integration and no cross-chain bridge. Production payments and external registry submissions require explicit owner approval and independently verified testing.
