<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>Igor Mandrigin — Notes</title>
<link>https://255c.org</link>
<atom:link href="https://255c.org/rss/notes.xml" rel="self" type="application/rss+xml"/>
<description>Igor Mandrigin — Notes</description>
<item>
<title>Stateful vs stateless ZK proving</title>
<link>https://255c.org/notes/stateful-vs-stateless-zk-proving/</link>
<guid isPermaLink="true">https://255c.org/notes/stateful-vs-stateless-zk-proving/</guid>
<dc:creator>Igor Mandrigin</dc:creator>
<pubDate>Sat, 22 Aug 2026 00:00:00 +0000</pubDate>
<description>Every zk L2 stands on its prover. Each batch of transactions needs a cryptographic proof that the execution was correct — L1 verifies the proof, not the transactions. So proving capacity decides your throughput and your costs. Proving needs state. To re-execute a batch, the prover has to see every account and storage slot the batch touches. And state is big — gigabytes on a young chain, terabytes…</description>
<content:encoded><![CDATA[<p>Every zk L2 stands on its prover. Each batch of transactions needs a cryptographic proof that the execution was correct — L1 verifies the proof, not the transactions. So proving capacity decides your throughput and your costs.</p>
<p>Proving needs state. To re-execute a batch, the prover has to see every account and storage slot the batch touches. And state is big — gigabytes on a young chain, terabytes on a busy one. Anything that has to hold it becomes expensive to run, and worse, expensive to copy.</p>
<p>There are two ways to connect the prover to the state. The naive one: plug the prover into the node’s state database and let it read as it goes. That is <strong>stateful proving</strong>. The other: have the node hand over a <strong>witness</strong> — a self-contained slice of state, exactly what the batch touches, verifiable against the state root. That is <strong>stateless proving</strong>.</p>
<p>Ethereum asked the same question about its own nodes in 2020, in the Eth 1.x project — research on improving state management in the execution layer. I was working on it back then. Inside zk proving, the same question played out the same way.</p>
<h2 id="before-stateful-proving">Before: stateful proving <a class="plink" href="#before-stateful-proving">§</a></h2>
<p>The Hermez prover in its research era read the state as it went. So it sat coupled to a state database. Cozy, and hard to move.</p>
<p>The costs are the same costs stateful Ethereum has:</p>
<ul>
<li><em>Coupling.</em> The prover inherits the node’s internals — storage layout, access paths, caching. Change the client and you are rebuilding the prover.</li>
<li><em>State.</em> The proving side has to hold it and maintain it.</li>
<li><em>Scaling.</em> More provers means replicating the state.</li>
<li><em>Performance.</em> State access leaks into proving time.</li>
</ul>
<h2 id="after-witness-in-proof-out">After: witness in, proof out <a class="plink" href="#after-witness-in-proof-out">§</a></h2>
<p>With cdk-erigon — the zkEVM client our team at <a href="https://gateway.fm"><svg class="gw-mark" viewBox="0 0 30 32" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path d="M26.141 3.85529L0 17.2381V21.5347L26.1789 8.1325L26.141 3.85529Z" fill="#8950FA"/><path d="M18.8265 0L18.8645 4.38789L0 14.0455V9.63816L18.8265 0Z" fill="#8950FA"/><path d="M14.876 17.1115L19.0724 14.9632L29.12 20.1071V24.4036L14.876 17.1115Z" fill="#8950FA"/><path d="M29.12 9.81943V16.9145L22.1905 13.3669L29.12 9.81943Z" fill="#8950FA"/><path d="M11.7579 18.7078L26.141 26.0712L14.56 32L0.176939 24.6366L4.44343 22.4525L14.6284 27.6666L17.7465 26.0703L7.56154 20.8562L11.7579 18.7078Z" fill="#8950FA"/></svg>Gateway</a> builds — the model flipped. The node produces a witness, the exact slice of state a batch touches. The prover consumes it. It does not know or care how the node stores state.</p>
<p>Proving becomes almost a pure function: batch plus witness in, proof out. No state database on the proving side. Provers scale out like any stateless worker.</p>
<figure tabindex="0"><img src="/static/img/witness-proving-flow.svg" alt="Before: the prover reads state as it executes. After: the witness travels with the batch, and the prover is a pure funct" width="688" height="300" loading="lazy" /><figcaption>Before: the prover reads state as it executes. After: the witness travels with the batch, and the prover is a pure function.</figcaption></figure>
<h2 id="the-numbers-came-first">The numbers came first <a class="plink" href="#the-numbers-came-first">§</a></h2>
<p>None of this was a guess. In 2020, as part of Ethereum Foundation stateless research, I measured witnesses on mainnet and published the raw data:</p>
<ul>
<li><em>Trie shape.</em> Binary tries shrink witnesses versus hexary ones — <a href="/writing/stateless-ethereum-binary-tries/">the experiment</a>, <a href="https://github.com/mandrigin/ethereum-mainnet-bin-tries-data">the data</a>. <span class="badge">Jan 2020</span></li>
<li><em>Sync.</em> Witnesses pre-build caches as blocks arrive during initial sync — <a href="/writing/semi-stateless-initial-sync/">the experiment and its corrected measurement scope</a>. <span class="badge">Feb 2020</span></li>
<li><em>Overhead.</em> Witness-resolution measurements with a 1,000,000-node cache — <a href="https://github.com/mandrigin/ethereum-mainnet-resolver-witness-stats">the data</a>. <span class="badge">Feb 2020</span></li>
<li><em>Formats.</em> Opcode witnesses versus the key-value format, blocks 5,000,000–8,000,000, seventeen days of compute — <a href="/writing/kv-witness/">KV-Witness</a>, <a href="https://github.com/mandrigin/ethereum-mainnet-kv-witness-data">the data</a>. <span class="badge">Jul 2020</span></li>
</ul>
<p>The archives are still up. Anyone can re-run them. Bring seventeen days.</p>
<h2 id="the-flip-is-in-the-commit-logs">The flip is in the commit logs <a class="plink" href="#the-flip-is-in-the-commit-logs">§</a></h2>
<p>This retrospective was first published on August 22, 2026. January 31, 2024 is the implementation milestone described below; an earlier version of this page used that milestone as its publication date. The date was corrected on September 5, 2026.</p>
<p>You can watch it happen in both halves at once:</p>
<ul>
<li>cdk-erigon grew SMT witness generation on January 17, 2024 (<a href="https://github.com/0xPolygon/cdk-erigon/pull/50">#50</a>). <code>eth_getWitness</code> and the witness spec followed the same week.</li>
<li>Three days later the prover gained its first witness decoder (<code>src/prover/witness.cpp</code>, Jan 20).</li>
<li>Stateless batch proving merged on January 31, 2024 — <a href="https://github.com/0xPolygon/zkevm-prover/pull/765">PR #765</a>, from a branch literally named <code>erigon_witness</code>.</li>
</ul>
<p>Everything before that in the prover’s history is coupled to its state database.</p>
<p>This was not a solo act. The node half — witness generation, <code>eth_getWitness</code>, the spec — was our engineers at Gateway. The prover half was <a href="https://github.com/0xPolygonHermez">Polygon’s team</a>. Two teams, one seam, eleven days.</p>
<h2 id="the-same-spec-carried-across">The same spec, carried across <a class="plink" href="#the-same-spec-carried-across">§</a></h2>
<p>The first-generation format has a formal spec. I wrote it — the <a href="https://github.com/ethereum/portal-network-specs/blob/5141f46bb7c79b212a702522f1c70e528262b477/witness.md">Block Witness Formal Specification</a> for stateless Ethereum. First commit: <span class="badge">Mar 26, 2020</span></p>
<p>Four years later, the person who added the witness spec to cdk-erigon was also me — <a href="https://github.com/0xPolygon/cdk-erigon/pull/59">#59</a>, the same week the prover learned to decode it. <span class="badge">Jan 2024</span> <a href="https://github.com/0xPolygon/cdk-erigon/blob/zkevm/turbo/trie/WITNESS.md">It lives in the tree today</a>.</p>
<p><a href="/writing/kv-witness/">KV-Witness</a> was my proposed second generation. Production picked gen one — the one I specified. Not on merit: that code already existed, and nobody had time to debug a new format. I lost the argument with myself and won it anyway.</p>
<figure tabindex="0"><img src="/static/img/witness-opcode-format.svg" alt="The first-generation format. A witness is a small program: a stack machine executes the opcode tape and rebuilds the par" width="688" height="300" loading="lazy" /><figcaption>The first-generation format. A witness is a small program: a stack machine executes the opcode tape and rebuilds the partial trie — touched state as data, everything untouched as a hash.</figcaption></figure>
<p>Stateless Ethereum never shipped on L1. Its core mechanism ships every day inside the rollups we build at <a href="https://gateway.fm">Gateway</a>.</p>
<h2 id="where-the-idea-shows-up">Where the idea shows up <a class="plink" href="#where-the-idea-shows-up">§</a></h2>
<ul>
<li><strong><a href="https://github.com/ethereum/portal-network-specs/blob/5141f46bb7c79b212a702522f1c70e528262b477/witness.md">Block Witness Formal Specification</a></strong> <span class="badge">2020</span> — the gen-1 spec, written for stateless Ethereum.</li>
<li><strong><a href="https://github.com/0xPolygon/cdk-erigon/blob/zkevm/turbo/trie/WITNESS.md">The witness spec in cdk-erigon</a></strong> <span class="badge">2024</span> — the same lineage, added for the stateless prover.</li>
<li><strong><a href="/writing/kv-witness/">KV-Witness</a></strong> — the 2020 second-generation proposal: what a key-value shape buys over opcodes.</li>
<li><strong><a href="/writing/semi-stateless-initial-sync/">Semi-Stateless Initial Sync</a></strong> and <strong><a href="/writing/stateless-ethereum-binary-tries/">Binary Tries</a></strong> — the mainnet experiments behind the numbers above.</li>
<li><strong><a href="https://github.com/0xPolygon/cdk-erigon">cdk-erigon</a></strong> — the witness-based pipeline in production rollups.</li>
</ul>]]></content:encoded>
</item>
<item>
<title>Private doors and interoperable roads</title>
<link>https://255c.org/notes/private-doors-interoperable-roads/</link>
<guid isPermaLink="true">https://255c.org/notes/private-doors-interoperable-roads/</guid>
<dc:creator>Igor Mandrigin</dc:creator>
<pubDate>Tue, 18 Aug 2026 00:00:00 +0000</pubDate>
<description>Listening back to the conversation with Ben, one analogy I think captures the broader problem well: A financial market needs doors and it needs roads. Doors are a useful way to think about institutional privacy. They create boundaries around sensitive information, while defining who gets access, under what conditions, and what can leave the room. Technically, that starts to look like private…</description>
<content:encoded><![CDATA[<p>Listening back to the conversation with Ben, one analogy I think captures the broader problem well:</p>
<p>A financial market needs doors and it needs roads.</p>
<p>Doors are a useful way to think about institutional privacy. They create boundaries around sensitive information, while defining who gets access, under what conditions, and what can leave the room. Technically, that starts to look like private state, selective disclosure, policy-bound access and proofs that something is valid without exposing everything underneath.</p>
<p>But a market made only of private rooms does not function. It also needs roads: the interoperability layer that allows value, instructions and proofs to move between institutions, networks and markets without requiring everyone to operate inside the same environment.</p>
<p>That is the broader tension we get into in this podcast: how do we give institutions the privacy they require without recreating the same fragmented financial silos onchain?</p>
<p>Better rails matter. But so does the market structure we build on top of them.</p>
<h2 id="where-the-idea-shows-up">Where the idea shows up <a class="plink" href="#where-the-idea-shows-up">§</a></h2>
<ul>
<li><strong><a href="https://www.youtube.com/watch?v=nvaJwCy44tQ">Privacy, Ethereum, and the Future of On-Chain Finance</a></strong> — the conversation with Ben Schiller: privacy architectures beyond permissioned blockchains, zero-knowledge proofs, the AggLayer, and the risk of recreating financial silos on new rails.</li>
<li><strong><a href="https://gateway.fm/open-privacy-suite/">Open Privacy Suite</a></strong> — the “doors” part, in built form: identity-aware policy, selective disclosure and audit evidence over standard JSON-RPC.</li>
<li><strong><a href="/writing/regenesis-explained/">ReGenesis Explained</a></strong> — from 2020, an earlier version of the same concern at the protocol layer: state-storage centralization pushes infrastructure toward a few big operators, and what to do about it.</li>
</ul>
<p>Privacy without interoperability gives you isolated rooms — modernized technology without modernizing the financial system. Interoperability without privacy gives you transparency nobody with sensitive positions will accept. The useful work is in holding both at once.</p>]]></content:encoded>
</item>
<item>
<title>Apps without shame</title>
<link>https://255c.org/notes/apps-without-shame/</link>
<guid isPermaLink="true">https://255c.org/notes/apps-without-shame/</guid>
<dc:creator>Igor Mandrigin</dc:creator>
<pubDate>Sat, 07 Feb 2026 00:00:00 +0000</pubDate>
<description>Streaks did not make me consistent. They made me quit. At some point I was tracking everything, everywhere. Every app wanted a log, a chart, a chain not to break. The tracking became its own job. I got overwhelmed — and stopped following all of it, the good habits included. That is the failure mode no dashboard shows. The streak works on you right up until it collapses the whole practice. The…</description>
<content:encoded><![CDATA[<p>Streaks did not make me consistent. They made me quit.</p>
<p>At some point I was tracking everything, everywhere. Every app wanted a log, a chart, a chain not to break. The tracking became its own job. I got overwhelmed — and stopped following all of it, the good habits included.</p>
<p>That is the failure mode no dashboard shows. The streak works on you right up until it collapses the whole practice.</p>
<p>The mechanics are not there for you anyway. Streaks, badges, guilt notifications — that is growth hacking, aimed at your willpower.</p>
<p>So I refused all of it. The app has one job: tell you when the moment arrives. A reminder. A kitchen timer.</p>
<h2 id="interfast">Interfast <a class="plink" href="#interfast">§</a></h2>
<p>I built <a href="https://github.com/mandrigin/interfast">Interfast</a> this way in February 2026. An intermittent-fasting app that does not track you — a private local scheduler instead of a tracker.</p>
<p>Fasting doesn’t need streaks, charts, or badges. The only hard part is knowing when each biological milestone hits. So that is the whole app.</p>
<p>No account. No cloud. Nothing to keep up. Break a fast and the app has no opinion about it. You cannot disappoint a kitchen timer.</p>
<p>And it did what the streaks never did: I still use it.</p>
<blockquote>
<p><strong>UPD (August 2026):</strong> it happened again. Marco Arment shipped <a href="https://marco.org/2026/08/14/unforgetful">Unforgetful</a> — the same stance, applied to reminders. Persistent notifications until the thing is actually done. Flexible snoozing. A deliberately simple interface. No gamification anywhere.</p>
<p></p>
<p>Different domain, same refusal: the app works for you, not on you. When two people independently build the same refusal, it is not a feature gap. It is a thesis.</p>
</blockquote>
<h2 id="where-the-idea-shows-up">Where the idea shows up <a class="plink" href="#where-the-idea-shows-up">§</a></h2>
<ul>
<li><strong><a href="https://github.com/mandrigin/interfast">Interfast</a></strong> — fasting as a private local scheduler. “Closer to a kitchen timer than a wellness app.”</li>
<li><strong><a href="https://marco.org/2026/08/14/unforgetful">Unforgetful</a></strong> — Marco Arment’s reminders app, August 2026: persistent, simple, respectful.</li>
<li><strong><a href="https://github.com/mandrigin/leflac">LE FLAC</a></strong> — the same refusal in a music player: no network permission, no accounts, no telemetry.</li>
<li><strong><a href="/projects/" class="sec-link">Projects</a></strong> — the rest of the tools built with this bias.</li>
</ul>]]></content:encoded>
</item>
</channel>
</rss>