plasma-group / pigi

:pig: M :heartpulse: O :carousel_horse: N :cherry_blossom: O :space_invader: R :cherry_blossom: E :carousel_horse: P :heartpulse: O :pig:
MIT License
69 stars 30 forks source link

Optimistic Rollup Contracts & Final Edits #396

Closed karlfloersch closed 5 years ago

karlfloersch commented 5 years ago

One key component to optimistic rollup is the state transition verifier. In it’s simplest form this component simply verifies the following:

verifyStateTransition(prestate, transaction, poststate) -> bool

If verifyStateTransition(...) returns false then we know something has gone horribly wrong & we will need to invalidate that block & any child blocks.

Verifying the state transition means we need to specify the state & state transition format. For this initial PoC we will keep state commitments quite simple. We will use a sparse merkle tree (SMT) to reduce tree insertion complexity. This SMT may end up being very shallow if we determine that a SMT of depth 256 is too inefficient.

The actual process of verifyStateTransition(...) consists of: 1) verify inclusion of all inputs, and 2) run the transaction, insert all outputs into state tree, & verify root hash. We can call step 1 verifyInput(...) & step 2 verifyOutput(...)

karlfloersch commented 5 years ago

we did it we did it reddit reddit