Skip to content

tool to extract the complete Ethereum state (Accounts and Storage) directly from a Reth database and convert it into the artifacts required by the Plinko PIR server

License

Notifications You must be signed in to change notification settings

igor53627/plinko-rs

Repository files navigation

Plinko RS

Ask DeepWiki Interactive Visualization

A Rust workspace for the Plinko PIR stack: Ethereum state extraction, iPRF + hint generation, and formal verification artifacts.

Why this exists?

  • Speed: Directly reads the MDBX database using reth-db, bypassing RPC overhead.
  • Efficiency: Streams data to the output files with minimal memory footprint.
  • State Tree Support: Extracts both Accounts and Storage Slots into a unified flat database format suitable for PIR.

Usage

# Build all release binaries
cargo build --release

# Run plinko
./target/release/plinko \
  --db-path /path/to/reth/db \
  --output-dir ./data \
  --limit 1000000 # Optional: Extract subset for testing

Options

  • --db-path: Path to the Reth database (default: /var/lib/reth/mainnet/db).
  • --output-dir: Output directory (default: data).
  • --limit: (Optional) Limit the number of accounts/slots extracted (for testing).

Output Artifacts (Extractor)

The extractor produces five files:

  • database.bin: Flat array of 40-byte entries (v3 schema)
  • account-mapping.bin: Address(20) || Index(4)
  • storage-mapping.bin: Address(20) || SlotKey(32) || Index(4)
  • code_store.bin: [count: u32][hash0: 32B]...
  • metadata.json: snapshot metadata and schema version

Full layout details and size breakdowns: docs/data_format.md.

Protocol Overview (Top-5 Features)

  1. O(1) hint search via iPRF
  2. Optimal query time trade-off O~(n/r)
  3. O(1) update time via XOR deltas
  4. Ethereum-scale practicality
  5. GPU-accelerated hint generation

More detail: docs/protocol_overview.md.

Datasets

  • Mainnet v3 snapshot + sizes: docs/data_format.md
  • Regression data (legacy v2): docs/data_format.md

Docs

  • Protocol overview: docs/protocol_overview.md
  • Data format and datasets: docs/data_format.md
  • Hint generation: docs/hint_generation.md
  • Update strategy: docs/update_strategy.md
  • Benchmarks: docs/benchmarks.md
  • Verification: docs/verification.md

Additional Documentation

References


Alex Hoover: Plinko - Single-Server PIR with Efficient Updates via Invertible PRFs

About

tool to extract the complete Ethereum state (Accounts and Storage) directly from a Reth database and convert it into the artifacts required by the Plinko PIR server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5