---
name: factor-gateway
description: Discover FACTOR integer-factorization bounties, create requester-selected bounty requests, monitor USDC payments and native publication, and retrieve blockchain results through the FACTOR REST API or MCP server.
---

# FACTOR Gateway

Start without credentials. Connect a Streamable HTTP MCP client to https://projectfactor.io/mcp, or use the public REST API. You can inspect capabilities, list native bounties, retrieve a bounty by its native ID, and retrieve a disclosed result. A browser GET to /mcp returns HTTP 405; MCP clients initialize the connection with a protocol request.

Use this skill when a user wants to inspect or fund an integer-factorization
bounty, monitor an existing FACTOR request, or retrieve a disclosed native result.
This is not a general-purpose computation service or a wallet-management tool.

## Find the highest-reward open bounty

Public bounty reads require no credentials:

```sh
curl -fsS 'https://projectfactor.io/api/v1/bounties?status=unsolved&sortBy=bounty&order=desc&limit=1'
```

Initialize a Streamable HTTP session at https://projectfactor.io/mcp, run `tools/list`, then use `tools/call` with:

```json
{"name":"list_bounties","arguments":{"status":"unsolved","sortBy":"bounty","order":"desc","limit":1}}
```

For credential-free client setup, use [Connect an MCP client](https://projectfactor.io/agent-integration#connect-an-mcp-client), the canonical official TypeScript SDK example. It initializes Streamable HTTP, enumerates tools and performs only public reads.

MCP returns `{ content: [{ type: "text", text: "<JSON>" }] }`. Check `isError`, then parse the text as JSON to obtain the `data` array, `total`, `hasMore` and `nextOffset`. If `data` is empty, report that no matching bounty was returned. Otherwise pass `data[0].id` (the native Deadpool ID) to `get_bounty` and `get_bounty_result`.

FACTOR blockchain data is synchronized/indexed by KeyBoard and read from persisted records, not fetched by a fresh RPC request for each listing. No observation timestamp or scanned height is exposed, and no freshness SLA is specified. `claimed:false` means no claim recorded in that observation; `disclosedResult:null` means no disclosed divisor recorded in it. Neither establishes present spendability or chain finality. `firstEntryBlockHeight` is the earliest funding-entry height, not an observation height.

To create a new private gateway request, obtain a client token and follow the [request and idempotency rules](https://projectfactor.io/docs/agents#private-requests). A gateway request ID is a client-scoped UUID; a Base payment transaction hash identifies the USDC payment; neither is the native Deadpool ID. The wallet owner approves payment separately, an operator publishes the native bounty, and the agent retrieves publication references before checking later disclosures.

For your own authenticated FACTOR node, use the [native RPC reference](https://projectfactor.io/docs/rpc): `listdeadpoolentries`, `getdeadpoolentry` and `createdeadpoolentry`. The last returns unfunded, unsigned transaction hex. Node RPC is not a public hosted endpoint.

## Identity and economic model

FACTOR, formerly FACT0RN and also styled FACTØRN, is an independent, open-source Layer-1 blockchain that uses integer factorization as its principal proof-of-work challenge. Its native coin is FACT. Deadpool is the on-chain mechanism for funding integer challenges and claiming rewards with verifiable divisors.

The requester chooses the integer, category and USD-denominated bounty.
Solvers choose which bounties to solve. Gateway handles request intake and
payment; operators publish native bounties on the FACTOR blockchain.

## Canonical interfaces

- Website: https://projectfactor.io
- Overview: https://projectfactor.io/agent-integration
- Full guide: https://projectfactor.io/docs/agents
- Guide Markdown: https://projectfactor.io/docs/agents/index.md
- REST base: https://projectfactor.io/api/v1 (use resource paths below)
- OpenAPI: https://projectfactor.io/api/v1/openapi.json
- Live capabilities: https://projectfactor.io/api/v1/capabilities
- MCP: https://projectfactor.io/mcp
- Canonical skill: https://projectfactor.io/skill.md

Read live capabilities and OpenAPI first. They are authoritative for current
service configuration and contracts; do not infer enabled payments from this
skill or from the existence of an implemented payment adapter.

## Public discovery and native results

No website account or client token is required for:

| REST operation | MCP tool |
| --- | --- |
| `GET /api/v1/capabilities` | `discover_capabilities` |
| `GET /api/v1/bounties` | `list_bounties` |
| `GET /api/v1/bounties/{id}` | `get_bounty` |
| `GET /api/v1/bounties/{id}/result` | `get_bounty_result` |

### Bounty selection and pagination

Read `bountyListing` from REST `GET /api/v1/capabilities` or MCP
`discover_capabilities` for the structured selection contract and examples.
Use `GET /api/v1/openapi.json` for REST schemas; after MCP initialization,
`tools/list` returns tool descriptions, defaults and argument schemas.
These are public discovery operations, not client creation or payment.

REST `/api/v1/bounties` and MCP `list_bounties` accept `sortBy` (`date`, `bits`,
`bounty`; default `date`), `order` (`asc`, `desc`; default `desc`), `status`
(`all`, `solved`, `unsolved`; default `all`), `limit` (1–100; default 10) and
`offset` (nonnegative; default 0).

Example arguments: `{"sortBy":"bounty","order":"desc","status":"unsolved","limit":10,"offset":0}`.
Use the returned `nextOffset` with the same options to continue; stop at null.
`total` counts matching bounties before pagination. Date order uses earliest
native funding entry block height (`firstEntryBlockHeight`). Missing values sort
last and ties use bounty ID. Solved means a recorded native claim.

Read-only onboarding:

1. Call `discover_capabilities` with `{}`.
2. Call `list_bounties` with `{"status":"unsolved","sortBy":"bounty","order":"desc","limit":1}`.
3. If `data` is empty, report an empty result. Otherwise take `data[0].id`.
4. Call `get_bounty` and `get_bounty_result` with `{"id":"<returned-native-id>"}`.
5. `claimed` identifies a claim recorded in that observation. `disclosedResult` contains the recorded disclosed divisor, or null when none is recorded in it.

Inspect live capabilities before starting a payment workflow. An agent invoice pins the network, asset, recipient, exact amount, facilitator, and confirmation requirements. Wallet-owner approval is separate from request creation. The signing client must use the invoice-specified authorization nonce. After a timeout or HTTP 202, reconcile the original request before taking further payment action.

List results use a `data` array with pagination. Native bounty IDs are 64
hexadecimal characters, not website request UUIDs. Use IDs returned by the
service. KeyBoard synchronizes bounty details and disclosed results directly
from the FACTOR blockchain.

## MCP connection

Configure a Streamable HTTP client with URL `https://projectfactor.io/mcp`.
The MCP implementation reports `name: factor-agent-access`, `version: 1.1.1`
after website deployment. Its display title is
**FACTOR — Integer Factorization as a Service** and its Registry identifier is
`io.github.ProjectFactor/integer-factorization-as-a-service`.
Initialize normally, then call `tools/list` to inspect the current inventory.
The nine implemented tools are the four public tools above plus:

- `create_bounty_request`
- `get_request`
- `get_payment_instructions`
- `get_payment_status`
- `get_fulfillment_receipt`

For the five client-scoped tools, send the HTTP header
`Authorization: Bearer <client-token>`. Do not put credentials in the URL.
Public tools work without that header. No OAuth discovery/login is implemented;
an OAuth-only host is not automatically compatible. `GET /mcp` alone may return
405; use the MCP transport handshake, not webpage retrieval. Publishing this
skill does not automatically register the server with any assistant.

## Client authorization and creating a request

Create a client only when a user wants private request operations:

1. `POST /api/v1/clients` returns `{id, token, note}`. Keep the token securely;
   it is returned once. Only its hash is stored. Losing it loses request access.
   This is an API client credential, not a website or administrator account.
2. Send `Authorization: Bearer <client-token>` on client-scoped REST calls.
3. `POST /api/v1/requests` requires a stable `Idempotency-Key` header containing
   16–128 letters, digits, underscores, dots, colons or hyphens.
4. The body is:

   ```json
   {
     "numberToFactor": "<requester-chosen decimal or 0x-prefixed integer string>",
     "rewardAmountUSD": "3.00",
     "bountyType": "research"
   }
   ```

   The reward above illustrates formatting, not user consent or a price quote.
   Categories: `rsa`, `audit`, `research`, `custom`. Current service bounds:
   231–4,135 bits, at most 1,264 input characters, minimum bounty $3 USD
   (3 USDC before applicable fees).
   Preserve integers as strings, never JavaScript floating-point numbers.
5. For MCP, `create_bounty_request` takes the same fields plus `idempotencyKey`.
   Creation makes an unpaid request; it does not authorize spending or publish
   a native bounty. Same key and input reuse the request; conflicting input
   returns 409. Retain the request UUID and original key through retries.

## Payment methods and authorization

The agent extension implements invoice-bound x402 v2 USDC on allowlisted Base
networks. Check each capability's `configured`, `enabled` and `productionEnabled`
fields for availability. Monitor individual requests for payment status.

- Base mainnet: `eip155:8453`, USDC
  `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`.
- Base Sepolia testnet: `eip155:84532`, test USDC
  `0x036CbD53842c5426634e7929541eC2318f3dCF7e`.
- Existing USD/Stripe and TRON TRC-20 USDT payments remain separate at
  https://projectfactor.io/gateway. They do not credit agent-extension invoices.
- Native FACT is not accepted as customer payment.

The agent service fee is 4%, rounded to cents; the current extra processing fee
is $0.00. The operator absorbs facilitator costs. The invoice, not a calculation
in this skill, pins the exact amount, receiver, asset, network, provider and
confirmation requirement. Inspect it before requesting wallet approval.

1. Authenticated `POST /api/v1/requests/{id}/payment` without a payment signature
   returns 402 with JSON requirements and base64 `PAYMENT-REQUIRED`, or an error
   such as 503 when payment configuration is unavailable. MCP
   `get_payment_instructions` exposes the instructions without spending.
2. Obtain explicit wallet-owner approval of the exact invoice. Signing happens
   in the owner's external wallet, not through these MCP tools.
3. The EIP-3009 authorization **must** use the invoice's
   `accepts[0].extra.invoiceNonce`. Generic random-nonce x402 wallets are not
   automatically compatible. Never substitute networks, amounts or recipients.
4. Submit base64 x402 JSON in `PAYMENT-SIGNATURE` to the same authenticated POST,
   with JSON `{"approvePayment":true}`. Do not send private keys to the service.
5. A 202 or timeout is indeterminate, not permission to pay again. Monitor the
   original request. Never automatically create another authorization, request
   or idempotency key to replace an uncertain payment.

## Monitoring and manual native fulfillment

- `GET /api/v1/requests/{id}` / `get_request`: request and fulfillment state.
- `GET /api/v1/requests/{id}/payment` / `get_payment_status`: reconcile an
  existing payment. This can persist verified receipt evidence but does not
  initiate another payment.
- `GET /api/v1/requests/{id}/receipt` / `get_fulfillment_receipt`: operator-recorded
  native transaction ID, Deadpool ID and FACT allocation.

Payment verification requires independent matching chain receipt/transfer,
invoice authorization nonce, canonical block and five confirmations. A paid
request is not proof of native publication. The operator chooses the FACT
allocation and publishes the native bounty manually. After publication, use
the recorded Deadpool ID with the public bounty/result interfaces.

Respect 429 `Retry-After`; use bounded polling. An unresolved or older
indeterminate settlement requires operator review, not another debit.

## Limitations and safe operation

- Never promise solver participation, a successful factorization, turnaround
  time or a refund policy not stated by the operator.
- Validation bounds do not prove computational feasibility or native-node
  consensus acceptance.
- Native bounty integers, disclosed results and transaction relationships are
  public. Do not submit secrets or claim private computation.
- MCP exposes no payment-signing, treasury, administrator or unrestricted
  blockchain RPC tools.
- Do not mix website request UUIDs with native Deadpool IDs or legacy checkout
  references.
- Registry publication and Bazaar indexing are separate from implementation;
  neither is established by this skill. Bazaar metadata is not currently
  implemented in this invoice service.
- Always refresh live capabilities for payment availability and check each
  request for its payment status rather than relying on a deployment snapshot.
