Skip to content

Instantly share code, notes, and snippets.

View stackdump's full-sized avatar

stackdump stackdump

View GitHub Profile
@stackdump
stackdump / zk-state-root-chain-analysis.md
Created January 28, 2026 16:57
State Root Chain Approach for ZK Games - Analysis of advantages, disadvantages, and implementation

State Root Chain Approach for ZK Games

An analysis of using cryptographic state root chains for zero-knowledge game verification.

The Approach

Instead of proving facts about a game after it ends, prove each state transition as it happens:

Traditional ZK Game:
@stackdump
stackdump / zk-tictactoe-comparison.md
Created January 28, 2026 16:50
ZK Tic-Tac-Toe Implementations Comparison - ZoKrates vs Aleo/Leo vs Petri-Pilot (gnark)

ZK Tic-Tac-Toe Implementations Comparison

A survey of zero-knowledge proof implementations for tic-tac-toe games.

Implementations Overview

Implementation Framework Year Language Live Demo
andreysobol/tic-tac-toe-snark ZoKrates 2019 JavaScript/Java No
Aleo Leo Examples Leo/Aleo 2022+ Leo Playground
@stackdump
stackdump / jsdeliver_purging.md
Created January 28, 2026 09:47
How to purge jsdelivr CDN cache when @latest points to an old GitHub release

Purging jsdelivr CDN Cache

When using cdn.jsdelivr.net/gh/{owner}/{repo}@latest/..., the @latest tag resolves to the latest GitHub Release (not just a git tag).

Common issue

You push a new tag but @latest still serves the old version because:

  1. The tag has no corresponding GitHub Release
@stackdump
stackdump / generics-usage.md
Last active January 26, 2026 19:18
Petri-Pilot Generics Usage Examples

Generics in Petri-Pilot Generated Code

Petri-pilot generates Go code that leverages generics from go-pflow for type-safe event sourcing.

1. Type-Safe Aggregate State Machine

Every generated aggregate uses eventsource.StateMachine[State] for compile-time type safety:

// generated/erc20token/aggregate.go
# Petri Net Lemmas
Formal properties of arcnet's Petri net object model.
## Definitions
**Model** = (P, T, A) where:
- P = set of places
- T = set of transitions
- A = set of arcs ⊆ (P × T) ∪ (T × P)
@stackdump
stackdump / NEW_PROJECT.md
Last active January 3, 2026 20:25
Dual State Engine Architecture - Go/JS event sourcing template

Dual State Engine Architecture

A template for building deterministic, verifiable systems with parallel Go/JavaScript implementations.

Core Concept

Build complex stateful systems where state is a function of events:

State(t) = fold(apply, initialState, events[0..t])

Petri Net ODE Simulation Results

pflow

Simulation Parameters

  • Time Span: 0 to 10
  • Initial Step: 0.01
  • Absolute Tolerance: 0.000001
  • Relative Tolerance: 0.001

Petri Net ODE Simulation Results

pflow

Simulation Parameters

  • Time Span: 0 to 10
  • Initial Step: 0.01
  • Absolute Tolerance: 0.000001
  • Relative Tolerance: 0.001