Launch app
Cover: Why measure instead of trust

Why measure instead of trust

Why is a router that measures what arrived safer than one that calculates what should arrive?

The Router checks what actually arrived in its balance, step by step, instead of believing what a pool announced. A pool's claims are free to forge; its measured output is not.

BlazePhoenix Engineering · article updated 2026-11-16 · site dataset through 2026-11-30 · 5 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 Router does not believe what a pool says it paid: it compares its own balance before and after each step and acts on that difference. A pool's claims are free to forge, its measured output is not, so a hostile pool can cost you price but the swap reverts rather than deliver below your minimum.

Português — O Router não acredita no que um pool diz ter pago: compara o seu próprio saldo antes e depois de cada passo e age sobre essa diferença. As declarações de um pool são grátis de falsificar, a sua saída medida não é, por isso um pool hostil pode custar-lhe preço, mas o swap reverte em vez de entregar abaixo do seu mínimo.

Español — El Router no cree lo que un pool dice haber pagado: compara su propio saldo antes y después de cada paso y actúa sobre esa diferencia. Las declaraciones de un pool son gratis de falsificar, su salida medida no, así que un pool hostil puede costarte precio, pero el swap revierte en lugar de entregar por debajo de tu mínimo.

Français — Le Router ne croit pas ce qu'un pool dit avoir payé : il compare son propre solde avant et après chaque étape et agit sur cette différence. Les déclarations d'un pool sont gratuites à falsifier, sa sortie mesurée ne l'est pas ; un pool hostile peut donc vous coûter du prix, mais le swap est annulé plutôt que de livrer sous votre minimum.

Deutsch — Der Router glaubt nicht, was ein Pool als gezahlt angibt: Er vergleicht sein eigenes Guthaben vor und nach jedem Schritt und handelt nach dieser Differenz. Die Angaben eines Pools sind gratis zu fälschen, seine gemessene Ausgabe nicht; ein feindlicher Pool kann Sie also Preis kosten, aber der Swap wird zurückgesetzt, statt unter Ihrem Minimum zu liefern.

Русский — Router не верит тому, что пул сообщает о выплате: он сравнивает свой собственный баланс до и после каждого шага и действует по этой разнице. Заявления пула подделать ничего не стоит, а его измеренный выход подделать нельзя, поэтому враждебный пул может стоить вам цены, но своп откатится, а не выдаст меньше вашего минимума.

Türkçe — Router, bir havuzun ne ödediğini söylediğine inanmaz: her adımdan önce ve sonra kendi bakiyesini karşılaştırır ve bu farka göre hareket eder. Bir havuzun beyanlarını taklit etmek bedavadır, ölçülen çıktısını taklit etmek değildir; bu yüzden düşmanca bir havuz size fiyat kaybettirebilir ama swap, minimumunuzun altında teslim etmek yerine geri alınır.

العربية — لا يصدّق الـ Router ما يقوله الـ pool عن المبلغ الذي دفعه: يقارن رصيده الخاص قبل كل خطوة وبعدها ويتصرف بناءً على هذا الفرق. تزوير ما يعلنه الـ pool لا يكلّف شيئًا، أما مخرجه المقيس فلا يمكن تزويره، لذا قد يكلّفك pool عدائي بعض السعر، لكن المبادلة تتراجع (revert) بدل أن تُسلَّم بأقل من حدك الأدنى.

हिन्दी — Router इस पर भरोसा नहीं करता कि पूल कहता है कि उसने कितना चुकाया: वह हर चरण से पहले और बाद में अपने खुद के बैलेंस की तुलना करता है और उसी अंतर पर काम करता है। पूल के दावे गढ़ना मुफ़्त है, उसका मापा गया आउटपुट नहीं, इसलिए शत्रुतापूर्ण पूल आपको कीमत में नुकसान करा सकता है, पर swap आपके न्यूनतम से कम देने के बजाय revert हो जाता है।

日本語 — Router は、プールが支払ったと言う額を信じません。各ステップの前後で自分の残高を比べ、その差に基づいて動きます。プールの申告は偽造しても費用がかかりませんが、測定された出力はそうはいきません。悪意あるプールは価格を損なわせても、スワップはあなたの最小値を下回って渡されるのではなく revert されます。

中文 — Router 不相信池子声称付了多少:它在每一步前后比较自己的余额,并依据这个差额行事。池子的声明伪造起来不花成本,而它被测量到的输出却无法伪造,所以恶意池子可能让你损失价格,但兑换会回滚(revert),而不是低于你的最低值交付。

한국어 — Router는 풀이 얼마를 지급했다고 말하는 것을 믿지 않습니다. 각 단계 전후로 자신의 잔액을 비교하고 그 차이에 따라 움직입니다. 풀의 주장은 위조하는 데 비용이 들지 않지만 측정된 출력은 그렇지 않으므로, 악의적인 풀은 가격 손해를 줄 수는 있어도 스왑은 최소값 아래로 전달되는 대신 revert됩니다.

Bahasa Indonesia — Router tidak percaya pada apa yang dikatakan pool telah dibayarkan: ia membandingkan saldonya sendiri sebelum dan sesudah setiap langkah dan bertindak berdasarkan selisih itu. Klaim sebuah pool gratis dipalsukan, sedangkan keluaran yang diukur tidak, sehingga pool yang bermusuhan bisa merugikan harga Anda, tetapi swap akan revert alih-alih menyerahkan di bawah minimum Anda.

বাংলা — Router বিশ্বাস করে না পুল কত দিয়েছে বলে দাবি করে: সে প্রতিটি ধাপের আগে ও পরে নিজের ব্যালেন্স তুলনা করে এবং সেই পার্থক্য ধরেই কাজ করে। পুলের দাবি জাল করা বিনামূল্যে, কিন্তু তার মাপা আউটপুট নয়, তাই শত্রুভাবাপন্ন পুল আপনাকে দামে ক্ষতি করাতে পারে, কিন্তু আপনার সর্বনিম্নের নিচে পৌঁছে দেওয়ার বদলে swap revert হয়ে যায়।

Filipino — Hindi pinaniniwalaan ng Router ang sinasabi ng pool na binayad nito: inihahambing nito ang sarili nitong balanse bago at pagkatapos ng bawat hakbang at kumikilos batay sa pagkakaibang iyon. Libre ang pagpeke sa mga claim ng pool, ngunit hindi ang nasukat nitong output, kaya maaaring magastos ka ng presyo ng isang masamang pool, pero magre-revert ang swap sa halip na maghatid nang mas mababa sa minimum mo.

The Router does not believe what a pool says it paid. It compares its own balance before and after each step and acts on that difference. A pool's claims are free to forge; its measured output is not (Litepaper §3, item 5).

Think of buying a box with "12 eggs" printed on the lid. You can believe the lid, or you can open the box and count. The Router counts. If the box holds ten, the Router works with ten, and your minimum decides whether the deal still stands.

Said versus measured

Every row is a place where a number could be announced or counted. The Router counts (Whitepaper 2.4 §11.8, §14.9).

MomentWhat could be believedWhat the Router uses
A pool pays the RouterThe amount the pool declares it paidThe change in the Router's own balance
The Router pays youThe amount the Router meant to sendThe change in your balance, checked against your minimum
The swap endsThat everything was passed onThe Router ends holding nothing of what it moved

Source: Whitepaper 2.4 §11.8 (both transfers are balance deltas; neither trusts a nominal amount) and §14.9 (balance-delta settlement)

What this buys you

A hostile pool can cost you price, and then the swap reverts. It never delivers below your floor (Litepaper §3; Whitepaper 2.4, Ten lines, item 8). A dishonest counterparty collapses the measured output, and your bound refuses the swap (Whitepaper 2.4 §22).

"The Router ends a swap holding nothing of what it moved" is one of nine guarantees that the repository states. Each of the nine names a command that turns red if the guarantee stops holding (Whitepaper 2.4 §14.9).

Check the idea yourself

The V2 source is public and can be read, built and run under its source-available license.

  1. Clone the V2 repository and check out the commit cited in the whitepaper, 969bcc6.
  2. Search the test folder for the invariant named invariant_RouterHoldsNothing. An invariant is a rule that the test tool tries to break with random sequences of actions.
  3. Run the test file that guards the settlement rule: test/RouterBalanceAfterSettlement.t.sol (Whitepaper 2.4 §14.9).

Do not trust this page — reproduce it

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

In a checkout of the V2 repository at commit 969bcc6, run git grep -n "function invariant_RouterHoldsNothing" -- test, then run the test file test/RouterBalanceAfterSettlement.t.sol with the Foundry test command named in Whitepaper 2.4 §14.9. It should report every test passing.
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). Why measure instead of trust. BlazePhoenix Engineering. https://blazephoenix.xyz/learn/why-measure-instead-of-trust/
@misc{blazephoenix_why_measure_instead_of_trust,
  title  = {Why measure instead of trust},
  author = {BlazePhoenix},
  year   = {2026},
  url    = {https://blazephoenix.xyz/learn/why-measure-instead-of-trust/},
  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 Start here · 6 / 64
Your floor and the protocol's floor ›A swap has two minimums: the one you choose and the one the protocol computes itself. The higher of the two applies, and the protocol floor never falls below 80 % of its reference.5 min

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

Go to APP