# Trust-minimised routing: discovery, on-chain solving and re-checked execution

> Canonical: https://blazephoenix.xyz/learn/trust-minimised-routing/
> License: CC BY-NC-ND 4.0 (attribution + link) · © 2026 BlazePhoenix
> Updated: 2026-10-22

The trust model of BlazePhoenix 2.0.0 routing: CREATE2 discovery with the registry as a freshness-gated shortcut (_registryFresh, MIN_FRESH_VENUES, tier 0), an on-chain Solver read by eth_call, execution re-checked on measured deltas against userMinOut and protocolFloorOut, and gates as an explicit policy. What is derived, measured or policy, in one table.

The design goal is trust less, not more: not to grow the list of things the system relies on, but to need fewer of them. In the contracts of the 2.0.0 generation (launch scheduled for 15 December 2026, not deployed yet) that goal takes four forms: discovery by derivation, a Solver that runs on-chain, execution that re-imposes its own conditions on the realised result, and an explicit, time-delayed policy where trust remains.

## Discovery: derived, with the registry as a shortcut

Hub.discoverFor walks the admitted factory rows and derives candidate addresses for a pair. Rows in the CREATE2 modes (4 to 7) compute the address with Core.create2Address from the factory, the salt of the pair and the factory's init-code hash; a derivation is something the factory cannot influence after admission. Rows in the lookup modes (0 to 3) ask the factory, and such a row stops producing candidates if the factory's code hash moves from the one pinned at admission. For Algebra, the CREATE2 origin is the one attested at admission, not a live answer.

The registry is a gas shortcut, not the source of truth. Solver._topKPools merges registered and discovered candidates, and skips the discovery sweep when _registryFresh holds: at least MIN_FRESH_VENUES (3) registered rows saw activity within DISCOVERY_TTL_SECONDS (3,600 seconds). Rows of tier 0, seeded by an operator, are counted; permissionless rows (tier 2) stay candidates but cannot switch discovery off.

## Solving: a quote is an eth_call

Solver.findBestRoutePlan is an external view function, and Quoter.previewPlan calls it, so a quote is an eth_call you can run on your own node. There is no off-chain solver to trust for the number. The best-route door, Router.swapBestExactIn, calls the same immutable Solver inside the transaction, with a gas budget of SOLVE_GAS (12,000,000).

## Execution: re-checked on the realised result

The Router does not take the route's figures as settled. The input is measured as a balance change, not read from an argument. For each leg it measures the output as a balance change, and requires at least LEG_FLOOR_BPS (80 percent) of a bound: the caller's attested figure pro-rata, raised to MIN_QUOTE_COVERAGE_BPS (50 percent) of the leg quote measured in the transaction when the attestation falls below it. The caller can push that bound up, never down.

At the end, amountOut is the balance change against the entry baseline. It must reach the strictest of the caller's userMinOut, the route's singleOutFloor and protocolFloorOut, which is derived from the in-transaction quote of the final hop. After the fee, the amount delivered is measured again at the recipient and compared with userMinOut. A userMinOut of zero is refused, and V4 legs whose hook can alter deltas are refused at execution.

## Gates: an explicit policy, not an absence of trust

Some trust remains, and the contracts state it. On the automatic route, the registry's reads filter Uniswap V4 rows by Hub.isHookLive: a hook must be on the curator's list and its code must still match the hash pinned when it was listed. A hook nobody listed is the caller's own signed choice on an explicit route, bounded by the same floors; a revoked hook is refused on every door.

Venues behind the BlazePhoenixGate are admitted through adapters: proposeAdapter, a 48-hour ADAPTER_DELAY, then acceptAdapter, with the code hash pinned and re-checked on each swap; clearAdapter revokes a family at once. Discovery removes hand-kept address lists, but the admission of these venues keeps a declared policy with a waiting period that anyone can watch on-chain.

## The trust model in one table

Each element of routing falls in one of three classes: derived (computed from public inputs), measured (read from balances in the transaction), or policy (a stated decision, with its delay where it has one).

## What discovery does not do

Derivation is a way to find pairs on venues the Hub already knows how to read. A new AMM family still needs an adapter and configuration: a factory row admitted with Hub.addFactory, with its kind, its discovery mode and its init-code hash, and, for a venue shape the Core cannot read, a Gate adapter admitted through the timelock. Discovery does not make an arbitrary exchange compatible.

**Verify it yourself:** git clone https://github.com/blazephoenixxyz-crypto/Blaze-Phoenix-Dex && cd Blaze-Phoenix-Dex && grep -n 'function _registryFresh\|MIN_FRESH_VENUES *=' src/BlazePhoenixSolver.sol && grep -n 'MIN_QUOTE_COVERAGE_BPS *=\|uint256 delivered' src/BlazePhoenixRouter.sol && grep -n 'function isHookLive\|function discoverFor' src/BlazePhoenixHub.sol

Related: https://blazephoenix.xyz/learn/why-blazephoenix-trusts-less/ · https://blazephoenix.xyz/learn/gated-pools-permissioned-venues/ · https://blazephoenix.xyz/learn/gate-vitality-adapter-depth/ · https://blazephoenix.xyz/learn/create2-discovery/ · https://blazephoenix.xyz/learn/on-chain-quoting/ · https://blazephoenix.xyz/learn/iron-floor/ · https://blazephoenix.xyz/learn/hook-gate-by-arithmetic/
