Single-head Gummiworm overview
This section describes the Gummiworm consensus protocol. Gummiworm is a distributed system that manages a private L2 ledger and its interactions with a public L1 blockchain. The system consists of a head network and a coil network.
In the head network, the head peers collectively:
- Start from a pre-agreed joint (i.e., L1 and L2) ledger state.
- Receive requests submitted by users.
- Decide on a total order for those requests.
- Validate and apply those requests in that order to the L2 ledger state, tracking their outcomes.
- Derive (deterministically) the effects of the requests on the L1 ledger, based on their outcomes.
- Consent to the effects.
Head peers run this process quickly among themselves (see example below). The coil independently verifies their work and joins in authorizing the resulting L1 effects.
In the coil network, the coil peers collectively:
- Start from the pre-agreed joint ledger state.
- Receive the requests that users submitted to the head peers.
- Receive the total order and outcomes of the requests as determined by the head peers.
- Verify the total order and outcomes of the requests.
- Rederive the effects of the requests on the L1 ledger, based on their outcomes.
- Consent to the effects, if verification succeeded.
Each effect is confirmed when all head peers and a quorum of coil peers have consented to it. Gummiworm then executes confirmed effects on the L1 blockchain, re-executing as necessary, to converge the L1 blockchain’s state to Gummiworm’s confirmed prospective L1 state.
Each request is confirmed if all of its effects are confirmed.
A head can also be closed normally through a finalization effect, which settles all outstanding obligations before the head winds down.
If the consensus protocol fails or stalls instead, Gummiworm automatically transitions to a rules-based regime. In this regime, Gummiworm’s smart contracts enforce an orderly evacuation of funds based on the latest confirmed L2 state compatible with Gummiworm’s state on the L1 blockchain.
Example. Each head peer independently receives user requests from users (circles denote deposit requests, squares denote transaction requests; color identifies the peer):
Fast consensus merges those streams into a single total order, and the L2 ledger determines each request’s outcome (valid or invalid):