<?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/">
  <channel>
    <title>DEV Community: Johannes Koeleman</title>
    <description>The latest articles on DEV Community by Johannes Koeleman (@regitxx).</description>
    <link>https://dev.to/regitxx</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4280650%2F4f4c28a7-0801-4da1-b938-d0d5a0f1d1e9.jpg</url>
      <title>DEV Community: Johannes Koeleman</title>
      <link>https://dev.to/regitxx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/regitxx"/>
    <language>en</language>
    <item>
      <title>Getting a pure-Keccak post-quantum Ethereum vault down to 47,795 verify gas</title>
      <dc:creator>Johannes Koeleman</dc:creator>
      <pubDate>Thu, 03 Dec 2026 12:39:02 +0000</pubDate>
      <link>https://dev.to/regitxx/getting-a-pure-keccak-post-quantum-ethereum-vault-down-to-47795-verify-gas-5g6f</link>
      <guid>https://dev.to/regitxx/getting-a-pure-keccak-post-quantum-ethereum-vault-down-to-47795-verify-gas-5g6f</guid>
      <description>&lt;p&gt;Most discussions around post-quantum Ethereum wallets assume you either wait for a hardfork precompile or pay ~3.6M gas per signature to verify a lattice scheme like Falcon-512 in Solidity. Naive hash-based WOTS+ implementations in Solidity usually land around ~200k gas.&lt;/p&gt;

&lt;p&gt;I wanted to see how low a pure hash-based smart account (no elliptic curves, no lattice assumptions, just Ethereum's native &lt;code&gt;keccak256&lt;/code&gt;) could actually go on today's EVM, including after Pectra's EIP-7623 calldata cost floor.&lt;/p&gt;

&lt;p&gt;That turned into &lt;a href="https://github.com/regitxx/qvault" rel="noopener noreferrer"&gt;QVault&lt;/a&gt; (v0.3.0), a 690-SLOC Yul/Solidity smart vault paired with a Rust CLI and a 153 KB client-side Rust WebAssembly signer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why verification drops to 47,795 gas
&lt;/h2&gt;

&lt;p&gt;Four design choices did almost all the work:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Randomized 128-bit WOTS+ (&lt;code&gt;w=16&lt;/code&gt;, 35 chains, 560 bytes).&lt;/strong&gt; Instead of 32-byte (256-bit) chains, QVault follows RFC 8391 / FIPS 205 randomized message hashing: each signature mixes a 16-byte randomizer along with &lt;code&gt;chainId&lt;/code&gt;, vault address, &lt;code&gt;rootEpoch&lt;/code&gt;, &lt;code&gt;leafIndex&lt;/code&gt;, and &lt;code&gt;actionHash&lt;/code&gt; into the message digest. Security reduces to 128-bit second-preimage resistance rather than 256-bit collision resistance, cutting the chain count nearly in half (35 chains vs 67).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-hashed 32-byte &lt;code&gt;domainSeed&lt;/code&gt;.&lt;/strong&gt; Computing &lt;code&gt;domainSeed = keccak256("QVAULT-TREE-V1" || chainId || vaultSalt || rootEpoch)&lt;/code&gt; once per verification lets every WOTS+ chain step fit into &lt;strong&gt;55 bytes&lt;/strong&gt; (1 Keccak-f[1600] permutation) and every internal XMSS Merkle node fit into &lt;strong&gt;102 bytes&lt;/strong&gt; (also 1 permutation). Binding to &lt;code&gt;vaultSalt&lt;/code&gt; instead of the deployed address also breaks the CREATE2 circular dependency between &lt;code&gt;vaultAddress&lt;/code&gt; and &lt;code&gt;xmssRoot&lt;/code&gt;, so vaults can receive ETH/ERC-20 counterfactually before deployment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contiguous Yul scratch layout (&lt;code&gt;WOTSPlus128.sol&lt;/code&gt;).&lt;/strong&gt; All 35 recovered 16-byte chain endpoints land directly into one 597-byte buffer without intermediate Solidity memory copies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Staying above the Prague EIP-7623 floor.&lt;/strong&gt; At depth 10 (1,024 one-time leaves), the full signature is 916 bytes. On Prague, execution gas stays above the EIP-7623 calldata floor so there is zero floor penalty.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Measured gas (&lt;code&gt;solc 0.8.28&lt;/code&gt;, optimizer 200 runs, depth=10)
&lt;/h2&gt;

&lt;p&gt;Every row below is verified cross-language (Rust CLI + Browser WASM signing, real &lt;code&gt;@ethereumjs/vm&lt;/code&gt; execution on both Cancun and Prague):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation&lt;/th&gt;
&lt;th&gt;Cancun&lt;/th&gt;
&lt;th&gt;Prague (EIP-7623)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;verifyView&lt;/code&gt; (pure WOTS+-128 + depth-10 XMSS)&lt;/td&gt;
&lt;td&gt;47,795&lt;/td&gt;
&lt;td&gt;47,795&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EIP-1271 &lt;code&gt;isValidSignature&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;61,099&lt;/td&gt;
&lt;td&gt;61,099&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;commitIntent&lt;/code&gt; (Phase 1 anti-frontrun)&lt;/td&gt;
&lt;td&gt;47,739&lt;/td&gt;
&lt;td&gt;47,739&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;execute&lt;/code&gt; (Phase 2 Commit-Reveal ETH transfer)&lt;/td&gt;
&lt;td&gt;120,273&lt;/td&gt;
&lt;td&gt;120,273&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;execute&lt;/code&gt; (ERC-20 transfer)&lt;/td&gt;
&lt;td&gt;137,092&lt;/td&gt;
&lt;td&gt;137,092&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;executeBatch&lt;/code&gt; (atomic ETH + ERC-20)&lt;/td&gt;
&lt;td&gt;135,343&lt;/td&gt;
&lt;td&gt;135,343&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ERC-4337 v0.7 &lt;code&gt;validateUserOp&lt;/code&gt; (with prefund)&lt;/td&gt;
&lt;td&gt;120,532&lt;/td&gt;
&lt;td&gt;120,532&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;rotateRoot&lt;/code&gt; (fresh 1,024 leaves, same address)&lt;/td&gt;
&lt;td&gt;108,981&lt;/td&gt;
&lt;td&gt;108,981&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;emergencyFreeze&lt;/code&gt; (hash-locked panic switch)&lt;/td&gt;
&lt;td&gt;47,874&lt;/td&gt;
&lt;td&gt;47,874&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Beyond bare signatures
&lt;/h2&gt;

&lt;p&gt;A vault needs more than a fast verifier to be usable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;2-phase commit-reveal (&lt;code&gt;commitIntent&lt;/code&gt; -&amp;gt; &lt;code&gt;execute&lt;/code&gt;)&lt;/strong&gt; protects against mempool front-running or post-quantum key interception before inclusion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Root rotation at the same address (&lt;code&gt;rotateRoot&lt;/code&gt;)&lt;/strong&gt; lets you roll into a fresh 1,024-leaf XMSS tree without migrating balances.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hash-locked emergency freeze &amp;amp; timelocked cold XMSS recovery&lt;/strong&gt; handle compromised hot devices without falling back to an ECDSA guardian.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero-server-trust browser WASM (&lt;code&gt;assets/qvault.wasm&lt;/code&gt;, 153 KB)&lt;/strong&gt; generates a 1,024-leaf tree in ~300ms and signs in &amp;lt;1ms locally in your browser, with AES-256-GCM + PBKDF2 WebCrypto backups that are byte-compatible with the Rust CLI keystore.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Honest caveats
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Not externally audited yet.&lt;/strong&gt; This is v0.3.0 with automated unit tests and 14 real cross-language EVM checks. Treat it as testnet/research software until audited.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stateful one-time leaves.&lt;/strong&gt; WOTS+ leaves must never be reused. The Rust CLI atomically persists burned indices before outputting calldata, and the vault checks a compact on-chain bitmap (&lt;code&gt;isLeafUsed&lt;/code&gt;), but multi-device sync and RBF UX still require careful handling.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it or reproduce the benchmarks
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Browser WASM sandbox (no wallet required): &lt;a href="https://qvault.reziiix.com" rel="noopener noreferrer"&gt;https://qvault.reziiix.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Source &amp;amp; binaries (Rust + Solidity/Yul, AGPL-3.0 / Commercial): &lt;a href="https://github.com/regitxx/qvault" rel="noopener noreferrer"&gt;https://github.com/regitxx/qvault&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/regitxx/qvault &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; qvault
cargo &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; cargo build --release --all-targets
&lt;span class="nb"&gt;cd&lt;/span&gt; evm-verify &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm install &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; node verify.mjs &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; node verify-wasm.mjs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are working on ERC-4337, Safe guards, or Ethereum's post-quantum roadmap (&lt;code&gt;leanXMSS&lt;/code&gt; / EIP-8141), I would love feedback on the &lt;code&gt;w=16&lt;/code&gt; vs &lt;code&gt;w=4&lt;/code&gt; tradeoffs and Safe module integration.&lt;/p&gt;

</description>
      <category>webassembly</category>
      <category>ethereum</category>
      <category>rust</category>
      <category>cryptography</category>
    </item>
  </channel>
</rss>
