MCPcopy Index your code
hub / github.com/dmpierre/plasma-fold

github.com/dmpierre/plasma-fold @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
231 symbols 471 edges 39 files 25 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

PlasmaFold

plasma-fold

PlasmaFold: an incrementally verifiable payment L2 combining client-side proving and plasma to reach 14k+ TPS.

PlasmaFold operates under a "verifiable plasma" regime. On one hand, it uses plasma-like data availability requirements, restricting the amount of data posted by an aggregator to minimal amounts. On the other, it requires the plasma aggregator to verifiably build blocks and users to run a (lightweight) client-side prover. This combination removes from the aggregator most of its cheating avenues while allowing usrs to exit the chain non-interactively at any point in time, without any particular assumptions regarding their liveness.

Using Nova, our prototype implementation demonstrates a PlasmaFold aggregator working on low-end hardware and an efficient WASM client-side prover running within a chrome browser.

Benchmarks

Client

With SHA Accumulator:

Transaction Batch size fcircuit size Total circuit size Processing time WASM mem. usage Parameters size (compressed)
1 94k 150k 4.1s 441mb 97mb
2 111k 167k 4.7s 490mb 114mb
5 161k 218k 6.2s 653mb 164mb
8 212k 268k 7.8s 908mb 232mb
10 246k 302k 8.8s 1050mb 266mb

With Poseidon accumulator (requires user to provide a side proof to exit - see eprint):

Transaction Batch size fcircuit size Total circuit size Processing time WASM mem. usage Parameters size (compressed)
1 19k (< recursive cost) 76k 2.8s 291mb 73mb
2 36k (< recursive cost) 92k 3.5s 343mb 90mb
5 87k 143k 5.3s 579mb 149mb
8 138k 193k 7.3s 737mb 200mb
10 171k 227k 8.1s 845mb 233mb

Aggregator

Tests

Tests for PlasmaFold's datastructures and aggregator run natively. Client tests run in wasm within the browser and assume a working installation of wasm-pack.

$ cargo test -r -p plasma-fold # datastructures tests
$ cargo test -r -p aggregator # aggregator tests
$ cd client && wasm-pack test -r --chrome # client tests, open developer console to see mem consumption and step times

Extension points exported contracts — how you extend this code

SparseConfig (Interface)
(no doc) [4 implementers]
plasma-fold/src/primitives/sparsemt/mod.rs
ToNBitsGadget (Interface)
(no doc) [1 implementers]
aggregator/src/circuit.rs
SparseConfigGadget (Interface)
(no doc) [4 implementers]
plasma-fold/src/primitives/sparsemt/constraints.rs
Accumulator (Interface)
(no doc) [2 implementers]
plasma-fold/src/primitives/accumulator/constraints.rs

Core symbols most depended-on inside this repo

root
called by 37
plasma-fold/src/primitives/sparsemt/mod.rs
generate_proof
called by 15
plasma-fold/src/primitives/sparsemt/mod.rs
update_balance
called by 9
client/src/circuits/mod.rs
update_and_prove
called by 8
plasma-fold/src/primitives/sparsemt/mod.rs
try_into
called by 7
plasma-fold/src/datastructures/transaction/constraints.rs
parent
called by 7
plasma-fold/src/primitives/sparsemt/mod.rs
advance_epoch
called by 5
aggregator/src/lib.rs
update_root
called by 5
plasma-fold/src/primitives/sparsemt/constraints.rs

Shape

Method 96
Function 65
Class 63
Interface 4
Enum 3

Languages

Rust100%

Modules by API surface

plasma-fold/src/primitives/sparsemt/mod.rs37 symbols
client/tests/web.rs19 symbols
aggregator/src/circuit.rs18 symbols
plasma-fold/src/primitives/sparsemt/constraints.rs16 symbols
aggregator/src/lib.rs13 symbols
plasma-fold/src/primitives/schnorr.rs10 symbols
plasma-fold/src/datastructures/transaction/mod.rs10 symbols
plasma-fold/src/primitives/crh/mod.rs9 symbols
mock-contract/src/lib.rs9 symbols
plasma-fold/src/primitives/crh/constraints.rs8 symbols
plasma-fold/src/datastructures/keypair/mod.rs8 symbols
plasma-fold/src/circuits/gadgets/mod.rs7 symbols

For agents

$ claude mcp add plasma-fold \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact