Connect
Cover: Verifying beats solving: the asymmetry that makes imperfect routing safe

Verifying beats solving: the asymmetry that makes imperfect routing safe

If the solver can miss the best route, why is the user still protected?

Finding the best route is an approximate search; checking that a settlement delivered at least the floor is exact and cheap. That asymmetry costs price when the search misses, never safety.

Known formally as Law 1: verifying beats solving in the BlazePhoenix whitepaper.

BlazePhoenix Engineering · article updated 2026-11-16 · site dataset through 2026-11-19 · 7 min · written from the deployed bytecode

By Mitra (@Sigmacrit) — anonymous developer of the BlazePhoenix protocol. The code is the résumé.

Abstract in 15 languages · resumo · resumen · 摘要 · 要旨 · ملخص

English — The contract never asks whether the route is the best one. It asks whether the amount that arrived is at least the floor, an exact question answered from balance deltas. A search that misses the best route costs the user some price, never the floor.

Português — O contrato nunca pergunta se a rota é a melhor. Pergunta se o montante que chegou é pelo menos o piso, uma pergunta exata respondida a partir das variações de saldo. Uma pesquisa que falha a melhor rota custa ao utilizador algum preço, nunca o piso.

Español — El contrato nunca pregunta si la ruta es la mejor. Pregunta si la cantidad que llegó es al menos el suelo, una pregunta exacta que se responde con las variaciones de saldo. Una búsqueda que no da con la mejor ruta le cuesta al usuario algo de precio, nunca el suelo.

Français — Le contrat ne demande jamais si la route est la meilleure. Il demande si le montant arrivé est au moins égal au plancher, une question exacte à laquelle répondent les variations de solde. Une recherche qui manque la meilleure route coûte un peu de prix à l'utilisateur, jamais le plancher.

Deutsch — Der Vertrag fragt nie, ob die Route die beste ist. Er fragt, ob der angekommene Betrag mindestens dem Floor entspricht, eine exakte Frage, die aus Saldoänderungen beantwortet wird. Eine Suche, die die beste Route verfehlt, kostet den Nutzer etwas Preis, niemals den Floor.

Русский — Контракт никогда не спрашивает, лучший ли это маршрут. Он спрашивает, не меньше ли пришедшая сумма нижней границы, и это точный вопрос, на который отвечают изменения балансов. Поиск, пропустивший лучший маршрут, стоит пользователю части цены, но никогда не нижней границы.

Türkçe — Kontrat rotanın en iyisi olup olmadığını asla sormaz. Ulaşan tutarın en az taban kadar olup olmadığını sorar; bu, bakiye farklarından yanıtlanan kesin bir sorudur. En iyi rotayı kaçıran bir arama kullanıcıya biraz fiyata mal olur, tabana asla.

العربية — العقد لا يسأل أبدًا هل هذا المسار هو الأفضل. إنه يسأل هل المبلغ الذي وصل يساوي الأرضية على الأقل، وهو سؤال دقيق يُجاب عنه من فروق الأرصدة. أما البحث الذي يفوّت أفضل مسار فيكلّف المستخدم بعض السعر، ولا يكلّفه الأرضية أبدًا.

हिन्दी — कॉन्ट्रैक्ट कभी यह नहीं पूछता कि रूट सबसे अच्छा है या नहीं। वह पूछता है कि पहुँची हुई रकम कम से कम फ़्लोर के बराबर है या नहीं, जो बैलेंस के अंतर से मिलने वाला एक सटीक सवाल है। सबसे अच्छा रूट चूक जाने वाली खोज उपयोगकर्ता को थोड़ी क़ीमत का नुक़सान दे सकती है, फ़्लोर का कभी नहीं।

日本語 — コントラクトは、ルートが最良かどうかを問うことはない。問うのは、届いた額が少なくともフロア以上かどうかであり、これは残高の差分から答えが出る厳密な問いだ。最良のルートを見逃す探索は、ユーザーに価格の一部を失わせることはあっても、フロアを失わせることはない。

中文 — 合约从不问这条路线是不是最优的。它问的是到账金额是否至少达到下限,这是一个可以从余额变化中精确回答的问题。搜索错过了最优路线,只会让用户损失一点价格,绝不会损失下限。

한국어 — 컨트랙트는 경로가 최선인지 결코 묻지 않습니다. 도착한 금액이 최소한 하한 이상인지를 묻고, 이는 잔고 변화량으로 답할 수 있는 정확한 질문입니다. 최선의 경로를 놓친 탐색은 사용자에게 가격 일부를 잃게 할 수는 있어도 하한을 잃게 하지는 않습니다.

Bahasa Indonesia — Kontrak tidak pernah bertanya apakah rute itu yang terbaik. Ia bertanya apakah jumlah yang tiba setidaknya sebesar batas bawah, sebuah pertanyaan yang tepat dan dijawab dari selisih saldo. Pencarian yang melewatkan rute terbaik merugikan pengguna sedikit harga, tidak pernah batas bawahnya.

বাংলা — কন্ট্র্যাক্ট কখনো জিজ্ঞেস করে না রুটটি সেরা কি না। সে জিজ্ঞেস করে যে পৌঁছানো পরিমাণ অন্তত ফ্লোরের সমান কি না, যা ব্যালেন্সের পার্থক্য থেকে উত্তর পাওয়া একটি নির্ভুল প্রশ্ন। সেরা রুট মিস করা অনুসন্ধান ব্যবহারকারীর কিছুটা দামের ক্ষতি করতে পারে, ফ্লোরের কখনো নয়।

Filipino — Hindi kailanman itinatanong ng contract kung ang route ang pinakamahusay. Ang itinatanong nito ay kung ang dumating na halaga ay hindi bababa sa floor, isang eksaktong tanong na sinasagot mula sa mga pagbabago sa balanse. Ang paghahanap na nakaligtaan ang pinakamahusay na route ay nagkakahalaga sa user ng kaunting presyo, hindi kailanman ng floor.

Short answer: because the contract never asks whether the route is the best one. It asks whether the amount that arrived is at least the floor, and that question has an exact answer read from balance deltas. A search that misses the best route costs the user some price. It cannot cost the user the floor.

The whitepaper states this as the first of two laws under the meta-equation (section 2.9): the Solver returns a plan that approximates the argmax, finding the argmax is an approximate search over routes and splits, and the constraint the Router enforces is a different kind of object, the delivered amount against the floor.

Two problems, two different kinds of answer

Routing and settlement look like one problem but are two. The first is an optimisation, the second is a predicate. The table puts them side by side.

Finding the route (solving)Checking the settlement (verifying)
QuestionWhich routes and splits maximise output net of gas?Did the recipient receive at least the floor?
Kind of answerApproximate: a search over routes and splitsExact: a comparison of two numbers
InputPool state, measured by probesBalance deltas, measured at the recipient
Cost grows withThe size of the searchO(1) in the size of the search
If it is wrongThe user gets a worse priceThe transaction reverts

Source: Whitepaper 2.4, section 2.9 (Law 1) and section 11.

Why the safety predicate does not mention the optimum

Write the plan the Solver returned as a-hat and the true optimum as a-star. The safety predicate S is evaluated on a-hat itself and never refers to a-star. So for every plan that passes S, settlement is safe, whatever the distance between a-hat and a-star.

The quality of the plan, mu of a-hat, is at most mu of a-star by definition of the argmax. An imperfect search therefore costs price, never safety. This is also why the whitepaper never claims the route is optimal: it claims the route is checked.

What the check reads

The Router measures before it believes. At entry it takes baselines for the input and output tokens, so dust and donations already sitting in the contract are excluded. At settlement it takes the output-token delta, charges the fee, transfers the net to the recipient, measures the recipient's own balance delta and enforces the user minimum on that delivered amount (section 11.6).

Nothing in that sequence reads the Solver's expected output as a fact. The Solver's plan carries a floor it attests, but the Router enforces the floor on realised output.

  1. The Solver proposes a plan: legs, shares, an attested floor.
  2. The Router pulls the input and measures what arrived, as a delta against its entry baseline.
  3. Each leg runs against the balance that actually arrived, and the legs are checked against their floors.
  4. The Router measures the recipient's delta and compares it with the floor and with your minimum.
  5. If any check fails, the whole transaction reverts. If all pass, the swap settles.

The search is bounded by constants, not by hope. When a swap asks for an in-transaction solve (`swapBestExactIn`), the Solver runs under a gas budget of 14,700,000 (`SOLVE_GAS`), and its capacity walk is capped at 8,000,000 (`WALK_CAP`). If the in-frame Solver reverts without data, the Router refuses with `RouterE(17)` rather than guessing. The other three doors take a route you computed off-chain.

The bound has a consequence for the claim above. A search that runs out of budget returns a worse plan or none. It does not return a plan that skips the floor.

ConstantValueWhere
SOLVE_GAS14,700,000BlazePhoenixCore.sol:2515
WALK_CAP8,000,000BlazePhoenixCore.sol:2525
Zero minimumRefused at every door (RouterE(10))Whitepaper 2.4, section 11.1

Source: FACTOS section 2 (V2 public parameters at commit 969bcc6).

What this does not claim

It does not say the plan is the best available. It says the plan is checked against a floor that the contract measures. Whether your fill was near the best is a different, measurable question: the whitepaper treats it as fidelity and prints it per chain.

It also does not say the floor is tight. The floor is a bound on loss, set from the same arithmetic the Router enforces, and a manipulated pool fails it instead of hiding inside a healthy total.

Do not trust this page — reproduce it

Every claim above is checkable against the chain. Start here:

sed -n '2515p;2525p' src/BlazePhoenixCore.sol   # SOLVE_GAS and WALK_CAP, in a checkout of the V2 repository at commit 969bcc6. Then run the invariant invariant_DeliveredNeverBelowTheProtocolFloor (test/BlazePhoenixRouter.invariant.t.sol:441 at the same commit) with the repository's own test setup. Reading: section 2.9 of the 2.4 whitepaper.
Cite this article

Licensed CC BY-NC-ND 4.0: quote and cite it with attribution and a link. Commercial use and derivative versions need written permission from BlazePhoenix; translations are made by BlazePhoenix. Copy a ready-made citation:

BlazePhoenix (2026). Verifying beats solving: the asymmetry that makes imperfect routing safe. BlazePhoenix Engineering. https://blazephoenix.xyz/learn/verifying-beats-solving/
@misc{blazephoenix_verifying_beats_solving,
  title  = {Verifying beats solving: the asymmetry that makes imperfect routing safe},
  author = {BlazePhoenix},
  year   = {2026},
  url    = {https://blazephoenix.xyz/learn/verifying-beats-solving/},
  note   = {Accessed: reproduce the claim with the command above}
}

Writing an answer, a wiki entry or a paper? The claim above is reproducible against the chain before you quote it — which is the only sound basis for citing a technical source at all.

Contracts are verified on every chain we deploy to — addresses in the protocol manifest. Deeper formal treatment: the whitepaper (PDF).

Related engineering

Next in Foundations · 3 / 33
Anatomy of an execution receipt: what each field proves, and what it does not ›Every settlement emits Swap, ExecutionProof and Fee. A worked example reads each field: the final hop's quote, the delivered amount measured at the recipient, the floor that had to be beaten, and the fee.8 min

Questions, a partnership or a bug to report? Contact us or email contact@blazephoenix.xyz

Go to APP