$ ls /writing

writing

Notes on cryptography, proof systems, Rust systems engineering, and the protocols I build.

subscribe via rss

# all posts

A DarkFi Node on a Raspberry Pi — ARM Bring-Up Notes and the Circuits Underneath
DarkFi
ZK
Poseidon
RandomX
Raspberry Pi
Rust
WireGuard

A DarkFi Node on a Raspberry Pi — ARM Bring-Up Notes and the Circuits Underneath

Notes from turning a Raspberry Pi 5 into a 24/7 DarkFi testnet node and miner: NVMe boot, self-hosted WireGuard, the ARM dependency trail for darkfid and xmrig, and a look at the ZK circuits the node deploys on startup — including the v3a exploit that sat on a Poseidon binding.

6/2/2026
12 min
Read More
Learning Solana from Outdated Tutorials: What Changed in Modern Anchor
Solana
Rust
Anchor
LiteSVM
PDA

Learning Solana from Outdated Tutorials: What Changed in Modern Anchor

Notes on migrating from Anchor 0.29 to 1.0 while following RareSkills' Solana course. Concrete diffs in project structure, instruction serialization, testing infrastructure, and what stayed invariant.

5/29/2026
10 min
Read More
Bytes, Bits, and Breaking XOR — Notes from Cryptopals in Rust
Cryptography
Rust
XOR
Base64
Cryptopals

Bytes, Bits, and Breaking XOR — Notes from Cryptopals in Rust

Notes from implementing the first Cryptopals challenges in Rust without libraries: hex, base64, XOR, frequency analysis, Hamming distance, and breaking a repeating-key cipher.

5/20/2026
11 min
Read More
Reverse-Engineering a North-Korean-Style Supply Chain Attack Delivered via Fake Web3 Job Interview
Security
npm
Supply Chain
RCE
Web3
C2
Malware Analysis
Incident Response

Reverse-Engineering a North-Korean-Style Supply Chain Attack Delivered via Fake Web3 Job Interview

Full forensic analysis of a targeted supply chain attack delivered through a fake Web3 job interview. A single npm install silently deployed a two-stage RAT: an initial loader that decrypts a second-stage C2 endpoint, exfiltrates the full process environment, and maintains a persistent TCP beacon on port 1224 awaiting operator commands. I got targeted, responded in 45 minutes, then reproduced the entire attack chain in an isolated Hetzner VM and captured the complete C2 protocol.

4/15/2026
30 min
Read More
dag_exec: a std-only DAG executor for CPU-heavy pipelines (pruning + bounded parallelism)
Rust
Concurrency
Parallelism
Backpressure
Execution Engines
DAG

dag_exec: a std-only DAG executor for CPU-heavy pipelines (pruning + bounded parallelism)

A tiny std-only DAG executor that computes only the requested outputs (partial evaluation) and runs heavy nodes in parallel with explicit bounds.

3/3/2026
4 min
Read More
Rollup Commitments as a DAG: Pruning, Parallelism, and Proof Plumbing (Rust std-only)
Rust
Concurrency
Parallelism
Merkle
Rollups
Data Availability

Rollup Commitments as a DAG: Pruning, Parallelism, and Proof Plumbing (Rust std-only)

A rollup-shaped batch pipeline modeled as a DAG: compute only the chunk/proof you need, and scale CPU-heavy hashing with bounded parallelism — all in std.

3/1/2026
8 min
Read More
Testing Concurrency Invariants in a Parallel Executor
Rust
Concurrency
Atomics
Testing

Testing Concurrency Invariants in a Parallel Executor

How to verify max_in_flight bounds using AtomicUsize, CAS loops, and deterministic gating without sleep().

2/24/2026
4 min
Read More
Designing Backpressure in a Parallel DAG Executor
Rust
Concurrency
Backpressure
Parallelism

Designing Backpressure in a Parallel DAG Executor

How I introduced bounded backpressure into a parallel DAG scheduler using sync channels and an in-flight cap.

2/21/2026
5 min
Read More
Rust — Trait Objects, Sized, and Why My DAG Needed `Box<dyn Fn>`
Rust
Trait Objects
Generics
Ownership

Rust — Trait Objects, Sized, and Why My DAG Needed `Box<dyn Fn>`

Why heterogeneous closures require type erasure, how trait objects become unsized, and why 'static is necessary when storing tasks.

2/14/2026
4 min
Read More
ZKML EZKL MNIST Lab: Verifiable Inference, Quantization, and the Prover Memory Wall
ZK
ZKML
EZKL
Halo2
ONNX
MNIST
Benchmarks

ZKML EZKL MNIST Lab: Verifiable Inference, Quantization, and the Prover Memory Wall

A small, reproducible ZKML lab: train a CNN, export ONNX, compile an EZKL circuit, generate keys, prove & verify inference — then benchmark the practical tradeoff that matters on consumer hardware: numerical fidelity vs prover memory / PK size.

1/10/2026
7 min
Read More
Crescent Bench Lab: Measuring ZK Presentations for Real Credentials (JWT + mDL)
ZK
ZKID
Crescent
JWT
mDL
Rust
Benchmarks

Crescent Bench Lab: Measuring ZK Presentations for Real Credentials (JWT + mDL)

A small Rust lab that vendors microsoft/crescent-credentials, generates Crescent test vectors, and benchmarks zksetup/prove/show/verify across several parameters — including proof sizes and selective disclosure variants.

12/31/2025
8 min
Read More
TEE Auction Coprocessor: Replay-Safe Attested Auction Receipt with Gramine SGX — Tutorial
TEE
SGX
Gramine
Rust
Attestation
Auctions

TEE Auction Coprocessor: Replay-Safe Attested Auction Receipt with Gramine SGX — Tutorial

A Rust mini-lab that turns a Vickrey (second-price) auction into a TEE coprocessor: deterministic core, bid commitments, replay protection, and a policy-driven verifier—leaving full DCAP collateral/TCB verification (PCS chain, revocation, freshness rules) for a follow-up.

12/20/2025
18 min
Read More
Baby-Ligero: Three Tiny Tests for a Tiny Circuit — ZK Hack S3M5
ZK
Ligero
MPC-in-the-head
SNARKs
Rust

Baby-Ligero: Three Tiny Tests for a Tiny Circuit — ZK Hack S3M5

A mini Rust lab that implements a baby version of Ligero's three tests — proximity, multiplication, and linear — for a tiny arithmetic circuit, and uses them to see soundness amplification in action.

12/8/2025
18 min
Read More
Norm Blowup in Lattice Folding (LatticeFold Lab) — ZK Hack S3M4
ZK
LatticeFold
Folding
SIS
Rust

Norm Blowup in Lattice Folding (LatticeFold Lab) — ZK Hack S3M4

A hands-on Rust experiment exploring why folding causes norm blowup in lattice commitments, and how decomposition keeps the digits small — the core idea behind LatticeFold and LatticeFold+.

12/1/2025
12 min
Read More
SIS Labs — Commitments, PoK & MC soundness experiment (ZK Hack S3M3)
ZK
STARKs
SIS
Commitments
Soundness

SIS Labs — Commitments, PoK & MC soundness experiment (ZK Hack S3M3)

From Vadim Lyubashevsky's lattice-based SNARKs whiteboard to a tiny Rust lab: SIS commitments, a proof of knowledge, and a soundness experiment.

11/24/2025
16 min
Read More
NTT Bench — BabyBear vs Goldilocks (ZK Hack S3M2)
ZK
STARKs
NTT
BabyBear
Goldilocks
Criterion
Rust

NTT Bench — BabyBear vs Goldilocks (ZK Hack S3M2)

Hands-on NTT benchmarks over BabyBear and Goldilocks fields, connecting Jim Posen’s ZK Hack talk on high-performance SNARK/STARK engineering to real Rust code.

11/16/2025
14 min
Read More
icRamp Devlog #21 — Vault Refactor & ic-alloy EVM Reads
ICP
EVM
Solidity
ic-alloy
Escrow
Vault

icRamp Devlog #21 — Vault Refactor & ic-alloy EVM Reads

Final milestone wrap-up: IcRamp v2 with a simplified vault, ICP-driven state instead of on-chain commit/uncommit, and ic-alloy-powered EVM reads for getDeposit.

11/13/2025
15 min
Read More
icRamp Devlog #20 — Pay with Crypto (Settlement & Verification)
ICP
EVM
Solana
Bitcoin
P2P
Bridge
Payments

icRamp Devlog #20 — Pay with Crypto (Settlement & Verification)

We finish the pay-with-crypto flow: from Locked orders to on-chain payments, matching provider assets, and verifying EVM/Solana txs on the backend.

11/12/2025
12 min
Read More
Cryptography — What makes a Hash ZK-Friendly (ZK Hack S3M1)
ZK
Poseidon
BLAKE3
SHA-256
SHA-512
Arkworks
Criterion
Rust

Cryptography — What makes a Hash ZK-Friendly (ZK Hack S3M1)

Practical Learnings from ZK Hack with JP Aumasson with hands-on benchmarks: SHA-256/512, BLAKE3, Poseidon. What does 'ZK-friendly' really mean?

11/9/2025
5 min
Read More
icRamp Devlog #19 — Pay with Crypto (Frontend UX & Provider Flows)
ICP
EVM
Solana
Bitcoin
Bridges
USDC
EURC
Devlog
Frontend
React

icRamp Devlog #19 — Pay with Crypto (Frontend UX & Provider Flows)

Frontend wiring for the experimental 'pay with crypto' path: crypto providers in the user profile, filtered provider selection in Create Order, and a compact order card UX for onrampers choosing how to pay.

11/8/2025
18 min
Read More
icRamp Devlog #18 — Pay with Crypto (Experimental Trustless P2P Bridge)
ICP
EVM
Solana
Bitcoin
Bridges
USDC
EURC
Devlog

icRamp Devlog #18 — Pay with Crypto (Experimental Trustless P2P Bridge)

We add an experimental 'pay with crypto' path that lets onrampers settle in stables on a different chain than the escrowed asset. Includes provider model refactor and order validation. Frontend exposure starts with stables for speed.

11/4/2025
21 min
Read More
icRamp Devlog #17 — Liquid Orders: Partial Fills
ICP
Escrow
Stripe
Revolut
PayPal
Partial Fills
EVM
Solana
Bitcoin

icRamp Devlog #17 — Liquid Orders: Partial Fills

We add partial fills: the onramper can lock only a fraction of the order, pay, and get a proportional crypto payout while the rest stays open. Single lock path, pro-rata fees, idempotent fill records, and listener-safe completion.

10/31/2025
12 min
Read More
icRamp Devlog #16 — Liquid Orders: Top‑ups + Provider Icons
ICP
Orders
Stripe
Rust
React
Frontend
Backend

icRamp Devlog #16 — Liquid Orders: Top‑ups + Provider Icons

Added liquid (top‑up) orders and unified provider icons across the app. Safe processing lock on the backend, fee recomputation on the new total, and a polished top‑up UI with available-balance max.

10/26/2025
5 min
Read More
icRamp Devlog #15 — Stripe Order Payments (Email↔️Connect, per‑order redirects)
ICP
Stripe
Connect
Checkout
Backend
Frontend
Rust
React

icRamp Devlog #15 — Stripe Order Payments (Email↔️Connect, per‑order redirects)

End-to-end Stripe payments for orders: Onramper pays by email, Offramper receives via Connect destination charges. Per‑order success/cancel, email verification, and a resilient FE redirect flow.

10/22/2025
7 min
Read More
icRamp Devlog #14 — Stripe Frontend (Register & Checkout UX)
ICP
Stripe
Connect
Checkout
Frontend
React

icRamp Devlog #14 — Stripe Frontend (Register & Checkout UX)

Frontend wiring for Stripe Connect: a register flow that survives redirect/refresh, provider cards UI, and Create Order with destination charges. Includes the Onramper≠Offramper split and backend-validated providers.

10/19/2025
10 min
Read More
icRamp Devlog #13 — Stripe Backend (Connect + Checkout)
ICP
Stripe
Connect
Checkout
P2P
Canisters

icRamp Devlog #13 — Stripe Backend (Connect + Checkout)

Starting Milestone 2: bringing Stripe Connect (destination charges) into icRamp with IPv6-friendly HTTPS outcalls, multi-region key routing, and Candid-first tests.

10/15/2025
10 min
Read More
DeFi Bots Series — Part 8: The Monitor Test Saga (Making the Monitor Debuggable)
Solana
Meteora
DLMM
Jupiter
Supabase
Privy
RPC
Bots
TypeScript
SQL

DeFi Bots Series — Part 8: The Monitor Test Saga (Making the Monitor Debuggable)

I debugged the PnL, refactored the messy code we left implemented in our last devlog and made everything more compact and debuggable.

10/12/2025
18 min
Read More
DeFi Bots Series — Part 7: The Monitor Test Saga (One-Sided Bids, Skew Rebalances, and Real PnL)
Solana
Meteora
DLMM
Jupiter
Supabase
Privy
RPC
Bots
TypeScript
SQL

DeFi Bots Series — Part 7: The Monitor Test Saga (One-Sided Bids, Skew Rebalances, and Real PnL)

I stress-tested a one-sided, USDC-anchored LP strategy overnight: ~15 rebalances, lots of fee accrual, a few bugs, and a clearer picture of what to fix next. We tightened pool orientation, made SOL/WSOL funding sane, added skew gates (TVL/fees), and wrote proper lineage + flows. The monitor is quieter—until it needs not to be.

10/10/2025
17 min
Read More
DeFi Bots Series — Part 6: Base-Funded Opens and Sweeps, Clean PnL, and a Quiet (Smarter) Monitor
Solana
Meteora
DLMM
Jupiter
Supabase
Privy
RPC
Bots
TypeScript

DeFi Bots Series — Part 6: Base-Funded Opens and Sweeps, Clean PnL, and a Quiet (Smarter) Monitor

I moved position funding and settlements to a USDC base, fixed a sneaky PnL bug (price/mint orientation), taught the monitor to chill (cooldown + “in-range = HOLD”), and battle-tested open/close scripts with ledgered flows. It’s finally… boring—in the good way.

10/7/2025
13 min
Read More
DeFi Bots Series — Part 5: Live Rebalance on Meteora DLMM (RPC Profiles, Clean PnL & One-Sided Liquidity)
Solana
Telegram
Supabase
Privy
Jupiter
Meteora
DLMM
Bots
PnL
TypeScript

DeFi Bots Series — Part 5: Live Rebalance on Meteora DLMM (RPC Profiles, Clean PnL & One-Sided Liquidity)

I rewired RPC handling with role-based profiles, unified LP strategy controls, fixed PnL accounting, and executed a live one-sided rebalance on a PUMP/USDC DLMM pool over gRPC—end to end with Supabase ledgering.

10/4/2025
6 min
Read More
DeFi Bots Series — Part 4: Prepping the Monitor — Decimals, Prices, Symbols & Clean Balances
Solana
Telegram
Supabase
Privy
Jupiter
Meteora
DLMM
Bots
PnL
TypeScript

DeFi Bots Series — Part 4: Prepping the Monitor — Decimals, Prices, Symbols & Clean Balances

Before we let the monitor act on positions, we hardened the boring bits: one source of truth for decimals, fast prices, safe BigInt math, and clean balance reads. The goal is simple: trustworthy PnL so alerts and actions are correct.

10/1/2025
7 min
Read More
DeFi Bots Series — Part 3: Telegram Bot Lite, Portfolio RPC, and a Lean Path to the Scheduler
Solana
Telegram
Supabase
Privy
Jupiter
Meteora
DLMM
Bots
Scheduler
TypeScript
Python

DeFi Bots Series — Part 3: Telegram Bot Lite, Portfolio RPC, and a Lean Path to the Scheduler

I stripped our Telegram surface down to a fast, durable “Lite” mode: no Kafka, no AI agent in the middle—just clean wallet UX, on-chain balances via RPC, token prices from Jupiter, PnL wired to Supabase, and buttons that actually do something. This sets the table for the trading scheduler.

9/30/2025
6 min
Read More
DeFi Bots Series — Part 2: Orchestrator, LP-Copy Warm-Up & Safe Monitor (Dry-Run)
Solana
Meteora
DLMM
Bots
Scheduler
Orchestrator
Supabase
Telegram
TypeScript

DeFi Bots Series — Part 2: Orchestrator, LP-Copy Warm-Up & Safe Monitor (Dry-Run)

We wire a minimal orchestrator with a primed LP-copy scanner and a policy-driven monitor that runs in dry-run, notifies via Telegram, reads positions from Supabase, and calls execution logic via imports (no gRPC).

9/28/2025
3 min
Read More
DeFi Bots Series — Part 1: A Practical Meteora DLMM Scanner (From TXs to Pool Intents)
Solana
DLMM
Meteora
TypeScript
Bots
RPC
Anchor
Copytrading

DeFi Bots Series — Part 1: A Practical Meteora DLMM Scanner (From TXs to Pool Intents)

We build a robust scanner that reads a leader’s recent transactions and extracts DLMM position inits as (poolAddress, positionPda) intents — no brittle bin-array decoding, just clean signals my scheduler can act on.

9/26/2025
6 min
Read More
DeFi Bots Series — Building an multi-strategy bot on Solana (Intro: Goals & Plan)
Solana
DLMM
Meteora
Bots
Scheduler
TypeScript
Supabase
Taigo MCP

DeFi Bots Series — Building an multi-strategy bot on Solana (Intro: Goals & Plan)

Kicking off a new series: revive the old defi_server stack I built at Taigo, drop a new bot/ module on top, and ship a scheduler that can copy-trade Meteora LPs — with PnL tracked and later expanded to memecoins, xStocks, and perps.

9/25/2025
2 min
Read More
icRamp Devlog 12 — Milestone Submission: Solana P2P Onramping (SOL + BONK)
ICP
Solana
SPL
Vaults
Testing

icRamp Devlog 12 — Milestone Submission: Solana P2P Onramping (SOL + BONK)

Final wrap-up for the Solana Integration milestone: 5-min demo, slides, deliverables checklist, tests, and canister URLs.

9/20/2025
2 min
Read More
icRamp Devlog #11 — Testing Saga 4: Vault State (SOL + SPL), Full Suite Green
Solana
Vault
PocketIC
Testing Canisters
SPL Tokens

icRamp Devlog #11 — Testing Saga 4: Vault State (SOL + SPL), Full Suite Green

We finish the vault branch for SOL and SPL: deposits, cancels, locks, unlocks, and completion — entirely in-canister state. Plus, the full Solana suite now passes.

9/17/2025
3 min
Read More
icRamp Devlog #10 — Testing Saga 3: Token Registry, Token-2022 & Solid Wasm Paths
Solana
SPL Tokens
Token-2022
PocketIC
Testing Canisters

icRamp Devlog #10 — Testing Saga 3: Token Registry, Token-2022 & Solid Wasm Paths

We include the Solana token registry tests (incl. Token-2022), fix flaky JSON-RPC shapes, and make the test harness robust with `include_bytes!` + workspace-aware wasm paths.

9/16/2025
7 min
Read More
icRamp Devlog #9 — Testing Saga 2: PocketIC Solana Mocks & Test Harness
Solana
SPL Tokens
Devnet
Testing Canisters
PocketIC

icRamp Devlog #9 — Testing Saga 2: PocketIC Solana Mocks & Test Harness

We continue the Solana testing story by building a clean HTTP-outcall mocking layer, composable responders, and readable integration tests.

9/15/2025
8 min
Read More
icRamp Devlog #8 — Testing Saga 1: Refractor and Solana Test Expansion
Solana
SPL Tokens
Devnet
Testing Canisters
PocketIC

icRamp Devlog #8 — Testing Saga 1: Refractor and Solana Test Expansion

We refractored and improved our testing architecture and expanded it to include a fully-fledged solana backend canister integration test flow.

9/14/2025
7 min
Read More
icRamp Devlog #7 — Extra: Creating spl tokens
Solana
SPL Tokens
Devnet
Tests

icRamp Devlog #7 — Extra: Creating spl tokens

Let's create some spl tokens so we can generate a fully fledged test with orders containing solana tokens.

9/10/2025
2 min
Read More
icRamp Devlog #6 — icRamp Orders with Solana
ICP
Solana
Chain Fusion
Escrow
Canisters
Frontend

icRamp Devlog #6 — icRamp Orders with Solana

Everything is ready for us to create orders in the frontend containing solana and executing the full offramping flow.

9/4/2025
9 min
Read More
icRamp Devlog #5 — icRamp frontend Solana Wallet Adapter
Solana
Frontend
Wallet

icRamp Devlog #5 — icRamp frontend Solana Wallet Adapter

Third Chain Fusion grant log: adding solana wallet adapter in the frontend.

9/1/2025
7 min
Read More
icRamp Devlog #4 — icRamp frontend Deployment Setup with Solana
ICP
Solana
Chain Fusion
Escrow
Canisters

icRamp Devlog #4 — icRamp frontend Deployment Setup with Solana

Third Chain Fusion grant log: wiring icRamp's core backend with the Solana canister, persisting canister IDs, and preparing escrow flows for SOL/SPL assets.

8/28/2025
17 min
Read More
icRamp Devlog #3 — icRamp Canister & Solana Integration
ICP
Solana
Chain Fusion
Escrow
Canisters

icRamp Devlog #3 — icRamp Canister & Solana Integration

Third Chain Fusion grant log: wiring icRamp's core backend with the Solana canister, persisting canister IDs, and preparing escrow flows for SOL/SPL assets.

8/21/2025
5 min
Read More
icRamp Devlog #2 — Solana Canister, Registry & Vault
ICP
Solana
Chain Fusion
SPL
Canisters

icRamp Devlog #2 — Solana Canister, Registry & Vault

Second Chain Fusion grant: building a Solana canister with safe token registry and a thin vault to coordinate escrow.

8/15/2025
8 min
Read More
ETHGlobal Unite DeFi — How We Won with ICP
ICP
ETHGlobal
1inch
DeFi
Cross-chain
Fusion+

ETHGlobal Unite DeFi — How We Won with ICP

Design decisions, trade‑offs, and the fully on‑chain architecture that won 🥈 in 1inch’s Fusion+ → ICP track.

8/8/2025
10 min
Read More
icRamp Devlog #1 — Chain Fusion & Bitcoin
ICP
Bitcoin
Chain Fusion

icRamp Devlog #1 — Chain Fusion & Bitcoin

Bringing Bitcoin and Solana native actions to ICP: setup, pitfalls, and tests.

11/20/2024
2 min
Read More

$ curl -O /feed.xmlrss