PegaSys Ledger
The PegaSys ledger is a core component of the network, responsible for recording transactions, maintaining account balances, and ensuring the integrity of the system. Every time the PegaSys Hub generates a valid aggregated signature for a transaction, the transaction will be added to a block’s operation log through an additional consensus round. Each block in the ledger consists of the following elements:
Block Number: The block number provides a logical ordering for all blocks.
Account Tree: A MS-SMT (Merkle Sum Sparse Merkle Tree) [6] that stores every user’s current balance (deposit + fees accrued). The root of this tree therefore commits to the total User Deposits DT as of block time T.
Lightning Channel Commitment Tree: A Merkle Sum Tree built over an exhaustive list of the Lightning Channel Commitment Transactions describing the latest state of each Lightning Channel the System is a participant of. The leaves commit to a lightning channel commitment, while the internal nodes commit to their children as well as the sum of the System’s share in each of the Lightning Channels described by each of their children at the block number T. The root of this tree therefore commits to the total amount RT deployed by the network into all Lightning Channels at T.
Operation Log: The operation log is a regular Merkle Tree that commits to the list of all actions signed by the network since the last block. This will include the actions for channel bootstrap, channel settlement, intermediate routing HTLC commitments and post-routing commitments. The Merkle Sum Tree structure for the Account Tree and the Commitment Tree is chosen for efficient verification of the solvency of the network, and a fraud-proof construction based on this data is described in this section.
Withdrawals
PegaSys employs an optimistic withdrawal scheme. Initially, the user sends a withdrawal request to at least f+1 PegaSys nodes - guaranteeing that at least 1 honest node receives the request and broadcasts it to the rest of the network. Then, the system reaches consensus on how to compose a withdrawal payment for the user’s current balance in the Account Tree. Once these actions are completed, the system creates a transaction with a UTXO spendable by the user’s public key. In the case that the network does not comply to the user’s request, the user can initiate a forced withdrawal by appealing to a “higher” authority.
Last updated