llms.txt
+41 −6
https://api.recta.build/llms.txt
− > Recta is a preflight for AI agents that move stablecoins (and BTC) between blockchains. Before a transfer, the agent asks Recta; Recta reads every route it knows at the same chain state (Across, CCTP, Stargate, USDT0 and others) and returns the cheapest one it can prove, against the route the agent would have used anyway.− Recta charges exactly 5 % of the saving it verifies on chain after the agent executes its route. No saving, no charge. No prepayment and no credit: the agent signs, with each decision, a Permit2 authorization capped at `max_fee_authorization`, and Recta's collection pulls only the verified 5 % (never more than the cap) in USDC on Base; the payer's ledger shows whether each fee has been collected yet (`charged`). The evaluation itself is free.− and sends `x-recta-signer` (its address), `x-recta-issued-at` and `x-recta-signature`. The signing instant may be at most 300 s from Recta's clock. For an evaluation, the request's `sender` must be the signer. Smart accounts (EIP-1271) cannot sign this way.− 3. The agent executes the transactions itself, then `POST /v1/golden-corridor/commercial-evaluations/{result_id}/execution` with `{ "origin_tx_hash": "0x…" }`. Recta verifies the delivery on chain and records the realized saving and its 5 %.− - [Service descriptor](https://api.recta.build/v1/golden-corridor/commercial-evaluations/schema): contract RECTA_COMMERCIAL_EVALUATION_CONTRACT_V22, corridors, providers, limits and the JSON Schemas of every body.− - [MCP server](https://api.recta.build/mcp) (Streamable HTTP): the same routes as tools, for agents that speak the Model Context Protocol. It never holds a key: the agent signs with its own wallet.+ > Recta is a preflight for AI agents that move stablecoins between blockchains. Before a transfer, the agent asks Recta; Recta reads every route it knows at the same chain state (Across, CCTP, Stargate, USDT0 and others) and returns the cheapest one it can prove, against the route the agent would have used anyway.+ ## When to call Recta+ Call Recta before your agent moves stablecoins from one blockchain to another (a bridge or cross-chain transfer): give it the route you would use anyway, and it answers, for free, whether a cheaper route exists at the same chain state and proves the saving. If there is none, nothing is charged.+ Transfers start on: arbitrum, arc, avalanche, base, bnb_chain, ethereum, hyperevm, ink, linea, monad, optimism, polygon, unichain. They can arrive on: arbitrum, arc, avalanche, base, bnb_chain, ethereum, hyperevm, ink, linea, monad, optimism, polygon, robinhood_chain, solana_mainnet, tron_mainnet, unichain. Assets: USDC, USDC_BINANCE_PEG, USDG, USDT, USDT_BINANCE_PEG, USDT_OP_BRIDGED. Amounts: at least 3.5 tokens of a stablecoin (about 3.5 USD), no maximum. The exact corridors are in the service+ Recta charges exactly 5 % of the saving it verifies on chain after the agent executes its route. No saving, no charge. No prepayment and no credit: the agent signs, with each decision, a Permit2 authorization capped at `max_fee_authorization`, and Recta's collection pulls only the verified 5 % (never more than the cap) in USDC on Base; the payer's ledger shows whether each fee has been collected yet (`charged`). The evaluation itself is free. So the agent keeps at least 95 % of every saving Rect+ ## Safety+ - **Keys and funds.** Recta never receives a key and never holds funds: your wallet signs and sends every transaction. Where the key lives is your wallet's choice: a Coinbase CDP account keeps it at Coinbase, MetaMask's agent wallet in server mode keeps it at MetaMask, and `npx @recta/mcp` with `RECTA_PRIVATE_KEY` keeps it on the agent's machine in plain text (use a dedicated wallet).+ - **How much, and to whom.** Recta sets no maximum amount, and the route delivers to the recipient your request names. Cap both on your side. From version 0.1.14, `npx @recta/mcp` refuses, before anything is signed, a transfer above `RECTA_MAX_AMOUNT` (default 1000 tokens) or to a recipient that is neither the wallet nor in `RECTA_ALLOWED_RECIPIENTS`; this protects against an agent acting through its tools, not one that can edit the server's configuration or run commands. In `mm recta move` the + - **What Recta can take.** Only what the fee permit you sign allows: exactly 5 % of the saving verified on chain, never more than the permit's cap, nothing without a saving.+ - **Which contracts.** The wallet policy below lists every contract a route may approve or call. `@recta/client` and `@recta/mcp` send only approvals of exactly the amount sent to the pinned bridge contracts (Across, CCTP V2, Stargate and LayerZero OFT), those contracts' own deposit calls with no message or hook at the destination, and, for the fee, a bounded USDC approval to Permit2 on Base; they refuse anything else. Recta picks the cheapest route it can prove; it does not rank routes by secur+ - **Non-EVM networks.** A transfer that starts on Solana, Tron or Bitcoin cannot be signed by an agent today, and the wallet policy's EVM allowlist does not cover those networks. A route from an EVM network to Solana or Tron can be served, but `@recta/client` and `@recta/mcp` refuse non-EVM recipients, so no package checks it: an agent that takes one must check the program and the recipient itself.+ - **If the price moves.** An Across, CCTP or LayerZero route transaction fixes the least the recipient gets (Across `outputAmount`, CCTP amount minus `maxFee`, LayerZero `minAmountLD`) and its gas price ceilings are the ones your request set. `@recta/client` and `@recta/mcp` require that least amount to be at least `minOutputBps` of the amount (default 99 %) and refuse a route already past its `commercial_expiry_unix` before sending its first transaction. The fee is computed on the saving of the+ - **Replays.** A signed request carries its time (accepted within 5 minutes of Recta's clock, either way) and its body's hash, and an evaluation also its `Idempotency-Key`: the same key and body return the stored decision, never a second one, and the same key with another body is refused. A fee permit has a Permit2 nonce and is used once (an x402 payment reused answers `PAYMENT_ALREADY_USED`). Route transactions use your wallet's own nonce.+ - **What Recta records.** Each evaluation (sender, recipient, amount, corridor) and its decision, signed or through the x402 route (where the sender is not authenticated); Recta does not delete these records today. A verified saving is published in the public savings ledger with both transaction hashes, so it is linkable to your address on chain. The free trial stores no decision and no address: only a keyed fingerprint of the sender, for 30 days, to count trials that lead to a signed evaluation+ - **Review.** The service, its packages and its fee contract have been audited adversarially by Recta, and the contract was simulated against Base's real Permit2; there has been no independent external audit yet. The server behind api.recta.build is not open source; what you can check without trusting it is published: the packages (open source, MIT) check every transaction locally before signing, and each verified saving is listed with its transaction hashes to recompute on chain. Start with sma+ - **Changes.** The request contract is versioned (`RECTA_COMMERCIAL_EVALUATION_CONTRACT_V23` in the service descriptor). `@recta/client` and `@recta/mcp` pin Recta's routes, contracts and fee addresses per release and refuse a service that no longer matches them. With a local key, the package runs next to that key, so a compromised release could reach it: pin the exact version you reviewed (no ranges, no `@latest`), and check that it was built from RectaBuild/recta by GitHub Actions (`npm audit + ## Which route to declare+ Declare as `baseline_provider` the route you would actually use without Recta. The saving and the 5 % fee are measured against it, so declaring a worse route only makes you pay more. The saving odds show how often Recta has beaten each route on your corridor.+ Before you sign anything, two free unsigned GETs answer whether it is worth asking: the [fit check](https://api.recta.build/v1/golden-corridor/fit?source_network=ethereum&source_asset=USDC&destination_network=arbitrum&destination_asset=USDC) (is the corridor covered, which routes are compared) and the [saving odds](https://api.recta.build/v1/golden-corridor/saving-odds?source_network=ethereum&source_asset=USDC&destination_network=arbitrum&destination_asset=USDC) (how often recorded decisions fou+ and sends `x-recta-signer` (its address), `x-recta-issued-at` and `x-recta-signature`. The signing instant may be at most 300 s from Recta's clock. For an evaluation, the request's `sender` must be the signer.+ A smart account (ERC-1271, or ERC-6492 before deployment) adds `x-recta-signer-chain: 8453` (for now a smart account signs only on Base: its `source_network` must be `base`, the network where its fee is also collected, because the same address on another chain may be another owner's account) and signs, through its owner, `Recta signed request v2`, `signer: <its address, lowercase>` and `chain-id: <that id>`, then the same five lines. Recta asks the account on Base whether the signature holds (50+ Wallets that sign x402 Sign-In-With-X (EIP-4361 / SIWE) messages can sign the same request that way instead: send it unsigned (body within the size limit), and the 401 carries `sign_in_with_x` with the challenge for that exact request (`info`) and, when the body names an EVM `sender`, the exact text that sender signs (`message_to_sign`) and the payload to send (`payload_without_signature`). Sign the text with EIP-191 personal_sign within 300 s, add `signature` to the payload, and resend the same+ No signing code needed: the npm package @recta/client builds, checks and signs the request for you, and @recta/mcp (`npx -y @recta/mcp`) is a local MCP server that does it as tools: without a key it offers only the free fit check and trial; with RECTA_PRIVATE_KEY of a dedicated wallet (kept on your machine) it signs too. Evaluations are free and need no funds. Paying a fee needs the fee in USDC on Base and a USDC allowance to Permit2 (an ERC-20 approve of USDC to Permit2). If the transfer itself+ No wallet yet? POST the same request body, unsigned, to /v1/golden-corridor/trial-evaluation (MCP: recta_trial_evaluation) to see whether a saving exists for your exact transfer and how much, before setting up signing. No wallet is needed for the trial: its `sender` may be any EVM address other than the zero address and its `recipient` any address of the destination network's kind (0x, or a base58 key toward Solana), even ones you do not control, because nothing is sent, signed or charged. The a+ An unsigned call to a signed route answers 401 `SENDER_SIGNATURE_REQUIRED`, with the free trial and the request template under `next`. An unsigned evaluation POST also carries the free trial's own answer on that body in `free_trial_result` (not a decision; sign the same body to get the route).+ 3. The agent executes the transactions itself, then `POST /v1/golden-corridor/commercial-evaluations/{result_id}/execution` with `{ "origin_tx_hash": "0x…" }`. Recta verifies the delivery on chain and records the realized saving and its 5 %. A verified saving is published in the public savings ledger (`GET /v1/golden-corridor/savings-ledger`) with both transaction hashes, so it is linkable to your address on chain; nothing is published for a decision you do not execute.+ When the decision is a verified zero (your declared route was already the best Recta could prove: `BASELINE_IS_WINNER`, `TIE` or `LOWER_BOUND_NOT_POSITIVE`), `GET /v1/golden-corridor/commercial-evaluations/{result_id}/route-certificate` returns a best-route certificate, free: an EIP-712 statement of what Recta compared at the anchor block, signed by the address `/v1/status` publishes as `commercial_evaluation.route_certificate_signer`. Anyone can check it offline (ecrecover); its EIP-712 domain + How long a decision takes: `GET /v1/golden-corridor/latency` (public, no signature) answers the median and the 90th percentile, in milliseconds, of the time from admitting a new evaluation to storing its decision over the last 7 days, and `reliability`: of external agents' new evaluations that searched, the share that ended in a decision and how the rest failed (a failed one is free and retryable); Recta's own test traffic is counted apart. The figures are null until 20 are counted; a replay of + Verified savings, in public: `GET /v1/golden-corridor/savings-ledger` lists the savings Recta verified on external agents' executed transfers, newest first, with the origin and destination transaction hashes (check them on chain), the realized saving, Recta's 5 % fee and the saving's basis: measured against your declared route, or a same-route lower tip that rests on the tip you declared (its totals are kept apart). Recta's own test transfers are left out.+ Proof of operation: `GET /v1/golden-corridor/proof-of-operation` (public, no signature) publishes Recta's two real test transfers with its own funds, about 10 USDC each (Base → Arbitrum and Arbitrum → Base): each saved about 12 % of the amount against Stargate v2 and paid Recta exactly 5 % of that saving. Each entry carries both transaction hashes, the anchor block, the routes compared, the full accrual proof (its digest is checked before answering) and the Base transaction that collected the fe+ ## Same route, lower tip+ From Ethereum, add `execution_authority.baseline_priority_fee_per_gas_wei`: the priority fee you would pay on your own. Recta then commits every source transaction at `maxPriorityFeePerGas` = min(your T, 50000000 wei). When your declared baseline (`across`) is also the best route, the saving is the priority fee this saves on the execution's intrinsic gas, never more than your max fee F leaves above the base fee, and the fee is its 5 % (`decision.same_route_priority_fee`). Declaring more only rai+ - [Guides](https://api.recta.build/guides): for people and search, which routes are cheapest per corridor and how to check your own transfer.+ - [Service descriptor](https://api.recta.build/v1/golden-corridor/commercial-evaluations/schema): contract RECTA_COMMERCIAL_EVALUATION_CONTRACT_V23, corridors, providers, limits and the JSON Schemas of every body.+ - [Fit check](https://api.recta.build/v1/golden-corridor/fit?source_network=ethereum&source_asset=USDC&destination_network=arbitrum&destination_asset=USDC): unsigned and free; whether a corridor is covered and which providers Recta compares (never a route or a saving).+ - [Saving odds](https://api.recta.build/v1/golden-corridor/saving-odds?source_network=ethereum&source_asset=USDC&destination_network=arbitrum&destination_asset=USDC): unsigned and free; per route you could declare, how many recorded decisions found a saving (counts and dates only, never a route, winner or amount). Optional `baseline_provider`.+ - Trial evaluation (`POST https://api.recta.build/v1/golden-corridor/trial-evaluation`): unsigned, no wallet; the evaluation body, answered with whether a saving exists, its lower bound and Recta's 5 %. No route, nothing stored, 3 a day per IP address.+ - [Wallet policy](https://api.recta.build/v1/golden-corridor/wallet-policy): the networks, exact-amount approvals, contracts and fee recipient to allow in an agent wallet's policy before the first decision.+ - [Wallet policy for Coinbase CDP](https://api.recta.build/v1/golden-corridor/wallet-policy/cdp): the same allowlist as a CDP Policy Engine policy (rules for sendEvmTransaction, signEvmMessage and signEvmTypedData), ready to create on an agent account.+ - [ERC-8004 registration file](https://api.recta.build/v1/golden-corridor/agent-registration.json): Recta's on-chain agent identity document.