Skip to content

feat: add DIY Validium blog post#27

Merged
oskarth merged 6 commits intomainfrom
feat/diy-validium-post
Mar 18, 2026
Merged

feat: add DIY Validium blog post#27
oskarth merged 6 commits intomainfrom
feat/diy-validium-post

Conversation

@oskarth
Copy link
Copy Markdown
Collaborator

@oskarth oskarth commented Mar 16, 2026

Summary

  • New blog post: "DIY Validium: Private Logic on Public Rails"
  • Covers the DIY validium PoC: guest program pattern (disclosure proof as full exhibit), validium architecture, escape hatch + forced withdrawal (anti-censorship), trust model comparison with other IPTF approaches, and open questions on private shared state
  • Three Excalidraw diagrams: zkVM pattern flow, three-layer architecture, censorship resistance spectrum
  • Working outline included for reference

Still needed

  • Hero image (1200x600, 2:1 ratio) for Twitter card
  • Final date confirmation
  • Review of disclosure.rs code block against actual source on feat/escape-hatch branch
  • Verify internal links render correctly with bundle exec jekyll serve

Test plan

  • bundle exec jekyll serve renders post correctly
  • Diagrams display at correct size
  • Internal links to previous posts work
  • No double dashes or em-dashes in prose
  • External links (SPEC, source code, IPTF map) resolve

@oskarth oskarth force-pushed the feat/diy-validium-post branch from 1685611 to 56b764a Compare March 16, 2026 04:01
@oskarth oskarth requested review from Meyanis95, mojalil and rymnc March 16, 2026 04:01
Blog post: "DIY Validium: Private Logic on Public Rails"

Covers the DIY validium PoC: guest program pattern (disclosure proof
as full exhibit), validium architecture, escape hatch + forced
withdrawal (anti-censorship), trust model comparison with other IPTF
approaches, and open questions on private shared state.

Three Excalidraw diagrams and hero image.
@oskarth oskarth force-pushed the feat/diy-validium-post branch from 56b764a to f9c9c3d Compare March 16, 2026 04:20

The program commits three values to the proof's public journal: the Merkle root, the threshold, and the disclosure key hash. That's all the auditor gets. Balance met a threshold, against a specific state root, bound to their identity.

A compliance officer can read this code. Compare that to Circom, where the same check needs roughly 80 lines of manual signal routing and SHA-256 constraint wiring. The business logic (`balance >= threshold`) is identical either way; everything around it in Circom is circuit plumbing.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to say the tradeoff here is maintainability vs perf?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — added this. The line now reads:

The tradeoff is maintainability vs performance: zkVMs are slower than hand-optimized circuits, but the code is readable and auditable.

tldr: ✅ Added maintainability vs perf tradeoff.

Comment on lines +183 to +185
This is a PoC. Some of the gaps are straightforward to close, others are open problems.

On the engineering side: the operator is centralized (production would use a DA committee or post calldata). Users save their own data for escape (production would add blob checkpoints or encrypted DA). Disclosure keys are hash-based (production would use verifiable encryption; both Aztec and Miden are exploring this). There's no batching, and deposits and withdrawals are public.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious, each state transition triggered by a transfer/deposit would invalidate all pending transactions in the mempool due to root mismatch, right? can we count that as a limitation?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly — each state transition updates the root, so any in-flight proof built against the old root becomes invalid. Added this as an explicit limitation:

Each state transition updates the root, which invalidates any in-flight proofs built against the old root — there's no concurrent transaction processing without batching.

tldr: ✅ Called out root invalidation as a limitation in "What's missing".


## Write Rust, prove it, verify on-chain

A validium keeps account data off-chain (held by an operator) and posts only Merkle roots and validity proofs on-chain. The chain stores almost nothing, but every state transition is cryptographically proven. If a transfer violates the rules, the proof won't verify and the contract rejects it.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intro might be a bit too technical.
Validium => define it as a rollup
Merkle roots => commitment
validity proofs on-chain => a proof that the operator is doing correct work on the L1 contract...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — rewrote the intro. Now reads:

A validium is a type of rollup that keeps account data off-chain with an operator and posts only commitments and proofs to L1. The L1 contract verifies that the operator performed each state transition correctly.

tldr: ✅ Defined validium as a rollup, replaced jargon with plain language.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what did you use to generate this? looks sick

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the PR message, it might be a placeholder, but I agree it does look cool.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated some Midjourney prompts and then tweaking a bit :) Midjourney

Not placeholder, this is the real hero iamge!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this committed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope — deleted all three excalidraw source files and added *.excalidraw to .gitignore. PNGs are still there.

tldr: ✅ Removed, gitignored.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need this committed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted.

tldr: ✅ Removed.

Copy link
Copy Markdown
Collaborator

@rymnc rymnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall i think it looks good, but seems too playful and has a bit of an ai voice to it, dealing in superlatives, slightly shilling etc

commitment = SHA256(pubkey || balance_le || salt)
```

`balance_le` is the balance encoded as little-endian bytes (matching Rust's `u64::to_le_bytes()`). Sequential root checks (`require(oldRoot == stateRoot)`) prevent replay: each operation changes the root, making stale proofs invalid. We don't need nullifiers (unlike UTXO models like Zcash or our [shielded pool PoC](/building-private-transfers-on-ethereum/)), but the tradeoff is that a centralized state holder is required.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we go that deep in a blog post? Or can it be abstracted?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — removed the code block with the commitment formula. Now just says:

Each account is a leaf in a Merkle tree. The leaf is a hash of the account's public key, balance, and a random salt.

tldr: ✅ Abstracted away, no more code block.

@oskarth
Copy link
Copy Markdown
Collaborator Author

oskarth commented Mar 17, 2026

Thanks for the review comments!

Addressed Feedback

@rymnc

  • ✅ Added maintainability vs performance tradeoff note (line 82)
  • ✅ Added root invalidation as an explicit limitation in "What's missing" section (line 185)
  • ✅ Removed excalidraw source files and gitignored *.excalidraw
  • ✅ Removed diy-validium-outline.md

@Meyanis95

  • ✅ Rewrote intro paragraph: defined validium as "a type of rollup", replaced "Merkle roots and validity proofs" with "commitments and proofs to L1"
  • ✅ Abstracted the commitment formula — removed code block, replaced with plain English description

Ready for re-review.

Remove excalidraw source files (PNGs kept), gitignore *.excalidraw,
delete outline doc, and refine blog post wording for clarity.
@oskarth oskarth force-pushed the feat/diy-validium-post branch from 11f7a9e to 129148a Compare March 17, 2026 05:17
---
layout: post
title: "DIY Validium: Private Logic on Public Rails"
description: "We built a validium in a few hundred lines of Rust and Solidity to understand what programmable privacy looks like end to end. The business logic is just Rust, proved in zero knowledge and verified on Ethereum."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

dont think that the description should be so long

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — shortened to: "A validium PoC where the business logic is ordinary Rust, proved in zero knowledge and verified on Ethereum." Should fit in preview now.

oskarth added 2 commits March 17, 2026 13:45
…lint

Address reviewer feedback on forced withdrawal two-step semantics and
deposit stranding risk. Apply voice lint: hook pivot, orientation line,
trust model forward-reference, UTXO callout, and ending recap.
@oskarth oskarth requested review from Meyanis95 and rymnc March 17, 2026 09:05
@oskarth
Copy link
Copy Markdown
Collaborator Author

oskarth commented Mar 17, 2026

overall i think it looks good, but seems too playful and has a bit of an ai voice to it, dealing in superlatives, slightly shilling etc

Tweaked in a bunch of places; if there are still specific places that seems off to you please comment in-line

Copy link
Copy Markdown
Collaborator

@Meyanis95 Meyanis95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Lead with problem statement instead of cold-opening with a code block.
Remove duplicated "what are the moving parts" motivation. Keep assert!
snippet as an earned reveal. Re-add Prividium mention in validium
definition paragraph.

Co-Authored-By: oskarth <o@oskx.io>
@oskarth
Copy link
Copy Markdown
Collaborator Author

oskarth commented Mar 18, 2026

Reworked the opening section:

  • Lead with problem statement instead of cold-opening with a code block
  • assert! snippet is now an earned reveal ("Here's a line of vanilla Rust code:")
  • Removed duplicated "what are the moving parts" motivation (was in both opener and "Write Rust" section)
  • Re-added Prividium mention in the validium definition paragraph
  • Fixed closing recap back-reference ("in the guest program" instead of "we started with")

Net: -2 lines, matches the voice of earlier posts in the series.

Co-Authored-By: oskarth <o@oskx.io>
@oskarth oskarth merged commit 7451910 into main Mar 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants