<script data-pm-proxy="intercept"></script><?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Axiomata]]></title><description><![CDATA[Unearthing the fundamental truths and hidden principles driving AI, Bitcoin, and scientific progress. Exploring the axioms that underpin our technological future and shape the nature of intelligence, value, and discovery.]]></description><link>https://ciphernom.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!6WaT!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a7aa0e0-ee13-41eb-8b11-53c5a8fa2e06_849x849.png</url><title>Axiomata</title><link>https://ciphernom.substack.com</link></image><generator>Substack</generator><lastBuildDate>Thu, 03 Sep 2026 03:02:03 GMT</lastBuildDate><atom:link href="/__u/ciphernom.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Nick]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[ciphernom@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[ciphernom@substack.com]]></itunes:email><itunes:name><![CDATA[Nick]]></itunes:name></itunes:owner><itunes:author><![CDATA[Nick]]></itunes:author><googleplay:owner><![CDATA[ciphernom@substack.com]]></googleplay:owner><googleplay:email><![CDATA[ciphernom@substack.com]]></googleplay:email><googleplay:author><![CDATA[Nick]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Building on Midstate]]></title><description><![CDATA[A Hands-On Guide to the JavaScript SDK]]></description><link>https://ciphernom.substack.com/p/building-on-midstate</link><guid isPermaLink="false">https://ciphernom.substack.com/p/building-on-midstate</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Tue, 25 Aug 2026 22:03:51 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!iJw4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Building on <a href="https://midstate.cash">Midstate</a>: A Hands-On Guide to the JavaScript SDK</h1><p><a href="https://midstate.cash">Midstate</a> is a post-quantum blockchain. It signs with hash-based one-time keys (WOTS) instead of elliptic curves, and that single decision shapes everything about how you write code against it.</p><p>Here is the rule that matters more than anything else in this guide:</p><blockquote><p><strong>A signing key on <a href="https://midstate.cash">Midstate</a> is a consumable. Use it twice and you lose the coins.</strong></p></blockquote><p>Not &#8220;lose privacy&#8221;. Not &#8220;get a warning&#8221;. The node ships a Key Reuse Punishment Burn Protocol that lets any observer burn funds sitting at a WOTS key that signed twice. The SDK is built so you cannot trip that by accident, which is why some of its API looks unusual at first.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!s8t5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643cfc79-5ade-4cb7-b181-2a23e42bcad7_260x260.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!s8t5!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643cfc79-5ade-4cb7-b181-2a23e42bcad7_260x260.gif 424w, /__u/substackcdn.com/image/fetch/$s_!s8t5!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643cfc79-5ade-4cb7-b181-2a23e42bcad7_260x260.gif 848w, /__u/substackcdn.com/image/fetch/$s_!s8t5!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643cfc79-5ade-4cb7-b181-2a23e42bcad7_260x260.gif 1272w, /__u/substackcdn.com/image/fetch/$s_!s8t5!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643cfc79-5ade-4cb7-b181-2a23e42bcad7_260x260.gif 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!s8t5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643cfc79-5ade-4cb7-b181-2a23e42bcad7_260x260.gif" width="320" height="320" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/643cfc79-5ade-4cb7-b181-2a23e42bcad7_260x260.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:260,&quot;width&quot;:260,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1814727,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/gif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207912895?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643cfc79-5ade-4cb7-b181-2a23e42bcad7_260x260.gif&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!s8t5!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643cfc79-5ade-4cb7-b181-2a23e42bcad7_260x260.gif 424w, /__u/substackcdn.com/image/fetch/$s_!s8t5!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643cfc79-5ade-4cb7-b181-2a23e42bcad7_260x260.gif 848w, /__u/substackcdn.com/image/fetch/$s_!s8t5!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643cfc79-5ade-4cb7-b181-2a23e42bcad7_260x260.gif 1272w, /__u/substackcdn.com/image/fetch/$s_!s8t5!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643cfc79-5ade-4cb7-b181-2a23e42bcad7_260x260.gif 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This guide starts with code you can run offline in about two minutes, then works up to sending real money.</p><div><hr></div><h2>Part 1: Play offline first (no network, no coins, no risk)</h2><p>The fun parts of this SDK run with zero network access. Start here.</p><pre><code><code>mkdir midstate-play &amp;&amp; cd midstate-play
npm init -y
npm pkg set type=module
npm install midstate-sdk</code></code></pre><p>Now make <code>play.mjs</code>:</p><pre><code><code>import { fileURLToPath } from 'node:url';
import { readFile } from 'node:fs/promises';

// 1. Load the WASM core. Nothing works before this.
const wasmPath = fileURLToPath(
  import.meta.resolve('midstate-sdk/pkg/wasm_wallet_bg.wasm')
);
const wasmBytes = await readFile(wasmPath);

const wasm = await import('midstate-sdk/pkg/wasm_wallet.js');
await wasm.default({ module_or_path: wasmBytes });

// 2. Compile a contract.
const { compile } = await import('midstate-sdk/compiler');
const { execute } = await import('midstate-sdk/vm');

const src=/__u/ciphernom.substack.com/%60%7B var a = 2 + 3; assert(a == 5); } true;`;
const c = compile(src);
console.log('bytecode:', c.bytecode);
console.log('size:', c.sizeBytes, 'bytes | sigops:', c.sigops);

// 3. Run it.
console.log(execute(c.asm, {}));
// { ok: true, stack: [ '01' ], steps: 7, error: null, trace: [] }</code></code></pre><p>Run it:</p><pre><code><code>node play.mjs</code></code></pre><p>That is a real <a href="https://midstate.cash">Midstate</a> contract, compiled to real bytecode, executed on a real (headless) VM. No node, no wallet, no waiting.</p><p><strong>Worth knowing early.</strong> The subpath imports (<code>midstate-sdk/compiler</code>, <code>/vm</code>, <code>/pump</code>, <code>/launcher</code>, <code>/bincode</code>) never touch the network layer. Importing the package root pulls in libp2p and its whole transport stack. For contract or curve work, use the subpaths and keep it light.</p><h3>Curve math, also offline</h3><pre><code><code>const L = await import('midstate-sdk/launcher');

// Linear bonding curve: price equals current supply.
L.curveBuyCost(0n, 5n);     // 10n  (0+1+2+3+4)
L.curveSellRefund(5n, 5n);  // 10n  (exact mirror, so a round trip is lossless)

// Constant-product AMM with the 0.3% fee.
L.getAmountOut(1000n, 1000n, 100n);  // 90n</code></code></pre><p>Everything is <code>BigInt</code>. No floats anywhere in the money path, on purpose. The on-chain contract asserts in integers, and a quote computed in floating point lands one unit on the wrong side of that assert and gets rejected after you have already paid for a commit.</p><div><hr></div><h2>Part 2: The WASM init gotcha</h2><p>This is the number one first-run failure, so it gets its own section.</p><p><code>new Wallet(...)</code> builds a WASM-backed object in its constructor. If the runtime is not initialised you get an opaque binding error, not a helpful message.</p><pre><code><code>import { Wallet } from 'midstate-sdk';

// ALWAYS do this first.
await Wallet.init(wasmBytes);               // Node: a Buffer
await Wallet.init('/wasm_wallet_bg.wasm');  // Browser: a URL</code></code></pre><p><code>Wallet.init()</code> is a thin wrapper. If you manage the WASM instance yourself (bundler-injected, streaming-compiled, shared across workers), import <code>initWasm</code> or <code>initWasmSync</code> from the package root instead.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!9VvQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f510c9-859f-4dc0-be43-d592096b3e44_500x703.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!9VvQ!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f510c9-859f-4dc0-be43-d592096b3e44_500x703.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!9VvQ!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f510c9-859f-4dc0-be43-d592096b3e44_500x703.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!9VvQ!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f510c9-859f-4dc0-be43-d592096b3e44_500x703.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!9VvQ!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f510c9-859f-4dc0-be43-d592096b3e44_500x703.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!9VvQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f510c9-859f-4dc0-be43-d592096b3e44_500x703.jpeg" width="500" height="703" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/35f510c9-859f-4dc0-be43-d592096b3e44_500x703.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:703,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:65451,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207912895?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f510c9-859f-4dc0-be43-d592096b3e44_500x703.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!9VvQ!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f510c9-859f-4dc0-be43-d592096b3e44_500x703.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!9VvQ!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f510c9-859f-4dc0-be43-d592096b3e44_500x703.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!9VvQ!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f510c9-859f-4dc0-be43-d592096b3e44_500x703.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!9VvQ!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35f510c9-859f-4dc0-be43-d592096b3e44_500x703.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>Part 3: Wallets and storage</h2><p>A wallet is a 24-word phrase plus a storage provider.</p><pre><code><code>import { Wallet, Storage } from 'midstate-sdk';

const store = new Storage.NodeFSStorage('./wallet-data');

const wallet = await Wallet.create(store);
console.log(wallet.phrase);   // 24 words. Back this up. Only recovery path.

// Later, same machine:
const wallet = await Wallet.restore(store);

// Or open an existing seed:
const wallet = await Wallet.create(store, 'word word word ...');</code></code></pre><p>Three providers ship in the box:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{array}{|l|l|l|}\n\\hline\n\\textbf{Provider} &amp; \\textbf{Where it stores} &amp; \\textbf{Use for} \\\\\n\\hline\n\\text{MemoryStorage} &amp; \\text{RAM, gone on exit} &amp; \\text{tests, scratch work} \\\\\n\\hline\n\\text{NodeFSStorage(dir)} &amp; \\text{wallet.json + mss_*.bin} &amp; \\text{servers, CLIs} \\\\\n\\hline\n\\text{BrowserStorage} &amp; \\text{localStorage + IndexedDB} &amp; \\text{web apps} \\\\\n\\hline\n\\end{array}&quot;,&quot;id&quot;:&quot;DAXBJAFGQW&quot;}" data-component-name="LatexBlockToDOM"></div><p>To store elsewhere, subclass <code>StorageProvider</code> and implement four methods: <code>saveMetadata</code>, <code>loadMetadata</code>, <code>saveMssTree</code>, <code>loadMssTree</code>.</p><p>The split matters. Metadata is a JSON blob. Merkle signature trees are binary and can run to megabytes, which is why the browser provider puts metadata in <code>localStorage</code> and trees in IndexedDB.</p><p><strong>Do not stub out </strong><code>saveMssTree</code><strong>.</strong> Next section explains why.</p><div><hr></div><h2>Part 4: Addresses, or &#8220;how to not lose money&#8221;</h2><p>Two address types. Picking wrong is the mistake that costs users funds.</p><h3>WOTS: single use, instant</h3><pre><code><code>const addr = await wallet.getNewAddress();</code></code></pre><p>A Winternitz one-time address. Spend from it once and the key is public forever. Generate a fresh one per incoming payment. Think of it as a Bitcoin invoice address that self-destructs after use.</p><p>Derivation is instant, so there is no reason to ever reuse one.</p><h3>MSS: reusable, but on a budget</h3><pre><code><code>const addr = await wallet.getNewReusableAddress(10, (done, total) =&gt; {
  process.stdout.write(`\rgenerating ${done}/${total}`);
});</code></code></pre><p>An MSS address is a Merkle tree over <code>2^height</code> one-time keys. &#8220;Reusable&#8221; means each spend consumes a <em>different leaf</em>. It is a finite signature budget, not an unlimited key.</p><p>Height 10 gives you 1,024 signatures. Ever. Then the address is spent out.</p><p>Two things to design around:</p><p><strong>1. Generation cost is exponential.</strong> Height 10 is about 1,024 keypairs and takes a moment. Height 20 is about a million and is the slowest thing the wallet does. That is why the progress callback is in the public API rather than hidden. Put a spinner on it.</p><p><strong>2. The tree must be persisted or the address is receive-only.</strong> It cannot be cheaply regenerated. The SDK writes the tree to storage <em>before</em> recording the address as usable, so a crash mid-generation cannot leave you with an address that accepts funds and can never spend them. A storage provider that silently drops <code>saveMssTree</code> builds exactly that trap.</p><p><strong>Rule of thumb:</strong> MSS for anything published or long-lived (donation address, mining payout, contract counterparty). WOTS for everything else.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!uSin!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1d1be82-be39-4781-922a-cd22cdf30860_581x430.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!uSin!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1d1be82-be39-4781-922a-cd22cdf30860_581x430.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!uSin!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1d1be82-be39-4781-922a-cd22cdf30860_581x430.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!uSin!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1d1be82-be39-4781-922a-cd22cdf30860_581x430.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!uSin!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1d1be82-be39-4781-922a-cd22cdf30860_581x430.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!uSin!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1d1be82-be39-4781-922a-cd22cdf30860_581x430.jpeg" width="581" height="430" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d1d1be82-be39-4781-922a-cd22cdf30860_581x430.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:430,&quot;width&quot;:581,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78055,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207912895?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1d1be82-be39-4781-922a-cd22cdf30860_581x430.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!uSin!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1d1be82-be39-4781-922a-cd22cdf30860_581x430.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!uSin!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1d1be82-be39-4781-922a-cd22cdf30860_581x430.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!uSin!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1d1be82-be39-4781-922a-cd22cdf30860_581x430.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!uSin!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1d1be82-be39-4781-922a-cd22cdf30860_581x430.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Units are binary, not decimal</h3><pre><code><code>import { MidstateUtils } from 'midstate-sdk';

MidstateUtils.formatMDS(2048);  // { value: '2',   prefix: 'kMDS' }
MidstateUtils.formatMDS(500);   // { value: '500', prefix: 'MDS'  }</code></code></pre><p>1 kMDS is <strong>1024</strong> MDS, not 1000. Then mMDS at 1048576 and gMDS at 1073741824. Use the formatter instead of dividing by 1000 and wondering why the numbers drift.</p><p>Balances are <code>BigInt</code>:</p><pre><code><code>wallet.getBalance();        // spendable
wallet.getLockedBalance();  // real, yours, but pinned by reuse risk (Part 8)</code></code></pre><div><hr></div><h2>Part 5: Connecting to the network</h2><p>One client class, two transports. The constructor picks based on what you hand it.</p><pre><code><code>import { MidstateClient } from 'midstate-sdk';

// HTTP: simplest, works everywhere.
const client = new MidstateClient('https://rpc.cypherpunk.gold');

// P2P: TCP under Node, WebRTC in the browser.
const client = new MidstateClient(['/dns4/some-node/tcp/4001/p2p/12D3KooW...']);
await client.connect();</code></code></pre><p>Anything containing <code>/p2p/</code>, or any array, is treated as multiaddrs. Everything else is an HTTP base URL. Every read method works identically on both, so you can build against HTTP and switch later without touching call sites.</p><pre><code><code>const state = await client.getState();
// { height, block_reward, required_pow, header_hash, ... }

await client.getBlock(height);
await client.getMempool();
await client.checkCoin(coinIdHex);
await client.checkCommitment(commitmentHex);</code></code></pre><h3>Push events are P2P only</h3><pre><code><code>client.onPushEvent(evt =&gt; {
  if (evt.NewBlockTip) console.log('new tip', evt.NewBlockTip.height);
  if (evt.ChatMessage) console.log('chat', evt.ChatMessage);
});
client.onStatusChange(s =&gt; console.log('link:', s));</code></code></pre><p>Call <code>onPushEvent</code> on an HTTP client and you get a console warning and nothing else. If your app needs live tip notifications (a miner, a wallet reacting to reorgs, a live order book), you need P2P.</p><p>The P2P client reconnects on its own, up to 5 attempts with a growing backoff, and discovers extra peers from the first one it reaches.</p><div><hr></div><h2>Part 6: Syncing</h2><p>Midstate wallets scan with compact block filters. Fetch one filter per block, test it locally against your watched addresses, download only the blocks that match.</p><pre><code><code>const result = await wallet.sync(client, {
  gapLimit: 20,
  onProgress: p =&gt; console.log(`${p.height}/${p.chainHeight}`),
  onReorg: r =&gt; console.warn('reorg healed', r),
});

// { height, found, balance, lockedBalance, utxos, reorg,
//   wotsDerived, highestUsedWots, gapPasses, filterCacheHits, fullScan }</code></code></pre><p><strong>Leave the pacing defaults alone unless you have measured a reason.</strong> <code>filterIntervalMs</code> defaults to 550ms and <code>batchSize</code> to 1000. The node budgets expensive requests (filters and block templates share one allowance) at roughly 120 per minute for a fresh peer, and 20 violations earns a 500-second ban. The defaults sit inside that.</p><p><strong>About </strong><code>gapLimit</code><strong>.</strong> It defaults to <code>0</code>, meaning no gap scanning: only addresses you already generated get detected. Restoring from seed needs a gap limit, and the SDK refuses a partial scan it cannot trust:</p><pre><code><code>await wallet.sync(client, { gapLimit: 20 });
// Throws if the wallet has never scanned from genesis:
// "indices used below that height are invisible and the walk can stop
//  early with a too-small balance."</code></code></pre><p>That error is doing you a favour. A confidently wrong, too-small balance is the worst possible failure, because nothing signals that anything was missed.</p><p>Gap scanning is adaptive. It widens the address window, re-scans, widens again, and repeats until a pass finds nothing new (capped by <code>maxGapPasses</code>, default 12). Filters are cached between passes, so this is far cheaper than it sounds.</p><div><hr></div><h2>Part 7: Sending money</h2><p>This is the part that looks strangest and matters most.</p><p>Every spend is split in two:</p><ol><li><p><strong>Commit.</strong> Publish <code>H(input_coin_ids || output_hashes || salt)</code>: one 32-byte hash, with a client-mined proof-of-work of 24 leading zero bits, rising as the commit pool fills. It says nothing about which coins you are spending or where they are going.</p></li><li><p><strong>Reveal.</strong> Publish the real inputs, outputs and witnesses. The node recomputes the commitment from them and rejects the transaction unless that exact commitment is already registered.</p></li></ol><p>In the node&#8217;s own words, the commit &#8220;blinds the inputs being spent behind a commitment hash, preventing front-running&#8221;. Concretely, that buys two things.</p><p><strong>Witness secrets are useless to onlookers.</strong> Midstate&#8217;s HTLC and limit-order covenants are authorised by a hashlock rather than a signature: the claim path lets <em>anyone</em> spend the coin provided they present the preimage. A reveal that claims one therefore publishes the secret. Without phase 1, an observer could lift that secret from your mempool transaction and broadcast their own claim at a higher fee. With it, the winner was already fixed before the secret was visible, because your commitment was registered and theirs was not.</p><p><strong>Outputs cannot be substituted.</strong> The commitment covers inputs <em>and</em> outputs. A competing transaction spending your coins to a different destination hashes to a different commitment, which is not in the commitment set, so the node rejects it outright. The mempool does support replace-by-fee, but a replacement still needs its own registered commitment.</p><h3>What the two phases are <em>not</em> for</h3><p>It is tempting to assume phase 1 exists because publishing a hash-based signature is itself dangerous. It is not, and the distinction matters.</p><p>A Winternitz signature reveals hash-chain intermediates at depths set by the message digits. Forging a different message requires <em>every</em> digit to be greater than or equal to the one you observed. Raising a message digit lowers the checksum, and the checksum chains only run forwards, so one signature is not forgeable. Grinding five million candidate messages against a single signature produces zero forgeries; remove the checksum and they start appearing.</p><p>What <em>is</em> fatal is two signatures from one key over two <em>different</em> commitments. The node merges them, keeping the shallowest revealed depth in each chain, and that composite can be ground into a working forgery. That is exactly what the Key Reuse Punishment Burn Protocol does, automatically, the moment it sees the second signature.</p><p>So the danger is reuse, not disclosure. Publishing a signature is fine. Publishing a second one from the same key is what costs you the coins.</p><p>One call drives the whole dance:</p><pre><code><code>const resp = await wallet.send(client, recipientAddrHex, 1000n);
// { ok: true, body: null }   or   { ok: false, body: '&lt;reason&gt;' }</code></code></pre><p>Note the return shape. It is <code>{ ok, body }</code>, not a transaction id.</p><p>You can also burn data onto the chain in the same transaction:</p><pre><code><code>await wallet.send(client, addr, 1000n, '48656c6c6f', 0n);
//                                     ^ hex payload  ^ MDS burned alongside</code></code></pre><h3>Budget for the latency</h3><p>Under the hood, <code>send()</code> builds the spend, mines the anti-spam PoW at the current <code>required_pow</code>, submits the commit, then polls <code>checkCommitment</code> <strong>every 10 seconds for up to 120 tries</strong>. That is a 20-minute ceiling.</p><p>Consensus actually permits a Commit and its Reveal in the same block. The SDK waits anyway, because a light client cannot make a miner include both, and a reveal whose commitment never lands is simply rejected.</p><p>A Midstate send is not a sub-second operation. A progress bar stuck on &#8220;sending...&#8221; for ten minutes reads as a hang, so tell your users what is happening.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!DyOv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faba5-c8f9-4af8-9253-4b7eee011e28_508x500.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!DyOv!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faba5-c8f9-4af8-9253-4b7eee011e28_508x500.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!DyOv!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faba5-c8f9-4af8-9253-4b7eee011e28_508x500.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!DyOv!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faba5-c8f9-4af8-9253-4b7eee011e28_508x500.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!DyOv!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faba5-c8f9-4af8-9253-4b7eee011e28_508x500.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!DyOv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faba5-c8f9-4af8-9253-4b7eee011e28_508x500.jpeg" width="508" height="500" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/772faba5-c8f9-4af8-9253-4b7eee011e28_508x500.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:508,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:73408,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207912895?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faba5-c8f9-4af8-9253-4b7eee011e28_508x500.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!DyOv!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faba5-c8f9-4af8-9253-4b7eee011e28_508x500.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!DyOv!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faba5-c8f9-4af8-9253-4b7eee011e28_508x500.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!DyOv!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faba5-c8f9-4af8-9253-4b7eee011e28_508x500.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!DyOv!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faba5-c8f9-4af8-9253-4b7eee011e28_508x500.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Failure modes are unusually well behaved</h3><p>Knowing these lets you write better handling than a blind retry.</p><p><strong>Commit never mined.</strong> Nothing is at risk. Commits neither lock nor modify UTXOs, the reveal was never built, no signing key was touched. You lost the PoW effort. Retry freely, and the SDK&#8217;s error message says so explicitly.</p><p><strong>Reveal broadcast, then orphaned.</strong> This is the dangerous one, though not for the reason people assume. The SDK keeps the signed reveal and re-broadcasts <em>the exact same bytes</em>.</p><p>Signing again is not itself the problem. WOTS signing is a pure function of key and message, so signing the same commitment twice yields byte-identical output, and the burn protocol&#8217;s trigger is <code>wots_pk</code> matching while <code>commitment</code> <em>differs</em>. Same key over the same commitment is not reuse and never was.</p><p>The problem is that rebuilding a transaction almost never reproduces the same commitment. A fresh salt, a different fee, a different input ordering or a new change output all change <code>H(input_coin_ids || output_hashes || salt)</code>, and now you have two signatures from one key over two commitments, which is exactly what gets merged into a forgery. Storing the bytes removes the chance to drift.</p><h3>Other spend shapes</h3><pre><code><code>// Sweep every coin at one address into one output (needs 2+ coins, max 8192).
await wallet.consolidate(client, sourceAddr, destAddr);

// Sweep scattered coins across many addresses into one destination.
await wallet.defrag(client, destAddr, 50);

// Fund many addresses in one commit/reveal round trip.
await wallet.fundMany(client, [{ address: a, amount: 100n }]);</code></code></pre><div><hr></div><h2>Part 8: Surviving reorgs</h2><p>Because a burned key cannot be un-burned, reorg handling here is safety-critical rather than housekeeping. Wire it up once at startup:</p><pre><code><code>const stop = wallet.autoReconcile(client, {
  onReorg:   r =&gt; console.warn('rolled back to', r.fork),
  onRecover: r =&gt; console.log('re-broadcast:', r.status),
  onChat:    m =&gt; renderChat(m),
  onTip:     t =&gt; updateUI(t),
  onError:   e =&gt; report(e),
});

stop();  // unsubscribe</code></code></pre><p>This needs a P2P client, since it feeds on push events. It subscribes, detects forks, rolls back, and finishes any re-send a rollback armed.</p><p>The bounds are exported so you can reason about them:</p><pre><code><code>import { REORG_DEPTH, COMMITMENT_TTL } from 'midstate-sdk';
// REORG_DEPTH    = 200   blocks of history retained for precise healing
// COMMITMENT_TTL = 1000  blocks a commitment survives (about 16.7 hours)</code></code></pre><p>When a spend gets orphaned, the SDK resolves it one of three ways:</p><ul><li><p><strong>Signed reveal still held, still within TTL:</strong> re-broadcast the identical signature. Safe and automatic.</p></li><li><p><strong>The original commitment can no longer be replayed</strong> (expired from chain state, or an input coin is gone): the coins come back <strong>reuse-locked</strong>. Moving them would now require a <em>new</em> commitment signed by an already-published key, which is the fatal case. They appear in <code>getLockedBalance()</code>, never in <code>getBalance()</code>, coin selection cannot reach them, and you get an alert explaining why.</p></li><li><p><strong>MSS inputs:</strong> no per-key cliff, since each spend used a distinct leaf. Restored normally.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!chz3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cc3649b-50e8-4c46-b6ef-e031e218b17e_500x840.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!chz3!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cc3649b-50e8-4c46-b6ef-e031e218b17e_500x840.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!chz3!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cc3649b-50e8-4c46-b6ef-e031e218b17e_500x840.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!chz3!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cc3649b-50e8-4c46-b6ef-e031e218b17e_500x840.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!chz3!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cc3649b-50e8-4c46-b6ef-e031e218b17e_500x840.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!chz3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cc3649b-50e8-4c46-b6ef-e031e218b17e_500x840.jpeg" width="500" height="840" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5cc3649b-50e8-4c46-b6ef-e031e218b17e_500x840.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:840,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:92137,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207912895?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cc3649b-50e8-4c46-b6ef-e031e218b17e_500x840.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!chz3!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cc3649b-50e8-4c46-b6ef-e031e218b17e_500x840.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!chz3!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cc3649b-50e8-4c46-b6ef-e031e218b17e_500x840.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!chz3!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cc3649b-50e8-4c46-b6ef-e031e218b17e_500x840.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!chz3!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5cc3649b-50e8-4c46-b6ef-e031e218b17e_500x840.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h3>One more startup call worth making</h3><pre><code><code>await wallet.reconcileMssLeaves(client);</code></code></pre><p>Your local MSS leaf counter is a <em>guess</em> at how much of a tree has been consumed. It can fall behind if the same seed ran on another device, or if you restored an older backup. When it does, you sign with a leaf the chain has already seen.</p><p>That failure is nasty because it is invisible at submission and permanent afterwards. The mempool accepts the transaction, then every new block evicts it, forever. From your side it just never confirms, and retrying never helps, because each attempt signs with the same exhausted leaf.</p><p>One call, one lookup per address, counters only ever move forward.</p><div><hr></div><h2>Part 9: Contracts</h2><p>Midstate has a stack-based contract VM. The workflow is fixed and the order is not negotiable.</p><pre><code><code>import { compile, simulateContract } from 'midstate-sdk';
// lighter: 'midstate-sdk/compiler' and 'midstate-sdk/vm'

const { bytecode, asm, sizeBytes, sigops } = compile(source);

// SIMULATE BEFORE YOU FUND ANYTHING.
const result = simulateContract(compile, source, ctx);</code></code></pre><p>Note <code>simulate</code> takes the compile function as its first argument.</p><p>A contract address is <code>BLAKE3(bytecode)</code>. Fund an address whose script can never be satisfied and the coins are gone. No admin key, no upgrade path, no recovery. Simulation turns &#8220;I think this covenant unlocks&#8221; into &#8220;I ran it and it unlocked&#8221;.</p><p>Limits to design within:</p><ul><li><p><code>MAX_SCRIPT_SIZE</code> is 1024 bytes</p></li><li><p><code>MAX_SIGOPS_PER_SCRIPT</code> is 3</p></li><li><p>the compiler caps simulated stack depth at 64</p></li><li><p>state threads activate at height 65,000</p></li><li><p><code>OP_SUM_INPUT_VALUE</code> activates at height 300,000</p></li></ul><h3>Two traps that will bite you</h3><p><strong>Trap 1: </strong><code>CHECKSIG</code><strong> in the simulator is fake.</strong> It compares strings. The real VM verifies a WOTS or MSS signature. A contract that &#8220;passes&#8221; simulation on signature checks has proved nothing about authorisation. Use the simulator to prove <em>arithmetic and state</em>, which is where bonding-curve and AMM bugs actually live.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!iJw4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!iJw4!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!iJw4!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!iJw4!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!iJw4!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!iJw4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg" width="702" height="395" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:395,&quot;width&quot;:702,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56956,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207912895?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!iJw4!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!iJw4!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!iJw4!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!iJw4!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57e41b8-2fec-4321-962d-2c10e8bb2acc_702x395.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Trap 2: </strong><code>Confidential</code><strong> outputs are not confidential.</strong> The name is vestigial. An earlier design had zk-STARK confidential transactions, those were removed, and state threads inherited the variant. Its value is <strong>known to be zero</strong>, not hidden. It carries a 32-byte data commitment: data, not money.</p><p>This has already caused an incorrect fix in the node and there is a regression test guarding it. If you are checking value conservation, count state-thread outputs as zero. The simulator will reject a state output that also carries value, because consensus does too.</p><h3>Endianness will get you</h3><p>Three different byte orders live in this SDK, and mixing them fails <em>silently</em> rather than loudly:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{array}{|l|l|l|}\n\\hline\n\\textbf{Module} &amp; \\textbf{Order} &amp; \\textbf{Why} \\\\\n\\hline\n\\text{launcher state} &amp; \\textbf{little}\\text{-endian} &amp; \\text{read via u64::from_le_bytes} \\\\\n\\hline\n\\text{dex announcements} &amp; \\textbf{big}\\text{-endian} &amp; \\text{matches counter-chain wire format} \\\\\n\\hline\n\\text{bincode P2P frames} &amp; \\text{little-endian varint} &amp; \\text{matches the node's bincode config} \\\\\n\\hline\n\\end{array}&quot;,&quot;id&quot;:&quot;PQBJPTRKBA&quot;}" data-component-name="LatexBlockToDOM"></div><p>Get it backwards in contract state and a balance of 10 reads as an astronomically large number, so a conservation assert passes or fails for reasons that look nothing like the actual bug. Use <code>encodeState</code> and <code>decodeState</code> rather than packing bytes by hand.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!nLXO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ce7fd3-06a5-40da-8220-c11faa4da768_544x500.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!nLXO!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ce7fd3-06a5-40da-8220-c11faa4da768_544x500.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!nLXO!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ce7fd3-06a5-40da-8220-c11faa4da768_544x500.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!nLXO!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ce7fd3-06a5-40da-8220-c11faa4da768_544x500.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!nLXO!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ce7fd3-06a5-40da-8220-c11faa4da768_544x500.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!nLXO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ce7fd3-06a5-40da-8220-c11faa4da768_544x500.jpeg" width="544" height="500" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95ce7fd3-06a5-40da-8220-c11faa4da768_544x500.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:544,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:64431,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207912895?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ce7fd3-06a5-40da-8220-c11faa4da768_544x500.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!nLXO!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ce7fd3-06a5-40da-8220-c11faa4da768_544x500.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!nLXO!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ce7fd3-06a5-40da-8220-c11faa4da768_544x500.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!nLXO!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ce7fd3-06a5-40da-8220-c11faa4da768_544x500.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!nLXO!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95ce7fd3-06a5-40da-8220-c11faa4da768_544x500.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>Part 9b: Midscript, the contract language</h2><p>Contracts are written in Midscript. It looks like C, and that is a trap: <strong>it is a stack machine wearing C syntax</strong>. Get that one thing straight and the rest follows quickly.</p><h3>Bare expressions push</h3><p>A statement that is just a value pushes it. This is the single most important difference from every language the syntax reminds you of:</p><pre><code><code>10; 20; add();          // push 10, push 20, add -&gt; [30]
pick(8);                // copy the item 8 deep to the top
assert(pop_int() == 3);</code></code></pre><p><code>var</code> does <em>not</em> pop. It claims a stack slot and remembers where it is, and the compiler emits <code>PICK</code> to reach it later. That is convenient right up to the moment it is not: your own pump contract carries the warning that the stack discipline for <code>CHECKSIGVERIFY</code> is fragile &#8220;because <code>var</code> claims stack slots without popping, so the signature has to be the top of stack at exactly the right moment.&#8221;</p><h3>Declarations</h3><p><code>let</code> is a compile-time constant, substituted at every use and costing nothing at runtime. <code>var</code> is a stack local.</p><pre><code><code>let TREASURY = "aa00...aa";    // constant, inlined
var supply = pop_int();        // stack local
supply = supply + 1;           // reassignment is fine
var supply = 2;                // ERROR: shadowing is forbidden</code></code></pre><p><code>state</code> declares a byte layout over the contract&#8217;s input state. Field access compiles to <code>READ_INPUT_STATE</code> plus a <code>SLICE</code>, and fields of 8 bytes or under come back as integers:</p><pre><code><code>state Curve { supply: 8, padding: 24 }

assert(Curve.supply == 10);    // reads bytes 0..8 of input state</code></code></pre><p><code>struct</code> is the same declaration for layouts that are not the input state.</p><h3>Control flow</h3><p><code>if</code> / <code>else if</code> / <code>else</code> work as expected. <code>repeat(n)</code> is an unrolled loop and <code>n</code><strong> must be a literal</strong>, since the bytecode has no jumps to loop with:</p><pre><code><code>repeat(3) { merkle_step(); }   // fine
var n = 3; repeat(n) { }       // Syntax Error: Expected NUM</code></code></pre><p><code>route</code> is the one to learn. It dispatches on the value already on top of the stack, which is how the witness selects a spending path:</p><pre><code><code>route {
  case 0: { require_sig(OWNER_PK); }
  case 1: { require_time(500000); require_sig(HEIR_PK); }
  default: { fail(); }
}</code></code></pre><p><code>switch (expr) { ... }</code> is the same thing with an explicit subject. Always give a <code>route</code> a <code>default</code>, and make it <code>fail()</code> unless you mean otherwise.</p><h3>Builtins</h3><p>About thirty, in four groups.</p><p><strong>Stack:</strong> <code>dup</code>, <code>drop</code>, <code>swap</code>, <code>over</code>, <code>rot</code>, <code>pick(n)</code>, <code>peek</code>, <code>size</code>, <code>slice</code>, <code>concat</code>, <code>pop_int</code>, <code>pop_hex</code>.</p><p>Note that bare <code>pop()</code> is a deliberate compile error telling you to pick a typed one. Untyped popping is how you end up comparing a length against a hash.</p><p><strong>Math:</strong> <code>add</code>, <code>sub</code>, <code>mul</code>, <code>div</code>, plus infix <code>+ - * / %</code> and comparisons <code>== &lt; &gt; &lt;= &gt;=</code> and <code>&amp;&amp; ||</code>.</p><p><strong>There is no </strong><code>!=</code><strong>.</strong> The lexer does not know <code>!</code> at all, and you get <code>Unknown char '!'</code>. Invert with <code>if/else</code> or restructure the assertion.</p><p><strong>Guards</strong> (these <code>VERIFY</code> and abort on failure): <code>require_sig</code>, <code>require_preimage</code>, <code>require_time</code>, <code>require_transfer</code>, <code>require_length</code>, <code>require_timelock</code>, <code>require_signed_by</code>, <code>require_funds_transferred</code>, <code>verify_gte</code>, <code>fail</code>. Plus <code>check_sig</code>, which pushes 0 or 1 instead of aborting, so you can count signatures.</p><p><strong>Chain intrinsics:</strong> <code>this_address</code>, <code>input_value</code>, <code>sum_input_value</code>, <code>sum_to_addr(addr)</code>, <code>read_input_state</code>, <code>read_output_state(i)</code>, <code>output_address(i)</code>, <code>hash</code>.</p><h3>The standard library is already there</h3><p><code>min</code>, <code>max</code>, <code>require_signed_by</code>, <code>require_length</code>, <code>require_timelock</code>, <code>require_funds_transferred</code>, <code>merkle_step</code> and <code>merkle_update_step</code> are prepended to every compile. No import.</p><p><code>merkle_update_step</code> is the interesting one: it verifies an old root and computes the new root in a single pass over the proof. That is the whole trick behind the pump ledger in Part 12, and it costs you nothing to use.</p><p>Your own macros work the same way. They inline, their arguments become stack locals, and those locals are dropped afterwards:</p><pre><code><code>macro get_new_supply() { read_output_state(0); 0; 8; slice(); 0; add(); }</code></code></pre><p>Read that as six stack operations, not as an expression. Macros are stack transformers, which is why calling one in expression position (<code>var a = min(7, 3);</code>) does not do what the syntax suggests.</p><h3>Four contracts worth reading</h3><p>Each of these compiles and runs today. Sizes are against the 1024-byte limit.</p><p><strong>2-of-3 multisig</strong> (122 bytes, 3 sigops, the maximum). <code>check_sig</code> returns 0 or 1, so you sum them:</p><pre><code><code>check_sig(PK_A);
swap(); check_sig(PK_B); add();
swap(); check_sig(PK_C); add();
assert(pop_int() &gt;= 2);
true;</code></code></pre><p><strong>HTLC</strong> (146 bytes, 2 sigops). The atomic-swap primitive, and the thing Part 7&#8217;s commit phase protects:</p><pre><code><code>route {
  case 1: {                      // claim: [sig, preimage, 01]
    require_preimage("5fbf08af2b116ab8f7f3c14b8ec01a46ce23d290e2ebc7a752d0982d54c054f2");
    require_sig(ALICE_PK);
  }
  case 0: {                      // refund: [sig, 00]
    require_time(600000);
    require_sig(BOB_PK);
  }
  default: { fail(); }
}
true;</code></code></pre><p><strong>Dead man&#8217;s switch</strong> (91 bytes). Three paths, and note the third asserts where the money went, not just who signed:</p><pre><code><code>route {
  case 0: { require_sig(OWNER_PK); }
  case 1: { require_time(500000); require_sig(HEIR_PK);
            assert(sum_to_addr(HEIR_ADDR) == 1000000); }
  case 2: { require_sig(ORACLE_PK);
            assert(sum_to_addr(HEIR_ADDR) == 1000000); }
  default: { fail(); }
}
true;</code></code></pre><p><strong>Linear bonding curve</strong> (98 bytes, 0 sigops). The smallest complete stateful contract, and the ancestor of Part 12:</p><pre><code><code>let TREASURY = "aa00...aa";
state Curve { supply: 8, padding: 24 }
macro get_new_supply() { read_output_state(0); 0; 8; slice(); 0; add(); }

assert(sum_to_addr(TREASURY) == Curve.supply);   // paid the right price
assert(get_new_supply() == Curve.supply + 1);    // updated state honestly
true;</code></code></pre><p>Two assertions and there is no other way to spend the coin. That is the shape most useful Midstate contracts take: constrain where the money goes and what the next state says, then stop.</p><h3>Budgeting 1024 bytes</h3><p><code>MAX_SCRIPT_SIZE</code> is 1024 and <code>MAX_SIGOPS_PER_SCRIPT</code> is 3, which sounds tight until you see the numbers. A 2-of-3 multisig is 122 bytes and already at the sigop ceiling. The full pump curve with a 512-slot Merkle ledger is 966. Signature checks, not logic, are the scarce resource.</p><p>Useful rules of thumb, all measured:</p><ul><li><p>each pump Merkle tree level costs exactly 60 bytes</p></li><li><p><code>repeat(n)</code> multiplies its body by <code>n</code>, because it unrolls</p></li><li><p><code>let</code> is free, <code>var</code> costs a stack slot and a <code>PICK</code> per use</p></li><li><p>the compiler also caps simulated stack depth at 64</p></li></ul><p>When you run out of room, the answer is usually to move work into the witness and verify it rather than compute it. Checking a Merkle proof is cheap; rebuilding a tree is not.</p><div><hr></div><h2>Part 10: Mining</h2><p>Mining on Midstate is a Verifiable Delay Function, not a hashrate race. <code>create_extension</code> hashes a <code>midstate || nonce</code> seed and then iterates BLAKE3 one million times <em>sequentially</em>. One nonce costs about 130ms of unavoidable serial work, and no amount of batching changes that.</p><p>The only lever is parallelism, and the search is embarrassingly parallel because every nonce is independent.</p><p>How much parallelism you get per core depends on where the code runs. The node dispatches on CPU features at startup:</p><ul><li><p>x86_64 with AVX2: 8 lanes</p></li><li><p>aarch64 NEON, dual-issue: 8 lanes</p></li><li><p>aarch64 NEON, single-issue: 4 lanes</p></li><li><p>wasm32 with simd128: 4 lanes</p></li><li><p>scalar fallback: 1</p></li></ul><p><strong>The SDK miner is the WASM path, so it gets 4 lanes</strong>, which works out to roughly 15 to 30 nonces per second per worker. A natively-built node on AVX2 hardware gets twice the lanes per core. If you are mining seriously rather than integrating, that gap is the reason to run the node binary.</p><p>Only the <em>search</em> uses SIMD. Verification is always scalar, and the 8-way path is bit-identical to two consecutive 4-way calls.</p><h4>Solo mining</h4><pre><code><code>import { Miner } from 'midstate-sdk/miner';

const miner = new Miner(wallet, client, {
  payoutMssAddress: myMssAddress,   // reusable address, for the reasons in Part 4
});

miner.on('template', t =&gt; console.log('template at', t.height, 'fees', t.fees));
miner.on('progress', s =&gt; console.log(`${s.rate.toFixed(1)} nonces/sec`));
miner.on('found',    f =&gt; console.log('hit!', f.nonce));
miner.on('accepted', b =&gt; console.log('accepted, reward', b.reward));  // BigInt
miner.on('rejected', b =&gt; console.log('rejected:', b.reason));
miner.on('share',    s =&gt; console.log('share', s.accepted));           // pool mode
miner.on('error',    e =&gt; console.error(e));

await miner.start();
// miner.stop();
// miner.getStats();</code></code></pre><p>Seven events: <code>template</code>, <code>progress</code>, <code>found</code>, <code>accepted</code>, <code>rejected</code>, <code>share</code>, <code>error</code>.</p><p><code>payoutMssAddress</code> is worth setting. Without it the miner consumes a fresh WOTS index per block. Note that a rejected block burns no key material: coinbase addresses are reserved, not committed, until a block is actually accepted.</p><h4>Use all your cores</h4><pre><code><code>import { MinerPool } from 'midstate-sdk/miner-pool';

const pool = new MinerPool({ workers: 8 });   // defaults to cores minus 1
await pool.start();

const miner = new Miner(wallet, client, { searchFn: pool.searchFn });
await miner.start();</code></code></pre><p><code>MinerPool</code> is Node-only (it uses <code>worker_threads</code>), which is why it is a separate import. Workers take disjoint strides: worker <code>k</code> of <code>n</code> tests <code>base + k*4</code>, <code>base + (k+n)*4</code>, and so on, so the four SIMD lanes inside one call stay contiguous while no two workers ever test the same nonce. Session bases are random, so two independent miners on the same template do not retrace each other either.</p><p><code>searchFn</code> is a deliberate seam. The node ships a full wgpu/WGSL GPU backend that spreads the search across thousands of threads, checkpointing each nonce&#8217;s chaining state across dispatches so it never trips the OS GPU watchdog. <strong>The SDK does not ship a GPU backend</strong>, but <code>searchFn</code> is where one plugs in, and the same seam takes a remote searcher or a test double.</p><h4>Pool mining</h4><p>Pool support is built into <code>Miner</code>, not bolted on beside it:</p><pre><code><code>import { PoolClient, libp2pPoolTransport, verifyPoolProof } from 'midstate-sdk/pool';

const pool = new PoolClient(libp2pPoolTransport(p2p));
await pool.connect(poolMultiaddr);

const miner = new Miner(wallet, client, {
  pool,
  poolAddress: myPayoutAddress,
  workerName: 'rig-01',
});
await miner.start();</code></code></pre><p>The behavioural difference matters. <strong>A share is not a block.</strong> Finding one leaves <code>mining_midstate</code> unchanged, so the template is still valid and the search must continue from the next nonce. Halting is correct solo behaviour, where a hit means the tip moved, but in pool mode it would leave the miner idle until the next network block. <code>Miner</code> flips to continue-on-found automatically when you pass a <code>pool</code>.</p><p><code>verifyPoolProof(addressHex, score, index, proof, rootHex)</code> checks the pool actually has you in its payout Merkle tree rather than taking its word for it.</p><h4>Why naive miners fail silently</h4><p>Three properties of the template, all of which the browser wallet got wrong in ways that produce found-then-rejected blocks:</p><ol><li><p><strong>Grind on </strong><code>mining_midstate</code><strong>, never </strong><code>post_tx_midstate</code><strong>.</strong> The node&#8217;s own comment calls grinding the wrong one &#8220;the bug that silently rejected every block the web wallet ever mined over WebRTC&#8221;. <code>verify_extension</code> recomputes from the header hash on receipt, so a nonce found against anything else simply does not validate.</p></li><li><p><strong>Templates expire and the timestamp is locked inside the hash.</strong> <code>finish_template</code> locks the timestamp into the header <em>before</em> computing <code>mining_midstate</code>, precisely so it cannot be bumped post-grind. But <code>validate_timestamp</code> requires a new block to beat the median of the last 11 blocks, and at a 60-second target that median trails the tip by about five blocks. A template older than roughly five minutes yields a block rejected on arrival, and there is no fix except abandoning it. The SDK refreshes on every tip change and at a hard <code>TEMPLATE_MAX_AGE_MS</code> of 120 seconds.</p></li><li><p><strong>Coinbase total must equal </strong><code>block_reward + total_fees</code><strong> exactly.</strong> Anything else is a <code>CoinbaseTotalMismatch</code>. Fees are only knowable from a template, and a template needs a coinbase, so the first request of a session is a guess. The SDK carries <code>expected_total</code> forward between templates, so it guesses right after the first block instead of eating a round trip every time.</p></li></ol><div><hr></div><h3>Part 11: The chat bus</h3><p>Calling this &#8220;chat&#8221; undersells it. It is a dictionary-bound P2P message bus, it is not on chain, and human conversation is the smallest thing it carries.</p><p>Messages gossip as <code>Message::ChatV2</code> frames between peers. They never enter a block, never touch the UTXO set, and are not replayable from history. Anti-spam is a small client-side PoW, about a million hashes, under 50ms on a Pi-class core.</p><pre><code><code>import { MidstateUtils, CHAT_DICTIONARY } from 'midstate-sdk';

CHAT_DICTIONARY.length;   // 256

const words = MidstateUtils.textToIndices('gm mate');   // [ 160, 168 ]
MidstateUtils.indicesToWords(words);                    // 'gm mate'

await client.sendChat(words);</code></code></pre><p>Limits: 10 words per message, 4 attachments.</p><h4>The dictionary is a security boundary</h4><p>Every token is a <code>u8</code> index into a fixed 256-entry table. That is not a quirk of a toy chat feature, it is the mechanism behind the property the whole subsystem is built around, which the source states as an invariant:</p><blockquote><p><strong>NoArbitraryText.</strong> No field in any chat message admits user-controllable <code>String</code> or variable-length <code>Vec&lt;u8&gt;</code> carrying textual data.</p></blockquote><p>The only string that crosses the wire is <code>sender</code>, and it is validated as a base58 libp2p PeerId or a 64-char hex MSS pubkey. Everything else is a fixed-width byte payload or a bounded enumeration the receiver controls.</p><p>The payoff is that a peer cannot be made to relay arbitrary bytes. A gossip network that accepts free text is a gossip network that can be used to distribute whatever someone wants every node to carry. Here that is not a policy that has to be enforced, it is a shape the wire format cannot express.</p><p>The cardinality is load-bearing too: 256 entries means a <code>u8</code> index can never fall outside the table. And because index 42 must mean the same word on every peer, changing the dictionary is a protocol break. New tokens can only be appended, and only if every node upgrades at once.</p><h4>Attachments are the real payload</h4><p>Each message can carry up to four typed attachments, and this is where the bus earns its name. All but two are a bare 32 bytes:</p><ul><li><p><code>address</code> and <code>coin_id</code>: prove an airdrop or a payment</p></li><li><p><code>mix_id</code>: coordinate a CoinJoin session</p></li><li><p><code>commitment</code> and <code>block_hash</code>: reference a spend or a block</p></li><li><p><code>midstate</code>: debug a consensus fork</p></li><li><p><code>data_hash</code>: reference external data</p></li><li><p><code>license_challenge</code>: a commitment, a height and a salt, for MMR gossip challenges and uptime scoring of pruning licenses</p></li><li><p><code>signature</code>: up to 1536 bytes, for Q-Bolt payment channel gossip</p></li></ul><p>That last one is the interesting one. It allows the ephemeral chat protocol act as a Lightning-style gossip overlay: Layer 2 channel updates ride the same bus as <code>gm</code>.</p><h4>The anti-graffiti check</h4><p><code>is_graffiti()</code> rejects any 32-byte attachment whose bytes happen to be valid UTF-8, on the reasoning that a real hash almost never is and a human trying to smuggle text almost always is.</p><p>The comment is candid that this will misfire on roughly one in four billion legitimate hashes, and that this is an acceptable price. That is how seriously NoArbitraryText is taken: it would rather drop a valid license advertisement than relay one message of graffiti.</p><h4>Practical notes</h4><p><code>textToIndices</code><strong> silently drops anything not in the dictionary.</strong> <code>'gm mate wagmi'</code> works. <code>'good morning friend'</code> returns an empty array, because none of those three words exist in it. Validate before sending if a half-empty message would confuse your users.</p><p><strong>Two wire versions exist.</strong> v1 (<code>Chat</code>) is receive-only on current nodes, which never emit it. v2 adds attachment coverage to the PoW and is domain-separated from v1, so a v1 nonce cannot be replayed as v2.</p><p><code>sendChat</code><strong> versus </strong><code>submitChat</code><strong>.</strong> <code>sendChat</code> asks the node to mine the PoW and broadcast under its own peer id. <code>submitChat</code> carries a nonce you mined yourself with <code>mine_chat_pow_v2_wasm</code>, so the message goes out under a <code>sender</code> you name, which is how a wallet identity originates chat without borrowing the node&#8217;s.</p><p>And yes, the dictionary contains <code>wagmi</code>, <code>ngmi</code>, <code>ser</code>, <code>anon</code>, <code>based</code>, <code>rug</code>, and <code>moon</code>, alongside <code>wots</code>, <code>mss</code>, <code>utxo</code>, and <code>mempool</code>. It was built for the people actually running nodes.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!-yUZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc200fbc3-7b99-43f5-abf0-a66763eac343_500x759.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!-yUZ!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc200fbc3-7b99-43f5-abf0-a66763eac343_500x759.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!-yUZ!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc200fbc3-7b99-43f5-abf0-a66763eac343_500x759.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!-yUZ!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc200fbc3-7b99-43f5-abf0-a66763eac343_500x759.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!-yUZ!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc200fbc3-7b99-43f5-abf0-a66763eac343_500x759.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!-yUZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc200fbc3-7b99-43f5-abf0-a66763eac343_500x759.jpeg" width="500" height="759" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c200fbc3-7b99-43f5-abf0-a66763eac343_500x759.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:759,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:103715,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207912895?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc200fbc3-7b99-43f5-abf0-a66763eac343_500x759.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!-yUZ!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc200fbc3-7b99-43f5-abf0-a66763eac343_500x759.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!-yUZ!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc200fbc3-7b99-43f5-abf0-a66763eac343_500x759.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!-yUZ!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc200fbc3-7b99-43f5-abf0-a66763eac343_500x759.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!-yUZ!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc200fbc3-7b99-43f5-abf0-a66763eac343_500x759.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>Part 12: Launch a token, offline, in one file</h2><p>Time to put it together. This launches a pump.fun-style bonding curve with an unforgeable holder ledger, runs three users through it, and proves the security model by trying to cheat. It touches no network and costs nothing.</p><p>Save as <code>pump-demo.mjs</code> in the project from Part 1, then <code>node pump-demo.mjs</code>.</p><pre><code><code>// pump-demo.mjs: a bonding-curve token launcher, running entirely offline.
import { fileURLToPath } from 'node:url';
import { readFile } from 'node:fs/promises';

const wasm = await import('midstate-sdk/pkg/wasm_wallet.js');
await wasm.default({
  module_or_path: await readFile(
    fileURLToPath(import.meta.resolve('midstate-sdk/pkg/wasm_wallet_bg.wasm')),
  ),
});

const { compile } = await import('midstate-sdk/compiler');
const { execute } = await import('midstate-sdk/vm');
const P = await import('midstate-sdk/pump');

const DEPTH  = 4;          // 16 holder slots. Small is fast. Max is P.MAX_DEPTH (9).
const HEIGHT = 310_000n;   // Comfortably past the state-thread activation height.

// The simulator's CHECKSIG compares strings, so pk === sig "signs" successfully.
// On a real chain these would be a genuine pubkey and a genuine MSS signature.
const USERS = {
  alice: { pk: 'aa'.repeat(32), sig: 'aa'.repeat(32) },
  bob:   { pk: 'bb'.repeat(32), sig: 'bb'.repeat(32) },
  carol: { pk: 'cc'.repeat(32), sig: 'cc'.repeat(32) },
};

// The contract is generated per launch, because tree depth is baked into it.
const compiled = compile(P.pumpContractSource(DEPTH));
const address  = wasm.blake3_hash_hex(compiled.bytecode);

const curve = { ledger: new P.PumpLedger(DEPTH), supply: 0n, reserve: 0n };

console.log('Deployed pump curve');
console.log('  address:', address.slice(0, 32) + '...');
console.log(`  script : ${compiled.sizeBytes}/1024 bytes, ${compiled.sigops} sigops`);
console.log(`  slots  : ${curve.ledger.size} (depth ${DEPTH}, max ${P.MAX_DEPTH})`);

function show(label) {
  const holders = curve.ledger.balances.filter(b =&gt; b &gt; 0n).length;
  console.log(`\n-- ${label} --`);
  console.log(`   supply ${curve.supply}  reserve ${curve.reserve}  holders ${holders}/${curve.ledger.size}`);
  console.log(`   root   ${curve.ledger.root.slice(0, 16)}...`);
}

function trade(user, slot, amount, side) {
  const who = USERS[user];
  try {
    // An empty slot is free for anyone to claim. Stage the owner locally first.
    if (side === 'buy' &amp;&amp; curve.ledger.balances[slot] === 0n) {
      curve.ledger.claim(slot, P.ownerFromPubkey(who.pk));
    }

    // 1. The SDK builds the witness, the Merkle proof and the expected outputs.
    const plan = P.buildTrade({
      ledger: curve.ledger, slot, amount: BigInt(amount), side,
      supply: curve.supply, reserve: curve.reserve,
      pubkey: who.pk, sig: who.sig,
    });

    // 2. Run the REAL contract against that plan before committing anything.
    const res = execute(compiled.asm, {
      witness:     plan.witness,
      inputState:  P.encodePumpState(curve.supply, curve.ledger.root),
      inputValue:  0n,
      thisAddress: address,
      height:      HEIGHT,
      outputs: [
        { address, value: 0n, state: plan.newState },   // state thread, always index 0
        { address, value: Number(plan.newReserve) },    // reserve coin, always index 1
      ],
    });

    if (!res.ok) {
      console.log(`  x ${user} ${side} ${amount}: contract rejected (${res.error})`);
      return;
    }

    // 3. Only now advance local state.
    curve.ledger.owners[slot] = plan.owner;
    curve.ledger.set(slot, plan.newBalance);
    curve.supply  = plan.newSupply;
    curve.reserve = plan.newReserve;
    console.log(`  + ${user} ${side}s ${amount} for ${plan.amountMds} MDS  (${res.steps} VM steps)`);
  } catch (e) {
    console.log(`  x ${user} ${side} ${amount}: SDK rejected (${e.message})`);
  }
}

trade('alice', 0, 5,  'buy');   show('alice buys 5');
trade('bob',   1, 10, 'buy');   show('bob buys 10');
trade('carol', 2, 3,  'buy');   show('carol buys 3');
trade('alice', 0, 2,  'sell');  show('alice sells 2');

console.log('\nNow the things that should fail:');
trade('bob',   1, 999, 'sell');   // more than the slot holds
trade('carol', 1, 1,   'sell');   // carol raiding bob's slot
show('final');</code></code></pre><p>Output:</p><pre><code><code>Deployed pump curve
  address: 1300bdccda1b7d00a1af6b6d999e5fe8...
  script : 666/1024 bytes, 2 sigops
  slots  : 16 (depth 4, max 9)
  + alice buys 5 for 10 MDS  (429 VM steps)

-- alice buys 5 --
   supply 5  reserve 10  holders 1/16
   root   913d7e1f546d969a...
  + bob buys 10 for 95 MDS  (429 VM steps)
...
Now the things that should fail:
  x bob sell 999: SDK rejected (pump: slot holds 10, cannot sell 999)
  x carol sell 1: SDK rejected (pump: pubkey hashes to c38d8bbe1254... but the
                  contract requires 883b0c0354d9... for this spend.)</code></code></pre><h3>What just happened</h3><p><strong>There are no token coins.</strong> Balances live as leaves in a Merkle tree whose root sits in the curve&#8217;s own state. That is not a stylistic choice, it is forced. A script only runs when its own coin is spent, so a token coin and the curve coin can never verify each other&#8217;s deltas. Worse, creating an output at an address does not run that address&#8217;s script, so anyone could fabricate a coin claiming any balance and sell it to drain the reserve. A balance that was never bought has no valid Merkle path, so there is nothing to fabricate.</p><p><strong>The reserve is never stored.</strong> The contract asserts <code>sum_to_addr(this_address()) == (s*s - s) / 2</code>. Since every buy adds exactly the curve cost and every sell removes its exact mirror, the MDS held at the address is always implied by the supply. The state literally cannot lie about money it claims to hold.</p><p><strong>Both failures are caught, for different reasons.</strong> Overselling is arithmetic and the SDK catches it before you spend anything. Carol raiding Bob&#8217;s slot is caught by the signature: the owner field is a <em>commitment</em> to a key, not a password, so knowing it buys you nothing. An earlier version of this contract had the Merkle proof but no signature check, which meant anyone who read a ledger burn could drain the slot it described.</p><p><strong>Depth is a hard ceiling.</strong> Each tree level costs exactly 60 bytes of script. Depth 9 compiles to 966 of the 1024 consensus limit, so depth 10 would be 1026 bytes: two bytes too many. That is why <code>MAX_DEPTH</code> is 9 and 512 holders per launch. It is a per-launch limit, not a global one, since each token is its own contract.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!abva!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc7fb3e-8b65-43ef-924d-2f1d327dd8cc_500x500.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!abva!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc7fb3e-8b65-43ef-924d-2f1d327dd8cc_500x500.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!abva!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc7fb3e-8b65-43ef-924d-2f1d327dd8cc_500x500.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!abva!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc7fb3e-8b65-43ef-924d-2f1d327dd8cc_500x500.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!abva!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc7fb3e-8b65-43ef-924d-2f1d327dd8cc_500x500.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!abva!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc7fb3e-8b65-43ef-924d-2f1d327dd8cc_500x500.jpeg" width="500" height="500" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6bc7fb3e-8b65-43ef-924d-2f1d327dd8cc_500x500.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:79583,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207912895?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc7fb3e-8b65-43ef-924d-2f1d327dd8cc_500x500.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!abva!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc7fb3e-8b65-43ef-924d-2f1d327dd8cc_500x500.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!abva!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc7fb3e-8b65-43ef-924d-2f1d327dd8cc_500x500.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!abva!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc7fb3e-8b65-43ef-924d-2f1d327dd8cc_500x500.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!abva!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc7fb3e-8b65-43ef-924d-2f1d327dd8cc_500x500.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Change <code>DEPTH</code> to 9, add more users, or feed a bad Merkle root in and watch the contract catch it. Nothing here can lose money, which makes it the right place to build intuition before you point any of it at a real node.</p><div><hr></div><h2>Quick reference: things that will save you an afternoon</h2><p><strong>Keys and wallets.</strong> These are the ones that lose money.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{array}{|l|l|}\n\\hline\n\\textbf{Do this} &amp; \\textbf{Because} \\\\\n\\hline\n\\text{Call Wallet.init() first} &amp; \\text{every other error is downstream} \\\\\n\\hline\n\\text{Fresh WOTS address per invoice} &amp; \\text{reuse burns the key and the coins} \\\\\n\\hline\n\\text{Check storage saves MSS trees} &amp; \\text{receive-only address = total loss} \\\\\n\\hline\n\\text{Warn before MSS budget runs out} &amp; \\text{height 10 = 1024 signatures, final} \\\\\n\\hline\n\\text{reconcileMssLeaves() on startup} &amp; \\text{counter may lag another device} \\\\\n\\hline\n\\text{Back up the 24-word phrase} &amp; \\text{it is the only recovery path} \\\\\n\\hline\n\\end{array}&quot;,&quot;id&quot;:&quot;PSFWCBWJQP&quot;}" data-component-name="LatexBlockToDOM"></div><p><strong>Spending, contracts and network.</strong></p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\begin{array}{|l|l|}\n\\hline\n\\textbf{Do this} &amp; \\textbf{Because} \\\\\n\\hline\n\\text{Re-broadcast, never re-sign} &amp; \\text{autoReconcile handles this} \\\\\n\\hline\n\\text{Simulate before funding} &amp; \\text{no recovery from a bad address} \\\\\n\\hline\n\\text{Leave sync pacing alone} &amp; \\text{20 violations = 500s ban} \\\\\n\\hline\n\\text{Design UI for slow sends} &amp; \\text{commit to reveal caps at 20 min} \\\\\n\\hline\n\\text{Subpath imports when offline} &amp; \\text{skips the libp2p dependency tree} \\\\\n\\hline\n\\end{array}&quot;,&quot;id&quot;:&quot;LAQNTPVIOL&quot;}" data-component-name="LatexBlockToDOM"></div><div><hr></div><h2>Where to go next</h2><p>The offline modules are the best playground, because nothing can go wrong:</p><ul><li><p><code>midstate-sdk/compiler</code> and <code>/vm</code>: write a contract, run it, break it</p></li><li><p><code>midstate-sdk/launcher</code>: AMM and bonding-curve math, exact-integer throughout</p></li><li><p><code>midstate-sdk/pump</code>: a pump.fun-style launcher with an unforgeable Merkle holder ledger</p></li><li><p><code>midstate-sdk/dex</code>: on-chain order announcements and limit-order covenants</p></li><li><p><code>midstate-sdk/bincode</code>: the raw P2P wire codec, pure functions over bytes</p></li></ul><p>Part 12 is the fastest way in: change <code>DEPTH</code>, add users, break the ledger on purpose. When the offline behaviour stops surprising you, point the same code at a real node.</p><div><hr></div><p><code>midstate-sdk</code><em> is on npm and licensed under the GPL.</em></p>]]></content:encoded></item><item><title><![CDATA[Midstate]]></title><description><![CDATA[State of Play]]></description><link>https://ciphernom.substack.com/p/midstate-13a</link><guid isPermaLink="false">https://ciphernom.substack.com/p/midstate-13a</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Wed, 22 Jul 2026 17:33:07 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hI2Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Before a coin is real, three things have to be true: the chain has to run, people have to mine it, and it has to trade. Midstate does all three. The chain is live, people mine it (including on a Raspberry Pi), and it&#8217;s listed on SafeTrade, so it trades against real money. </p><p>I did not arrange that listing or apply for it. SafeTrade reached out. They said they liked what Midstate was doing and listed it themselves, describing it publicly as an innovative post-quantum blockchain.<br><br>They expected it to be <strong>hard</strong>. Post-quantum signatures and the two-phase transaction model made it, on paper, one of the more difficult integrations they had taken on, so they started with some precautions; no mining straight to the exchange, no high-frequency deposits or withdrawals. Then they built it, and it went smoother than they thought. Their words, once it was live: it wasn&#8217;t as hard as they initially expected, and it has run smoothly since.</p><p>Most projects never get any of the three, let alone all of them.</p><p>With the basics working, this seems like a good time to write down where the project stands and what comes next, including the parts that aren&#8217;t finished, since that&#8217;s where most of the remaining work is.</p><h2>The Pi axe</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!hI2Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!hI2Q!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!hI2Q!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!hI2Q!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!hI2Q!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!hI2Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg" width="1154" height="2048" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2048,&quot;width&quot;:1154,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:536582,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207915631?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!hI2Q!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!hI2Q!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!hI2Q!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!hI2Q!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe306ccfc-35e6-495a-8b37-04eeb253437f_1154x2048.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>That is a Raspberry Pi 5 mining Midstate. Not a rack. Not a rented GPU. A single board computer in one hand.</p><p>It matters because of the hardware gap. On Midstate the fastest miner is a GPU. A Pi running the 8-way NEON SIMD path does roughly 100 nonces per second. An RTX 4090 farm does tens of thousands. The gap between the hobbyist and the industrial rig is about 1 to 5,000.</p><p>That sounds bad until you compare it to Bitcoin. A hobbyist on a Bitaxe hashes at 500 Gigahashes per second against a 600 Exahash network. That gap is 1 to 1.2 billion. Midstate traps the hardware advantage in the commodity silicon band. A cheap, low-power machine you already own is genuinely in the game. Almost no coin with real hashrate can say that.</p><p>I looked at pushing it further, past GPUs, down to the Pi specifically. I had a design. I built it and I tested it. The honest answer is you cannot make a Pi beat a desktop at hashing. There is no resource a Pi has more of. You can make GPUs less dominant, but every version of that ends up favouring cheap cloud ARM and botnets, which is worse. A botnet of compromised phones is not decentralisation.</p><p>So the proof-of-work stays. It is simple, it verifies against one scalar implementation, and it works. GPUs dominate on purpose: they cost capital, space, and power, which prices out the IoT-refrigerator swarms a CPU coin invites. The Pi axe mines it. 1 to 5,000 is a gap a hobbyist can live with.</p><p>There is also a pool, so a small miner is not stuck mining solo against 1-to-5,000 odds and waiting months for a block. Point a Pi at the pool and it earns steadily, in proportion to the shares it submits.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!Zw-Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ec681f-dfb8-48e8-b0a9-b9c0e11f4b2c_877x929.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!Zw-Z!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ec681f-dfb8-48e8-b0a9-b9c0e11f4b2c_877x929.png 424w, /__u/substackcdn.com/image/fetch/$s_!Zw-Z!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ec681f-dfb8-48e8-b0a9-b9c0e11f4b2c_877x929.png 848w, /__u/substackcdn.com/image/fetch/$s_!Zw-Z!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ec681f-dfb8-48e8-b0a9-b9c0e11f4b2c_877x929.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Zw-Z!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ec681f-dfb8-48e8-b0a9-b9c0e11f4b2c_877x929.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!Zw-Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ec681f-dfb8-48e8-b0a9-b9c0e11f4b2c_877x929.png" width="877" height="929" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/63ec681f-dfb8-48e8-b0a9-b9c0e11f4b2c_877x929.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:929,&quot;width&quot;:877,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:99860,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207915631?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ec681f-dfb8-48e8-b0a9-b9c0e11f4b2c_877x929.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!Zw-Z!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ec681f-dfb8-48e8-b0a9-b9c0e11f4b2c_877x929.png 424w, /__u/substackcdn.com/image/fetch/$s_!Zw-Z!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ec681f-dfb8-48e8-b0a9-b9c0e11f4b2c_877x929.png 848w, /__u/substackcdn.com/image/fetch/$s_!Zw-Z!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ec681f-dfb8-48e8-b0a9-b9c0e11f4b2c_877x929.png 1272w, /__u/substackcdn.com/image/fetch/$s_!Zw-Z!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ec681f-dfb8-48e8-b0a9-b9c0e11f4b2c_877x929.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">bootstrap node pool running at rpc.cypherpunk.gold/pool with 0% fee</figcaption></figure></div><p>The pool is provably fair. Normally a pool miner has to trust the operator to count their shares honestly. This one does not require that. It commits a Merkle tree of every miner&#8217;s score into the coinbase of each block, and a miner can pull a proof from the pool&#8217;s audit API that their exact score was included <em>before</em> they start hashing. If the operator lies or leaves someone out, the miner&#8217;s client sees the mismatch and disconnects. Payouts are proportional and every past split can be re-checked against the commitment it was paid from.</p><p>If you want a Midstate Pi5 Axe, I will sell it to you all set up to mine for 1000gMDS. Ready to run and fully synced.</p><h2>Next: Layer 2</h2><p>The next real work is Q-Bolt, the Layer 2 system. It exists and it works. But there is an honest gap between what it is now and what it needs to be, and this is the section where I say exactly what that gap is.</p><h3>What Q-Bolt is today</h3><p>Q-Bolt is Spilman channels. Two parties fund a 2-of-2 multisig UTXO. One side is the sender, one is the receiver. The sender signs balance states and hands them over; the receiver stores them and signs nothing until the channel closes. Only two transactions ever touch the chain: the open and the close.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!3eiA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdac6fde9-3b3a-4195-9623-de7f37cb6794_2720x1600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!3eiA!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdac6fde9-3b3a-4195-9623-de7f37cb6794_2720x1600.png 424w, /__u/substackcdn.com/image/fetch/$s_!3eiA!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdac6fde9-3b3a-4195-9623-de7f37cb6794_2720x1600.png 848w, /__u/substackcdn.com/image/fetch/$s_!3eiA!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdac6fde9-3b3a-4195-9623-de7f37cb6794_2720x1600.png 1272w, /__u/substackcdn.com/image/fetch/$s_!3eiA!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdac6fde9-3b3a-4195-9623-de7f37cb6794_2720x1600.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!3eiA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdac6fde9-3b3a-4195-9623-de7f37cb6794_2720x1600.png" width="1456" height="856" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dac6fde9-3b3a-4195-9623-de7f37cb6794_2720x1600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:856,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:226498,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207915631?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdac6fde9-3b3a-4195-9623-de7f37cb6794_2720x1600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!3eiA!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdac6fde9-3b3a-4195-9623-de7f37cb6794_2720x1600.png 424w, /__u/substackcdn.com/image/fetch/$s_!3eiA!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdac6fde9-3b3a-4195-9623-de7f37cb6794_2720x1600.png 848w, /__u/substackcdn.com/image/fetch/$s_!3eiA!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdac6fde9-3b3a-4195-9623-de7f37cb6794_2720x1600.png 1272w, /__u/substackcdn.com/image/fetch/$s_!3eiA!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdac6fde9-3b3a-4195-9623-de7f37cb6794_2720x1600.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This design is deliberately simple, and it buys a strong safety property for free. The sender never holds the receiver&#8217;s signature, so the sender cannot broadcast any balance state at all. Their only unilateral exit is a time-locked refund after the channel expires. The receiver&#8217;s balance can only ratchet up: an old state pays them less, and they just reject it. So there is no need for revocation, no penalty transactions, no &#8220;punish the cheater&#8221; machinery. The attack those mechanisms defend against is structurally impossible here, because the money only flows one way.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!kXOB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd891b8b9-6ad8-4f28-a7a9-e03a275b666e_1923x746.png" data-component-name="Image2ToDOM"><div class="image2-inset image2-full-screen"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!kXOB!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd891b8b9-6ad8-4f28-a7a9-e03a275b666e_1923x746.png 424w, /__u/substackcdn.com/image/fetch/$s_!kXOB!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd891b8b9-6ad8-4f28-a7a9-e03a275b666e_1923x746.png 848w, /__u/substackcdn.com/image/fetch/$s_!kXOB!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd891b8b9-6ad8-4f28-a7a9-e03a275b666e_1923x746.png 1272w, /__u/substackcdn.com/image/fetch/$s_!kXOB!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd891b8b9-6ad8-4f28-a7a9-e03a275b666e_1923x746.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!kXOB!,w_5760,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd891b8b9-6ad8-4f28-a7a9-e03a275b666e_1923x746.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d891b8b9-6ad8-4f28-a7a9-e03a275b666e_1923x746.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;full&quot;,&quot;height&quot;:565,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:181843,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207915631?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd891b8b9-6ad8-4f28-a7a9-e03a275b666e_1923x746.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-fullscreen" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!kXOB!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd891b8b9-6ad8-4f28-a7a9-e03a275b666e_1923x746.png 424w, /__u/substackcdn.com/image/fetch/$s_!kXOB!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd891b8b9-6ad8-4f28-a7a9-e03a275b666e_1923x746.png 848w, /__u/substackcdn.com/image/fetch/$s_!kXOB!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd891b8b9-6ad8-4f28-a7a9-e03a275b666e_1923x746.png 1272w, /__u/substackcdn.com/image/fetch/$s_!kXOB!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd891b8b9-6ad8-4f28-a7a9-e03a275b666e_1923x746.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><em>Spotted on the bootstrap explorer (rpc.cypherpunk.gold) A Q-Bolt channel closing cooperatively &#8212; both parties sign, the funding UTXO settles in one transaction.</em></figcaption></figure></div><p>The routing, HTLCs, and swaps are already built on top of this. Payments cross multiple channels locked by a single preimage. Hubs forward for a flat 50 sats, which is what their two one-time keys cost them. Covenant HTLCs claim with no signature at all &#8212; the script forces the coin to the right place, so the redeemer only reveals the preimage. On a chain where every signature is a 576-byte one-time key, a claim path that spends zero keys is worth having. There is even just-in-time channel opening, so a hub can pay a destination it has no channel to yet.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!7goz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf21281-c46e-46a1-9258-f2abdaa11447_2720x1200.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!7goz!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf21281-c46e-46a1-9258-f2abdaa11447_2720x1200.png 424w, /__u/substackcdn.com/image/fetch/$s_!7goz!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf21281-c46e-46a1-9258-f2abdaa11447_2720x1200.png 848w, /__u/substackcdn.com/image/fetch/$s_!7goz!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf21281-c46e-46a1-9258-f2abdaa11447_2720x1200.png 1272w, /__u/substackcdn.com/image/fetch/$s_!7goz!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf21281-c46e-46a1-9258-f2abdaa11447_2720x1200.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!7goz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf21281-c46e-46a1-9258-f2abdaa11447_2720x1200.png" width="1456" height="642" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6cf21281-c46e-46a1-9258-f2abdaa11447_2720x1200.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:642,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:195696,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207915631?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf21281-c46e-46a1-9258-f2abdaa11447_2720x1200.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!7goz!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf21281-c46e-46a1-9258-f2abdaa11447_2720x1200.png 424w, /__u/substackcdn.com/image/fetch/$s_!7goz!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf21281-c46e-46a1-9258-f2abdaa11447_2720x1200.png 848w, /__u/substackcdn.com/image/fetch/$s_!7goz!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf21281-c46e-46a1-9258-f2abdaa11447_2720x1200.png 1272w, /__u/substackcdn.com/image/fetch/$s_!7goz!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cf21281-c46e-46a1-9258-f2abdaa11447_2720x1200.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h3>A worked example: the cross-chain DEX</h3><p>The clearest way to see why Layer 2 matters is the cross-chain DEX, which is live and works today, on-chain, both directions but is currently hidden in the wallet.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!jVKJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2be52dd-bc29-4951-8fe4-131f3a85a503_2720x1880.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!jVKJ!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2be52dd-bc29-4951-8fe4-131f3a85a503_2720x1880.png 424w, /__u/substackcdn.com/image/fetch/$s_!jVKJ!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2be52dd-bc29-4951-8fe4-131f3a85a503_2720x1880.png 848w, /__u/substackcdn.com/image/fetch/$s_!jVKJ!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2be52dd-bc29-4951-8fe4-131f3a85a503_2720x1880.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jVKJ!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2be52dd-bc29-4951-8fe4-131f3a85a503_2720x1880.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!jVKJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2be52dd-bc29-4951-8fe4-131f3a85a503_2720x1880.png" width="1456" height="1006" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d2be52dd-bc29-4951-8fe4-131f3a85a503_2720x1880.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1006,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:285621,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207915631?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2be52dd-bc29-4951-8fe4-131f3a85a503_2720x1880.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!jVKJ!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2be52dd-bc29-4951-8fe4-131f3a85a503_2720x1880.png 424w, /__u/substackcdn.com/image/fetch/$s_!jVKJ!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2be52dd-bc29-4951-8fe4-131f3a85a503_2720x1880.png 848w, /__u/substackcdn.com/image/fetch/$s_!jVKJ!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2be52dd-bc29-4951-8fe4-131f3a85a503_2720x1880.png 1272w, /__u/substackcdn.com/image/fetch/$s_!jVKJ!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd2be52dd-bc29-4951-8fe4-131f3a85a503_2720x1880.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Say you are selling MDS for ETH on Base. Under the hood it is a hash-time-locked swap:</p><ol><li><p>You lock your MDS in a covenant on Midstate. The lock has a hashlock &#8212; H = BLAKE3(secret) &#8212; and an absolute refund height. Only someone with the secret can claim it before that height; after it, you get it back.</p></li><li><p>The buyer sees your lock, verifies it, and locks their ETH in the swap contract on Base with the same H and a shorter refund delay.</p></li><li><p>You claim the ETH by revealing the secret on Base. The contract publishes it.</p></li><li><p>The buyer reads the secret from Base and uses it to claim your MDS on Midstate.</p></li></ol><p>Nobody can be cheated. Either both legs complete or both refund. The whole thing is trustless and needs no intermediary.</p><p>It is worth heading off the obvious worry: doesn't publishing the secret let anyone steal the coins? No, and the reason is the whole trick of the design. The secret is not a key to the money &#8212; it is one of two conditions on each lock. The other condition is a fixed recipient, baked in when the lock was made: the MDS lock pays the buyer, the ETH lock pays you, and that is true no matter who reveals the secret. So the secret only lets someone trigger a payment that was already addressed to someone else. If a bot reads the secret off Base and races to claim first, all it does is pay gas to send you your own ETH. Revealing the secret is not a leak; it is how the swap settles.</p><p>But look at where the time goes. Every leg is an on-chain Midstate transaction, and a Midstate transaction is two phases &#8212; commit then reveal &#8212; separated by block confirmations, at roughly one block a minute. Locking the covenant confirms on-chain. Claiming it confirms on-chain. A single swap can take many minutes end to end, and every partial fill is another round of the same. It is correct, but it is slow, and slow kills a DEX.</p><p>This is exactly the problem Layer 2 solves, and here is the part worth being precise about: the fix is already partly built. The hashlock in that swap is the same primitive Q-Bolt uses for routing. A submarine swap is the bridge &#8212; it links the on-chain HTLC to an off-chain channel payment under one preimage, so the Midstate leg settles instantly in a channel while the ETH leg settles on Base, and the same secret unlocks both. Flip the MDS side from an on-chain covenant to a channel HTLC and the lock-and-claim &#8212; minutes of block confirmations &#8212; collapses into an instant channel update.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!EP3L!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcde43720-d637-4c8f-b760-7e9493132e55_2720x1360.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!EP3L!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcde43720-d637-4c8f-b760-7e9493132e55_2720x1360.png 424w, /__u/substackcdn.com/image/fetch/$s_!EP3L!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcde43720-d637-4c8f-b760-7e9493132e55_2720x1360.png 848w, /__u/substackcdn.com/image/fetch/$s_!EP3L!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcde43720-d637-4c8f-b760-7e9493132e55_2720x1360.png 1272w, /__u/substackcdn.com/image/fetch/$s_!EP3L!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcde43720-d637-4c8f-b760-7e9493132e55_2720x1360.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!EP3L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcde43720-d637-4c8f-b760-7e9493132e55_2720x1360.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cde43720-d637-4c8f-b760-7e9493132e55_2720x1360.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:274267,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207915631?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcde43720-d637-4c8f-b760-7e9493132e55_2720x1360.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!EP3L!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcde43720-d637-4c8f-b760-7e9493132e55_2720x1360.png 424w, /__u/substackcdn.com/image/fetch/$s_!EP3L!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcde43720-d637-4c8f-b760-7e9493132e55_2720x1360.png 848w, /__u/substackcdn.com/image/fetch/$s_!EP3L!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcde43720-d637-4c8f-b760-7e9493132e55_2720x1360.png 1272w, /__u/substackcdn.com/image/fetch/$s_!EP3L!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcde43720-d637-4c8f-b760-7e9493132e55_2720x1360.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>That submarine path exists in Q-Bolt today. When a taker locks their ETH, the maker&#8217;s node can intercept and add the matching HTLC to a</p><p>n open channel instead of going on-chain. Both sides of that plumbing are written. Two things stop it being the everyday experience. First, it is currently disabled in the interface &#8212; the DEX defaults to the slower on-chain settlement while the fast path is finished and tested. Second, and more fundamentally, it only works when a channel already happens to exist in the right direction with enough balance. Because today&#8217;s channels are one-directional and disposable, that channel often is not there, and the swap falls back on-chain.</p><p>So the DEX is not blocked on inventing Layer 2. It is blocked on finishing it: turning the submarine path on, making it the default, and making channels persistent and routable enough that the fast path is available every time instead of only when liquidity was pre-positioned. That is the shape of the whole plan. Anything slow because it waits for Midstate blocks &#8212; DEX fills, token trades, ordinary payments &#8212; gets fast the moment it settles in a channel, and the machinery to do it is already partly in the code.</p><h3>What it needs to become</h3><p>The end goal is the only thing that matters here: instant transactions, high throughput, low fees. A real Layer 2. Whether the channels end up one-directional, bidirectional, or something else is an implementation detail I will solve in code. The target is fixed; the shape is not.</p><p>Q-Bolt has the hard parts already &#8212; funded channels, HTLCs, routing across hubs, swaps &#8212; and they work. What is left is turning that from a set of working parts into a network that moves payments instantly and cheaply at scale. That is engineering, not research: it needs no new cryptographic assumption and no script feature the chain does not already have. The primitives are in the VM. The work is making them into a payment network.</p><p>Alongside the channel work, three supporting pieces:</p><ul><li><p><strong>Watchtowers</strong>, so your channels are safe while you are offline. Midstate already has a gossip layer and peer reputation to build them on.</p></li><li><p><strong>Refill and splicing</strong>, so a drained channel is topped up instead of closed and reopened on-chain.</p></li><li><p><strong>Pathfinding and invoices</strong>, so payments route across many hubs with liquidity awareness.</p></li></ul><p>The measure of success is simple. A payment confirms instantly, costs almost nothing, and the network can carry a lot of them at once. Everything in this section is in service of that and nothing else.</p><h3>Then, on top of it</h3><p>Once the channel layer is a real network, the rest follows:</p><ul><li><p>Submarine swaps. Move value between Layer 2 and the main chain trustlessly, in either direction, unlocked by one preimage on both sides so there is no cross-chain theft.</p></li><li><p>The DEX, brought back on top of those swaps.</p></li><li><p>A token on-chain. Not because the world needs another memecoin, but because it proves the chain carries tokens other than MDS.</p></li><li><p>A Uniswap-style AMM, so those tokens trade against MDS.</p></li></ul><p>All of it works on the main chain today. It is slow. On Layer 2 it is instant. That is the whole reason for doing it there. But the instant part is real only once the channels are bidirectional and the network can route. That is the work.</p><h2>A GUI wallet</h2><p>Right now there are two ways to hold Midstate: the command-line wallet, and the browser wallet. The CLI is for people who live in a terminal. The browser wallet is genuinely a light node &#8212; it scans the chain with compact block filters over WebRTC, verifies what it finds, and never trusts a server to tell it its own balance. But it is a browser tab.</p><p>What is missing is a desktop application. A GUI full-node wallet for Windows and macOS that a normal person can download, run, and understand. Send, receive, channels, history, backup &#8212; without a command line and without a browser.</p><p>The harder, better version has mining built in. The node already has an 8-way NEON SIMD miner and a GPU miner that treats the graphics card as an untrusted oracle and re-verifies every chain on the CPU before broadcasting. Wrapping that in a desktop wallet means one download that syncs, holds your coins, and mines them. That is the thing that makes a Pi axe or a desktop a first-class citizen instead of a config file.</p><p>It is not a small job. It is a large amount of non-core code to write and, worse, to support. Support is the part people underestimate. It needs more hands than mine.</p><p>So there is a bounty: 1000 gMDS (1,073,741,824,000 MDS or 1000 block rewards) for a working GUI full-node wallet, Windows and macOS. Wallet first; mining can follow. If that is a thing you would build, say so. Judged by me and the community. I&#8217;m working something up in the meantime to be part of the Core codebase - as moving to layer2 natively is one of the next challenges that would be more user friendly in a GUI vs the CLI.</p><h2>The actual problem</h2><p>Here is the honest part.</p><p>People use Midstate. They mine it, swap it, trade it. Almost nobody builds on it.</p><p>That is what holds the project back. Not the protocol. The protocol is further along than the community realises. What is missing is other people making things: contracts, tokens, tools, apps. Right now that is mostly one socially awkward person, and one person is not a development community.</p><p>I want to fix that directly, and the first piece is already live.</p><p>There is an IDE at <a href="https://midstate.cash/ide">https://midstate.cash/ide</a>. You do not hand-write stack opcodes. It has a real language built for Midstate &#8212; <code>let</code> and <code>var</code>, <code>if</code>, <code>repeat</code>, <code>switch</code>, user-defined <code>macro</code>s, named <code>struct</code> and <code>state</code> field layouts so you address a coin&#8217;s committed state by name instead of slicing bytes, and the usual infix operators. It ships with a standard library of the primitives covenants actually need: <code>require_signed_by</code>, <code>require_timelock</code>, <code>require_funds_transferred</code>, Merkle-proof verification. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!WPK6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2b84aef-5bfa-481a-b681-6913bdb2f466_1913x929.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!WPK6!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2b84aef-5bfa-481a-b681-6913bdb2f466_1913x929.png 424w, /__u/substackcdn.com/image/fetch/$s_!WPK6!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2b84aef-5bfa-481a-b681-6913bdb2f466_1913x929.png 848w, /__u/substackcdn.com/image/fetch/$s_!WPK6!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2b84aef-5bfa-481a-b681-6913bdb2f466_1913x929.png 1272w, /__u/substackcdn.com/image/fetch/$s_!WPK6!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2b84aef-5bfa-481a-b681-6913bdb2f466_1913x929.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!WPK6!,w_2400,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2b84aef-5bfa-481a-b681-6913bdb2f466_1913x929.png" width="1200" height="582.6923076923077" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c2b84aef-5bfa-481a-b681-6913bdb2f466_1913x929.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;large&quot;,&quot;height&quot;:707,&quot;width&quot;:1456,&quot;resizeWidth&quot;:1200,&quot;bytes&quot;:163868,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://ciphernom.substack.com/i/207915631?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2b84aef-5bfa-481a-b681-6913bdb2f466_1913x929.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-large" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!WPK6!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2b84aef-5bfa-481a-b681-6913bdb2f466_1913x929.png 424w, /__u/substackcdn.com/image/fetch/$s_!WPK6!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2b84aef-5bfa-481a-b681-6913bdb2f466_1913x929.png 848w, /__u/substackcdn.com/image/fetch/$s_!WPK6!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2b84aef-5bfa-481a-b681-6913bdb2f466_1913x929.png 1272w, /__u/substackcdn.com/image/fetch/$s_!WPK6!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2b84aef-5bfa-481a-b681-6913bdb2f466_1913x929.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>That compiles down to the low-level script the VM runs, you can still drop to raw opcodes anywhere you want, and the debugger steps through the compiled bytecode against a live stack so you watch exactly what your code does. There are HTLC and covenant templates to start from, an emulator where you set the block height and inputs, and wallet connect, so you can go from a blank editor to a deployed script without leaving the page. A novel script language is hard to start cold. This removes most of that.</p><p><strong>On top of the IDE:</strong></p><ul><li><p><strong>The 1000 gMDS GUI wallet bounty above.</strong></p></li><li><p><strong>Competitions, ideally run on-chain themselves.</strong> The prize money does not need to sit in my wallet on trust. For a bounty with an objective test &#8212; a contract that has to satisfy a given spec, pass a given input, or unlock a test coin &#8212; a covenant can escrow the prize and release it automatically to whoever first meets the condition. No judge, no trust. For a judged competition, where "best" is a human call, the same escrow releases on a governance vote instead. Either way the funds are locked on-chain and the rules are visible, which is itself the kind of contract the competition is asking people to write.</p></li><li><p><strong>A foundation &#8212; possibly a DAO written in Midstate script.</strong> Midstate covenants are stateful: a script reads the state committed on the coin it spends and the state on the coin it creates, and enforces the relation between them, so state threads forward from one transaction to the next. That is enough for a real on-chain state machine &#8212; a running vote tally, a staking pool, a treasury &#8212; not just a one-shot check. It is not hypothetical: the IDE ships a staking-and-governance contract that compiles to bytecode today and enforces exactly this state continuity, with named state fields, stake-weighted voting, thresholds, and enforced treasury payments. It stays within a deliberately non-Turing-complete VM &#8212; a stateful treasury with token-weighted rules, not arbitrary contract logic &#8212; and it would be the project governing itself on its own chain, which is the strongest demonstration there is that Midstate carries real applications, not just MDS.</p></li><li><p><strong>There is a JavaScript SDK on npm, but it is behind the protocol</strong>: it does not handle reorgs, misses consolidate outputs, and its Layer 2 support is a stub. Updating it is exactly the kind of contribution the project needs.</p></li></ul><p>The chain works, it trades, and it is cheap to experiment on. If Midstate grows, it grows because more people build on it than just me. That is not a complaint. It is the one thing I cannot do alone.</p><h2>Near term</h2><p>Over the next few days I will write something longer and put a proper roadmap on the site.</p><p>Short version: finish Layer 2, bring back the DEX on submarine swaps, add tokens and an AMM, a GUI wallet probably by bounty, and push hard on getting people building instead of only using.</p><p>The hard parts are done. The rest is a question of hands.</p><p><a href="https://midstate.cash">midstate.cash </a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Midstate]]></title><description><![CDATA[Post-Quantum Consensus, Sequential(ish) PoW, and Economic Realism]]></description><link>https://ciphernom.substack.com/p/midstate</link><guid isPermaLink="false">https://ciphernom.substack.com/p/midstate</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Wed, 08 Jul 2026 10:40:13 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6WaT!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a7aa0e0-ee13-41eb-8b11-53c5a8fa2e06_849x849.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Building a blockchain is an exercise in applied pessimism. If you assume miners are altruistic, your chain will halt. If you assume developers can write bug-free smart contracts, your users will be drained. If you assume Moore&#8217;s Law will outpace state bloat, your network will centralise into three data centres.</p><p>I wrote Midstate to solve specific, tangible failures in current UTXO-based protocols. The design abandons several industry darlings:</p><ul><li><p>Turing-complete scripting,</p></li><li><p>ECDSA, memory-hard PoW, and</p></li><li><p>arbitrary data payloads.</p></li></ul><p>Instead, we opted in favour of simplicity:</p><ul><li><p>rigid state machines,</p></li><li><p>single-primitive post-quantum cryptography, and</p></li><li><p>thermodynamic limits.</p></li></ul><p>Here is exactly how Midstate works, why the code is written the way it is, and the game theory holding it together.</p><h3>WOTS, MSS, and Enforced One-Time Use</h3><p>ECDSA and Schnorr are dead to Shor&#8217;s algorithm. Hash-based cryptography is the only defense that avoids unproven lattice assumptions. Midstate uses Winternitz One-Time Signatures (WOTS) and the Merkle Signature Scheme (MSS). We use w=16. A signature is 18 BLAKE3 hash chains. It takes 576 bytes. It is extremely fast to verify.</p><p>The fatal flaw of WOTS is key reuse. Reusing a private key exposes overlapping preimages and allows instant forgery. Wallet warnings are useless. Users will ignore them and lose their funds.</p><p>Midstate enforces one-time use at consensus. The V4 hard fork introduced burned_wots. This is a dedicated Sparse Merkle Tree tracking every spent key. The root of this burn tree is mathematically bound into the block&#8217;s state_root. If an address has ever been spent, the network physically cannot converge on a state root that allows it to be spent again.</p><p>To make this usable, wallet::select_coins uses deterministic snowball grouping. If you receive five UTXOs to the same address and try to spend one, the wallet forces you to spend all five. One signature. One commitment. Key reuse is structurally impossible.</p><h3>Mining: The Physical Impossibility of a BLAKE3 ASIC</h3><p>Memory-hard algorithms like RandomX try to stop ASICs by tying hashing to RAM bandwidth. They fail. They just hand network consensus over to botnets.</p><p>Midstate uses thermodynamic limits. The PoW requires exactly 1,000,000 sequential BLAKE3 compressions per nonce:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;cfab107d-844a-4df9-89cb-970195a257fd&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">x = hash_concat(midstate, nonce);
for _ in 0..1_000_000 {
  x = hash(x);
}</code></pre></div><p>This is a strict dependency chain. Iteration 2 requires the output of iteration 1. You cannot parallelize a single chain. To build an ASIC that beats a CPU on one nonce, you must unroll the loop in silicon. That requires 1,000,000 ALUs in sequence. The required die area is so massive that signal propagation latency hits the speed of light limit. An ASIC for this is physically impossible.</p><p>GPUs dominate Midstate mining. This is intentional. A CPU core finishes a single chain faster, but a modern GPU can grind 24,000 independent nonces concurrently. If you build a CPU-only coin, compromised IoT refrigerators take over. GPUs require capital, physical space, and power. They price out the botnets.</p><p>The hardware gap is strictly bounded. A Raspberry Pi running our 8-way NEON SIMD path calculates roughly 100 nonces per second. A dedicated RTX 4090 farm calculates tens of thousands. The gap between a hobbyist node and an industrial rig is roughly 1 to 5,000.</p><p>Compare this to Bitcoin. A hobbyist running a dedicated ASIC Bitaxe hashes at 500 Gigahashes per second against a 600 Exahash network. The gap is 1 to 1.2 billion. Midstate permanently traps the hardware advantage in the commodity silicon band.</p><p>Running a million-step loop on a GPU introduces a practical problem. The OS watchdog timer assumes the graphics card is frozen and brutally kills the process. We solve this in core/gpu_mining.rs with micro-dispatch checkpointing. The GPU allocates a VRAM buffer, runs 2,000 steps, saves the chaining state, and yields to the host. The OS stays responsive. The node can instantly abort the batch if a new block arrives.</p><p>GPU drivers are usually untrustworthy garbage. They apply aggressive, undocumented compiler optimizations that break cryptographic math. If a shader hallucinates a hash, your node broadcasts an invalid block and forks itself off the network.</p><p>To account for this, in the canonical implementation of the GPU miner, we treat the GPU as an untrusted oracle. It is only permitted to surface candidate nonces. The CPU ruthlessly re-verifies every 1,000,000-iteration chain using the canonical scalar implementation before broadcasting anything.</p><h3>The Commit-Reveal-Consolidate Protocol</h3><p>Mempool front-running and CPFP pinning attacks are structural failures. Midstate prevents them by making unconfirmed transaction chaining impossible.</p><p>Transactions take two phases. First is the Commit. This binds inputs, outputs, and a salt to a hash. It requires Proof-of-Work but pays zero fees. Second is the Reveal. This opens the commitment, provides the signatures, and pays the fee. You cannot chain unconfirmed transactions because the output UTXO does not exist until the Reveal is mined.</p><p>Commits require PoW to prevent spam. Originally, attackers could pre-compute valid nonces months in advance. The V3 hard fork fixed this. The hashing algorithm is now BLAKE3(anchor_hash || commitment || actual_nonce). The miner must pull a recent block hash from the chain&#8217;s Merkle Mountain Range. The PoW is temporally anchored. You cannot hoard commits. The work decays.</p><p>WOTS signatures are huge. Sweeping 1,000 dust UTXOs would require 576 kilobytes of signatures. We added Transaction::Consolidate to fix this. It takes N inputs sharing the same address and validates them against a single signature.</p><p>Finally, there is the Free-Rider problem. Commits pay no fees. If miners ignore them, the network halts. Starting at COMMIT_WEIGHT_ACTIVATION_HEIGHT, every Commit included in a block adds exactly 16,777,216 base work to the block&#8217;s total depth. If two miners find a block at the same height, the block with more Commits is mathematically heavier. It wins the tie-breaker. Miners are economically forced to pack their blocks with Commits to minimise their orphan rate.</p><h3>Storage: Inode Exhaustion and the SMT</h3><p>Writing one flat file per block bricks embedded nodes. At one block per minute, you generate 525,000 files a year. An ext4 filesystem on a Raspberry Pi SD card will suffer Inode Exhaustion in 18 months. The disk will report it is full even with 100GB of free space.</p><p>Midstate stores the entire chain in a single Redb database. Redb uses Copy-On-Write B-Trees. We get ACID compliance and eliminate brittle temporary file renaming during chain reorgs.</p><p>The UTXO set is a Sparse Merkle Tree with a depth of 256. A naive SMT stores every interior node and blows up RAM. We cache the top 16 levels and bucket the bottom 240 levels on the fly. RAM usage is strictly bounded. A billion UTXOs never exceeds 131,071 cache entries.</p><p>If your node OOMs a Raspberry Pi Zero, your code is broken. We explicitly bound the sync prefetch buffer to 64 MiB.</p><h3>Bayesian P2P Reputation and Eclipse Defenses</h3><p>P2P networks are dark forests. You cannot trust any peer.</p><p>Midstate tracks peer reputation using a Beta distribution. Every peer starts with a uniform prior. Valid transactions or blocks increment alpha. Invalid PoW, bad signatures, or timeouts add a massive penalty to beta.</p><p>The Expected Value of the peer is alpha divided by alpha plus beta. This dictates their dynamic rate limit. An honest peer gets up to 500 requests per minute. If a peer&#8217;s EV drops below 10 percent, their rate limit hits the floor or they are purged from the routing table entirely.</p><p>To prevent Eclipse attacks, we extract the IPv4 or IPv6 subnet from inbound connections. We strictly cap the number of peers allowed per subnet. Rotating Peer IDs does not save an attacker. They have to burn real IP space.</p><h3>WebRTC and Browser Hostility</h3><p>Serving browser wallets directly requires WebRTC. Browsers are hostile environments. If you expose a public listener, you must assume every incoming connection is a reverse-Slowloris attack attempting to exhaust your file descriptors.</p><p>Midstate isolates light clients into a strict stream multiplexer. We hard-cap WebRTC peers at 500. If a client stalls while reading a response, we do not wait. A strict 5-second timeout severs the connection and frees the socket.</p><p>Nodes running behind reverse proxies are vulnerable to spoofed IP headers. Attackers inject fake X-Forwarded-For headers to bypass LAN-only firewalls and access internal hardware endpoints. Midstate parses the entire proxy chain. If a single public IP appears anywhere in the chain, the request is physically blocked.</p><h3>Cap-and-Trade Pruning Licenses</h3><p>Nobody stores historical blocks for free. Altruism is not an economic model.</p><p>Midstate uses Pruning Licenses. These are Confidential UTXOs. To mint one, you perform Proof-of-Archival-Work. You salt historical block payloads with your Issuer ID and grind nonces to build a Merkle root of the proofs.</p><p>Licenses trade on-chain. We abandoned percentage-based royalties because users trivially evade them via out-of-band settlement. Instead, the covenant enforces a Fixed Transfer Tax. On transfer, the script evaluates OP_THIS_ADDRESS 0 OP_OUTPUT_ADDRESS OP_EQUALVERIFY to force the license to remain in the covenant. It then evaluates &lt;issuer&gt; OP_SUM_TO_ADDR &lt;fixed_fee&gt; OP_GREATER_OR_EQUAL. The UTXO physically cannot move unless the exact fee is routed to the creator.</p><p>Archivers are audited via MMR Gossip Challenges. Nodes ping Archivers over the chat layer with a block height and a salt. The Archiver responds with BLAKE3(salt || block_payload). We do not grant reputation immediately. That allows lazy Archivers to reply with random bytes. We store the response. When the challenging node eventually syncs that block, it validates the hash cryptographically. Only then is reputation granted or slashed.</p><h3>Chat: The No Arbitrary Text Rule</h3><p>If you allow variable-length strings in P2P messages, your chain will eventually host illegal content, malware payloads, and base64-encoded garbage.</p><p>Midstate&#8217;s chat is restricted to a hardcoded 256-word dictionary. A message&#8217;s words array is just a Vec&lt;u8&gt;. Index 42 is the word send. Index 103 is the word in. You literally cannot transmit arbitrary text.</p><p>For passing data, we use fixed-shape attachments. Addresses and CoinIDs are strictly validated as 32-byte arrays. If an attachment&#8217;s payload deserializes as valid UTF-8, it is flagged as graffiti and the node drops it.</p><p>Chat messages require V2 PoW. V2 domain-separates from V1 by injecting a 4-byte attachment count. This enforces that a peer cannot strip or reorder your attachments while gossiping your message, because doing so invalidates your PoW.</p><h3><strong>Conclusion</strong></h3><p>Midstate set out to fix a short list of concrete failures, and most of those fixes hold. </p><ul><li><p>The entire system is reliant on a single quantum safe primitive: BLAKE3</p><ul><li><p>Key reuse is prevented by consensus, not by wallet warnings. </p></li></ul></li><li><p>Front-running and pinning are structurally impossible, because you cannot chain a UTXO that does not exist yet. </p></li><li><p>The proof-of-work traps mining hardware in the commodity band instead of pretending ASICs won&#8217;t be built. And </p></li><li><p>a full node runs for years on a Raspberry Pi without exhausting its RAM, its inodes, or its SD card. </p></li></ul><p>None of that required a virtual machine, a new cryptographic assumption, or trusting anyone.</p><p><strong>It was not free</strong>. </p><p><em>Honest accounting:</em></p><ul><li><p>Post-quantum signatures are heavy and stateful. Every spend carries 576 bytes of signature, and one-time keys push complexity into the wallet. Snowball grouping means you spend every coin at an address or none of them, and a wallet restored from a stale backup is a footgun the protocol can only partially protect you from.</p></li><li><p>Commit-reveal doubles the moving parts. Two phases, two mempool queues, and timeout windows where funds sit in limbo. The state machine is simple. Operating it is not.</p></li><li><p>Verification has a floor. A Bitcoin node checks a block&#8217;s proof with one hash. A Midstate node must replay the winning nonce&#8217;s entire million-step chain, because a sequential construction has no shortcut: that is the whole point of it. The mining-to-verification ratio is unchanged: a block takes millions of chains to find and one to check. But the absolute cost of that one check moved from nanoseconds to roughly a tenth of a second of serial compute, and no hardware buys you out of it. </p></li><li><p>A single chain runs no faster on an RTX 4090 than on a phone core. Multiply by history: at the Pi&#8217;s own hundred chains per second, a year of one-minute blocks is about ninety minutes of pure proof-replay during initial sync, assuming chains for different blocks are verified in parallel batches. Pools pay the same tax on every share a miner submits. The sequentiality that makes the ASIC impossible cuts both ways. Nobody skips the loop, including the honest.</p></li><li><p>The protocol is young and has already needed surgery. V3 anchored commit PoW because hoarding was possible. V4 added the burn tree because wallet-level discipline wasn&#8217;t enough. </p></li><li><p>There is one implementation, written mostly by one socially awkward  person. More oversights are in there. They just haven&#8217;t surfaced yet.</p></li><li><p>And the economics assume a scale that doesn&#8217;t exist yet. While the network is small, rented GPU hashrate could out-mine it. The incentive design shapes behaviour at a size Midstate hasn&#8217;t reached, and the pruning-license market is designed, deployed, and essentially <em>untested</em>.</p></li></ul><p>The successes and the flaws come from the same decision: keep every mechanism small enough to prove what it does. Heavier signatures bought quantum safety. Slower transactions bought a mempool that can&#8217;t be gamed. Expensive verification bought mining that stays on commodity hardware. </p><p>Those are the terms. </p><p>Well, at least they&#8217;re written down now.</p><p><a href="http://github.com/ciphernom/midstate">github.com/ciphernom/midstate</a></p><p></p>]]></content:encoded></item><item><title><![CDATA[The pluriƀit Experiment]]></title><description><![CDATA[Can an individual vibe-code an entire privacy coin from scratch?]]></description><link>https://ciphernom.substack.com/p/the-pluribit-experiment</link><guid isPermaLink="false">https://ciphernom.substack.com/p/the-pluribit-experiment</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Mon, 20 Oct 2025 05:41:23 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!2E2b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52788a48-450c-4550-9531-663d4e08e6c2_512x384.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[
      <p>
          <a href="/__u/ciphernom.substack.com/p/the-pluribit-experiment">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[AGI Development Under Byzantine "MAD+1" Dynamics: Formal Impossibility Results for Safe Coordination]]></title><description><![CDATA[On the Mathematics of Prometheus]]></description><link>https://ciphernom.substack.com/p/agi-development-under-byzantine-mad1</link><guid isPermaLink="false">https://ciphernom.substack.com/p/agi-development-under-byzantine-mad1</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Thu, 13 Feb 2025 17:33:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa22b2259-63df-4d91-a509-ef8d7055333b_940x945.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!lAkG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adfd73a-90e2-4463-aad3-952e7cbb158e_3200x1200.png" data-component-name="Image2ToDOM"><div class="image2-inset image2-full-screen"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!lAkG!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adfd73a-90e2-4463-aad3-952e7cbb158e_3200x1200.png 424w, /__u/substackcdn.com/image/fetch/$s_!lAkG!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adfd73a-90e2-4463-aad3-952e7cbb158e_3200x1200.png 848w, /__u/substackcdn.com/image/fetch/$s_!lAkG!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adfd73a-90e2-4463-aad3-952e7cbb158e_3200x1200.png 1272w, /__u/substackcdn.com/image/fetch/$s_!lAkG!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adfd73a-90e2-4463-aad3-952e7cbb158e_3200x1200.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!lAkG!,w_5760,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adfd73a-90e2-4463-aad3-952e7cbb158e_3200x1200.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0adfd73a-90e2-4463-aad3-952e7cbb158e_3200x1200.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;full&quot;,&quot;height&quot;:546,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:452398,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-fullscreen" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!lAkG!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adfd73a-90e2-4463-aad3-952e7cbb158e_3200x1200.png 424w, /__u/substackcdn.com/image/fetch/$s_!lAkG!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adfd73a-90e2-4463-aad3-952e7cbb158e_3200x1200.png 848w, /__u/substackcdn.com/image/fetch/$s_!lAkG!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adfd73a-90e2-4463-aad3-952e7cbb158e_3200x1200.png 1272w, /__u/substackcdn.com/image/fetch/$s_!lAkG!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0adfd73a-90e2-4463-aad3-952e7cbb158e_3200x1200.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><em>In the annals of human ambition, few endeavors match our reach toward artificial minds that might exceed our own. We stand now at a peculiar crossroads, where mathematics meets mythology - where differential equations trace the arc of Icarus, and game theory maps the paths of ancient gods.</em></p><p><em>This post presents a formal mathematical framework for understand&#8230;</em></p>
      <p>
          <a href="/__u/ciphernom.substack.com/p/agi-development-under-byzantine-mad1">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Emergent Self-Modeling ]]></title><description><![CDATA[in Information-Theoretic Systems]]></description><link>https://ciphernom.substack.com/p/emergent-self-modeling</link><guid isPermaLink="false">https://ciphernom.substack.com/p/emergent-self-modeling</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Tue, 28 Jan 2025 14:42:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6WaT!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a7aa0e0-ee13-41eb-8b11-53c5a8fa2e06_849x849.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I've been working on an information-theoretic system that demonstrates how metacognitive capabilities can emerge from elementary learning mechanisms. This may have implications for how we think about self-modeling in artificial systems.</p><h2>The Problem</h2><p>Current approaches to metacognition in AI typically rely on explicitly programmed hierarchical architectures&#8230;</p>
      <p>
          <a href="/__u/ciphernom.substack.com/p/emergent-self-modeling">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[BitCam: A Concept for Authenticating Digital Video in the Age of Deepfakes]]></title><description><![CDATA[We propose a system designed to ensure the authenticity and integrity of digital video recordings amidst the rise of deepfakes and AI-generated manipulations.]]></description><link>https://ciphernom.substack.com/p/bitcam-a-concept-for-authenticating</link><guid isPermaLink="false">https://ciphernom.substack.com/p/bitcam-a-concept-for-authenticating</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Mon, 06 Jan 2025 12:49:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6WaT!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a7aa0e0-ee13-41eb-8b11-53c5a8fa2e06_849x849.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We propose a system designed to ensure the authenticity and integrity of digital video recordings amidst the rise of deepfakes and AI-generated manipulations. We envision a system where video footage is divided into discrete segments, each secured through proof-of-work and organized using Merkle trees. These cryptographic proofs are then anchored to the&#8230;</p>
      <p>
          <a href="/__u/ciphernom.substack.com/p/bitcam-a-concept-for-authenticating">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Ant People]]></title><description><![CDATA[Why Ancient Myths and Modern Science Point to an Evolutionary Mystery Beneath Our Feet]]></description><link>https://ciphernom.substack.com/p/the-ant-people</link><guid isPermaLink="false">https://ciphernom.substack.com/p/the-ant-people</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Mon, 11 Nov 2024 12:16:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a48fdf9-5fdf-4ea4-b2b3-3fb841982e86_1600x896.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!WMPc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce13d54-2ea1-4db4-91e7-060581abef0d_1600x896.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!WMPc!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce13d54-2ea1-4db4-91e7-060581abef0d_1600x896.png 424w, /__u/substackcdn.com/image/fetch/$s_!WMPc!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce13d54-2ea1-4db4-91e7-060581abef0d_1600x896.png 848w, /__u/substackcdn.com/image/fetch/$s_!WMPc!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce13d54-2ea1-4db4-91e7-060581abef0d_1600x896.png 1272w, /__u/substackcdn.com/image/fetch/$s_!WMPc!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce13d54-2ea1-4db4-91e7-060581abef0d_1600x896.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!WMPc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce13d54-2ea1-4db4-91e7-060581abef0d_1600x896.png" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ce13d54-2ea1-4db4-91e7-060581abef0d_1600x896.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:815,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2233985,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!WMPc!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce13d54-2ea1-4db4-91e7-060581abef0d_1600x896.png 424w, /__u/substackcdn.com/image/fetch/$s_!WMPc!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce13d54-2ea1-4db4-91e7-060581abef0d_1600x896.png 848w, /__u/substackcdn.com/image/fetch/$s_!WMPc!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce13d54-2ea1-4db4-91e7-060581abef0d_1600x896.png 1272w, /__u/substackcdn.com/image/fetch/$s_!WMPc!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ce13d54-2ea1-4db4-91e7-060581abef0d_1600x896.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>While the search for extraterrestrial intelligence focuses skyward, compelling evidence suggests we might be looking in the wrong direction. Recent archaeological discoveries, evolutionary biology research, and advances in theoretical physics all point to an extraordinary possibility - one that challenges our understanding of both ancient mythology and &#8230;</p>
      <p>
          <a href="/__u/ciphernom.substack.com/p/the-ant-people">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[End of The World Series]]></title><description><![CDATA[Safe Drinking Water]]></description><link>https://ciphernom.substack.com/p/end-of-the-world-series</link><guid isPermaLink="false">https://ciphernom.substack.com/p/end-of-the-world-series</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Sun, 03 Nov 2024 02:53:21 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6WaT!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a7aa0e0-ee13-41eb-8b11-53c5a8fa2e06_849x849.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It's finally happened, the thing, that we all knew was about to happen. The end of the world as we know it. All of the governments of the world have fallen. We are on our own. Huzzah! I hear you proclaim with your hat and musket. Ok Benjamin, but first we must establish safe drinking water for without it we will surely perish in a sea of our own faeces.</p><h3><strong>&#8230;</strong></h3>
      <p>
          <a href="/__u/ciphernom.substack.com/p/end-of-the-world-series">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[BitQuill]]></title><description><![CDATA[Computational Proof of Human Authorship]]></description><link>https://ciphernom.substack.com/p/bitquill</link><guid isPermaLink="false">https://ciphernom.substack.com/p/bitquill</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Fri, 25 Oct 2024 02:43:18 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/81c671d8-c1de-4042-8601-1651111cf30c_1184x933.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2><strong>ABSTRACT</strong></h2><blockquote><p>We present BitQuill, a protocol for providing some reasonable evidence of the human-incremental creation of digital documents through a novel application of proof-of-work and temporal hash chains. The system creates an unforgeable record of document evolution by requiring computational work for each edit operation, making it prohibitively expens&#8230;</p></blockquote>
      <p>
          <a href="/__u/ciphernom.substack.com/p/bitquill">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Bitcoin-Only DeFi: The Future of Decentralized Finance]]></title><description><![CDATA[On Bitcoin's Lightning Network]]></description><link>https://ciphernom.substack.com/p/bitcoin-only-defi-the-future-of-decentralized</link><guid isPermaLink="false">https://ciphernom.substack.com/p/bitcoin-only-defi-the-future-of-decentralized</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Thu, 26 Sep 2024 13:45:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8884148b-9db0-48af-8881-7fbac2b8f965_1024x1024.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Introduction</h2><p>In the chaotic world of 'cryptocurrencies', one truth stands unchallenged: <strong>Bitcoin is the only digital asset that truly matters</strong>. The rest are mere distractions&#8212;shitcoins masquerading as innovation while introducing fragility and centralization into a space that was meant to be decentralized and secure.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!linW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0600da-01a9-4315-9568-7695d4c65894_993x1442.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!linW!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0600da-01a9-4315-9568-7695d4c65894_993x1442.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!linW!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0600da-01a9-4315-9568-7695d4c65894_993x1442.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!linW!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0600da-01a9-4315-9568-7695d4c65894_993x1442.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!linW!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0600da-01a9-4315-9568-7695d4c65894_993x1442.jpeg 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!linW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0600da-01a9-4315-9568-7695d4c65894_993x1442.jpeg" width="993" height="1442" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/df0600da-01a9-4315-9568-7695d4c65894_993x1442.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1442,&quot;width&quot;:993,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:175572,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!linW!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0600da-01a9-4315-9568-7695d4c65894_993x1442.jpeg 424w, /__u/substackcdn.com/image/fetch/$s_!linW!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0600da-01a9-4315-9568-7695d4c65894_993x1442.jpeg 848w, /__u/substackcdn.com/image/fetch/$s_!linW!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0600da-01a9-4315-9568-7695d4c65894_993x1442.jpeg 1272w, /__u/substackcdn.com/image/fetch/$s_!linW!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0600da-01a9-4315-9568-7695d4c65894_993x1442.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Ethereum, in particular, has long been t&#8230;</p>
      <p>
          <a href="/__u/ciphernom.substack.com/p/bitcoin-only-defi-the-future-of-decentralized">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Momentum-Halving Model ]]></title><description><![CDATA[A Simple Approach to Bitcoin USD Exchange Rate Analysis]]></description><link>https://ciphernom.substack.com/p/the-momentum-halving-model</link><guid isPermaLink="false">https://ciphernom.substack.com/p/the-momentum-halving-model</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Sun, 08 Sep 2024 12:44:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f321baf-f260-4b6b-af92-302de2bdb038_1920x893.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This article presents an analytical model for understanding Bitcoin USD exchange rate movements. <strong>It is not financial advice</strong>. Always conduct your own research before making investment decisions.</p><h2>Introduction</h2><p>The Momentum-Halving Model is a tool for analyzing Bitcoin's USD exchange rate  (from now on &#8220;rate&#8221;) dynamics. It combines four key factors:</p><ol><li><p>Momentum: &#8230;</p></li></ol>
      <p>
          <a href="/__u/ciphernom.substack.com/p/the-momentum-halving-model">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Towards a Zero-Tax Polity ]]></title><description><![CDATA[Cryptocurrency and the Evolution of Fiscal Systems]]></description><link>https://ciphernom.substack.com/p/towards-a-zero-tax-polity</link><guid isPermaLink="false">https://ciphernom.substack.com/p/towards-a-zero-tax-polity</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Fri, 16 Aug 2024 14:48:24 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2f6dbb43-1de7-4827-82bb-b54d5a37e341_1024x774.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The history of political economy is replete with attempts to optimise the extraction and allocation of resources for collective ends. From the corv&#233;e labour systems of ancient Egypt to the modern income tax, these mechanisms have invariably introduced friction, inefficiencies, and perverse incentives into the economic fabric of societies. We stand now a&#8230;</p>
      <p>
          <a href="/__u/ciphernom.substack.com/p/towards-a-zero-tax-polity">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Number Go Up]]></title><description><![CDATA[Bitcoin's Original Design and Subsequent Challenges: A Critical Self-Analysis]]></description><link>https://ciphernom.substack.com/p/number-go-up</link><guid isPermaLink="false">https://ciphernom.substack.com/p/number-go-up</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Thu, 01 Aug 2024 10:30:15 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6WaT!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a7aa0e0-ee13-41eb-8b11-53c5a8fa2e06_849x849.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<pre><code><strong>========================================================================
==============================DISCLAIMER================================
========================================================================</strong>
This article is a work of speculative fiction presented in the style of an analysis by Satoshi Nakamoto, the pseudonymous creator of Bit&#8230;</code></pre>
      <p>
          <a href="/__u/ciphernom.substack.com/p/number-go-up">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Diving Deep: When the code "gets it"]]></title><description><![CDATA[The Concept: Grokking in Machine Learning]]></description><link>https://ciphernom.substack.com/p/diving-deep-when-the-code-gets-it</link><guid isPermaLink="false">https://ciphernom.substack.com/p/diving-deep-when-the-code-gets-it</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Mon, 08 Jul 2024 09:45:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!VHBv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd59c991-051a-4fd4-9f9b-a88e792fd629_1792x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Ever heard of a machine learning model that gets <em>smarter</em> by being <em>overfit</em>? Welcome to the fascinating world of "grokking" in Large Language Models (LLMs)!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!VHBv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd59c991-051a-4fd4-9f9b-a88e792fd629_1792x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!VHBv!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd59c991-051a-4fd4-9f9b-a88e792fd629_1792x1024.png 424w, /__u/substackcdn.com/image/fetch/$s_!VHBv!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd59c991-051a-4fd4-9f9b-a88e792fd629_1792x1024.png 848w, /__u/substackcdn.com/image/fetch/$s_!VHBv!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd59c991-051a-4fd4-9f9b-a88e792fd629_1792x1024.png 1272w, /__u/substackcdn.com/image/fetch/$s_!VHBv!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd59c991-051a-4fd4-9f9b-a88e792fd629_1792x1024.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!VHBv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd59c991-051a-4fd4-9f9b-a88e792fd629_1792x1024.png" width="1456" height="832" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dd59c991-051a-4fd4-9f9b-a88e792fd629_1792x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:832,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1493373,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!VHBv!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd59c991-051a-4fd4-9f9b-a88e792fd629_1792x1024.png 424w, /__u/substackcdn.com/image/fetch/$s_!VHBv!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd59c991-051a-4fd4-9f9b-a88e792fd629_1792x1024.png 848w, /__u/substackcdn.com/image/fetch/$s_!VHBv!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd59c991-051a-4fd4-9f9b-a88e792fd629_1792x1024.png 1272w, /__u/substackcdn.com/image/fetch/$s_!VHBv!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd59c991-051a-4fd4-9f9b-a88e792fd629_1792x1024.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h3>What's Grokking?</h3><p>Imagine training a model way past the point where conventional wisdom says "stop!" Instead of becoming less accurate, these models sometimes have an "aha!" moment. They suddenly "get" (&#8230;</p>
      <p>
          <a href="/__u/ciphernom.substack.com/p/diving-deep-when-the-code-gets-it">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Barbra]]></title><description><![CDATA[DO NOT SHARE THIS ARTICLE]]></description><link>https://ciphernom.substack.com/p/barbra</link><guid isPermaLink="false">https://ciphernom.substack.com/p/barbra</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Fri, 28 Jun 2024 00:38:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rWC9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7b15f81-3749-4e3c-8dec-112b5b1769b1_464x493.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!xw33!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c68d67-b29c-4a9a-bebb-a95dc71357e9_348x293.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!xw33!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c68d67-b29c-4a9a-bebb-a95dc71357e9_348x293.png 424w, /__u/substackcdn.com/image/fetch/$s_!xw33!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c68d67-b29c-4a9a-bebb-a95dc71357e9_348x293.png 848w, /__u/substackcdn.com/image/fetch/$s_!xw33!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c68d67-b29c-4a9a-bebb-a95dc71357e9_348x293.png 1272w, /__u/substackcdn.com/image/fetch/$s_!xw33!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c68d67-b29c-4a9a-bebb-a95dc71357e9_348x293.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!xw33!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c68d67-b29c-4a9a-bebb-a95dc71357e9_348x293.png" width="348" height="293" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/61c68d67-b29c-4a9a-bebb-a95dc71357e9_348x293.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:293,&quot;width&quot;:348,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:109406,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!xw33!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c68d67-b29c-4a9a-bebb-a95dc71357e9_348x293.png 424w, /__u/substackcdn.com/image/fetch/$s_!xw33!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c68d67-b29c-4a9a-bebb-a95dc71357e9_348x293.png 848w, /__u/substackcdn.com/image/fetch/$s_!xw33!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c68d67-b29c-4a9a-bebb-a95dc71357e9_348x293.png 1272w, /__u/substackcdn.com/image/fetch/$s_!xw33!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61c68d67-b29c-4a9a-bebb-a95dc71357e9_348x293.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Have you ever wondered why attempts to ban or regulate Bitcoin often seem to backfire, leading to even greater interest and adoption? The answer lies in a fascinating phenomenon known as the Streisand Effect, and today, we're going to dive deep into how it applies to the world of Bitcoin.</p><p>What is the Streisand Effect? Named after a 2003 incident involvin&#8230;</p>
      <p>
          <a href="/__u/ciphernom.substack.com/p/barbra">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Silent Payments in Bitcoin]]></title><description><![CDATA[A dumb name, for an interesting idea]]></description><link>https://ciphernom.substack.com/p/silent-payments-in-bitcoin</link><guid isPermaLink="false">https://ciphernom.substack.com/p/silent-payments-in-bitcoin</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Thu, 13 Jun 2024 09:19:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6WaT!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a7aa0e0-ee13-41eb-8b11-53c5a8fa2e06_849x849.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://bips.dev/352/">BIP352</a> proposes a way to have reusable addresses in Bitcoin. This is great as one of the main problems with bitcoin is it&#8217;s very easy misuse the system and re-use addresses. This is a small privacy issue, but it&#8217;s actually a very large issue if quantum computing ever decides to reveal itself, as each transaction involves revealing a public key for that &#8230;</p>
      <p>
          <a href="/__u/ciphernom.substack.com/p/silent-payments-in-bitcoin">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Analysis of BTC Price Using Log-Log Regression and RANSAC]]></title><description><![CDATA[Scientific Report for Scientists that Science]]></description><link>https://ciphernom.substack.com/p/analysis-of-btc-price-using-log-log</link><guid isPermaLink="false">https://ciphernom.substack.com/p/analysis-of-btc-price-using-log-log</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Tue, 21 May 2024 01:48:51 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!0k9E!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6638b465-4e64-41b2-866f-546410889167_1400x800.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Abstract</h3><p>This report investigates the adequacy and appropriateness of using a log-log regression model to predict Bitcoin (BTC) prices. The popular and so called &#8220;time power law&#8221; model for Bitcoin price is recreated using the RANSAC (RANdom SAmple Consensus) method is employed to fit the regression model, and the Ramsey RESET test is applied to detect mo&#8230;</p>
      <p>
          <a href="/__u/ciphernom.substack.com/p/analysis-of-btc-price-using-log-log">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[BAERM Bot for Telegram]]></title><description><![CDATA[Not AI!]]></description><link>https://ciphernom.substack.com/p/baerm-bot-for-telegram</link><guid isPermaLink="false">https://ciphernom.substack.com/p/baerm-bot-for-telegram</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Sun, 19 May 2024 12:36:26 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/21040767-84f5-43c4-9bf6-7cc1a2f1b516_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The BAERM is an interesting model to me. Basically it uses the concept of the halving, the auto correlational and diminishing volatility. It&#8217;s really a very simple model of the past. If it continues to be accurate, it predicts a Bitcoin exchange rate well over $1m by 2030. </p><p>This is not a re-hash of the model though, if you need more information on it hav&#8230;</p>
      <p>
          <a href="/__u/ciphernom.substack.com/p/baerm-bot-for-telegram">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Yes, Chef!]]></title><description><![CDATA[Many hands make light work - Mixture of Experts Models]]></description><link>https://ciphernom.substack.com/p/yes-chef</link><guid isPermaLink="false">https://ciphernom.substack.com/p/yes-chef</guid><dc:creator><![CDATA[Nick]]></dc:creator><pubDate>Sun, 12 May 2024 07:58:44 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!UKl7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ec2c21-82cc-4371-be98-d79755bf8e38_512x512.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em><strong>Nothing here is financial advice. Models aren&#8217;t Nostradamus - they can&#8217;t predict future events - unless they are Psychohistory, but that&#8217;s literally another story ;-)</strong></em></p><p>It&#8217;s Friday night. The place is PACKED. The dishes are piling up, a waitress just quit because some dirty old customer pinched her bum and you are on your own in the kitchen. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="/__u/substackcdn.com/image/fetch/$s_!UKl7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ec2c21-82cc-4371-be98-d79755bf8e38_512x512.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="/__u/substackcdn.com/image/fetch/$s_!UKl7!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ec2c21-82cc-4371-be98-d79755bf8e38_512x512.png 424w, /__u/substackcdn.com/image/fetch/$s_!UKl7!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ec2c21-82cc-4371-be98-d79755bf8e38_512x512.png 848w, /__u/substackcdn.com/image/fetch/$s_!UKl7!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ec2c21-82cc-4371-be98-d79755bf8e38_512x512.png 1272w, /__u/substackcdn.com/image/fetch/$s_!UKl7!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_webp, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ec2c21-82cc-4371-be98-d79755bf8e38_512x512.png 1456w" sizes="100vw"><img src="/__u/substackcdn.com/image/fetch/$s_!UKl7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ec2c21-82cc-4371-be98-d79755bf8e38_512x512.png" width="518" height="518" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/66ec2c21-82cc-4371-be98-d79755bf8e38_512x512.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:512,&quot;width&quot;:512,&quot;resizeWidth&quot;:518,&quot;bytes&quot;:421622,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="/__u/substackcdn.com/image/fetch/$s_!UKl7!, /__u/ciphernom.substack.com/w_424, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ec2c21-82cc-4371-be98-d79755bf8e38_512x512.png 424w, /__u/substackcdn.com/image/fetch/$s_!UKl7!, /__u/ciphernom.substack.com/w_848, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ec2c21-82cc-4371-be98-d79755bf8e38_512x512.png 848w, /__u/substackcdn.com/image/fetch/$s_!UKl7!, /__u/ciphernom.substack.com/w_1272, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ec2c21-82cc-4371-be98-d79755bf8e38_512x512.png 1272w, /__u/substackcdn.com/image/fetch/$s_!UKl7!, /__u/ciphernom.substack.com/w_1456, /__u/ciphernom.substack.com/c_limit, /__u/ciphernom.substack.com/f_auto, /__u/ciphernom.substack.com/q_auto:good, /__u/ciphernom.substack.com/fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ec2c21-82cc-4371-be98-d79755bf8e38_512x512.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>&#8220;Order Up!&#8221; yo&#8230;</p>
      <p>
          <a href="/__u/ciphernom.substack.com/p/yes-chef">
              Read more
          </a>
      </p>
   ]]></content:encoded></item></channel></rss>