# Modeling Ethereum's Fusaka PeerDAS: A Computational Analysis of Reed-Solomon Erasure Coding ## 1. Introduction ### 1.1 The Data Availability Bottleneck In the pursuit of scaling decentralized blockchains, the network faces a critical bottleneck known as the Data Availability (DA) problem. In a traditional 'monolithic' architecture, security dictates that every node must download and verify the entire history of the chain. While this ensures integrity, it creates a rigid ceiling on throughput; simply increasing block sizes to accommodate the growing demand from Layer 2 Rollups would impose prohibitive hardware requirements, inevitably centralizing the network. To address this, the Ethereum roadmap has shifted towards a "Rollup-Centric" architecture, culminating in the introduction of **Blob-carrying transactions (EIP-4844)** and the upcoming **PeerDAS (Peer Data Availability Sampling)** implementation. These upgrades introduce a new data structure, the "Blob", which allows the network to reach consensus on data *availability* without requiring every node to download the underlying data *content*. ### 1.2 The Core Dependency: Mathematical Extension The viability of this architecture rests entirely on a single architectural dependency: **Erasure Coding**. For PeerDAS to function, the network relies on a mathematical guarantee: that a dataset can be reconstructed in its entirety even if a significant portion of it is lost or withheld by malicious actors. Specifically, the "Fusaka" (Fectra/Osaka) roadmap relies on a 2-dimensional Reed-Solomon extension scheme. This scheme extends the data set by a factor of 2 (adding 100% parity overhead) under the assumption that this redundancy allows for the recovery of the full blob from any 50% subset of the data. ### 1.3 Research Objective While the mathematical theorems behind Reed-Solomon codes are well-established, visualizing and verifying their practical application in a decentralized context is crucial for understanding the robustness of the network. This research note aims to: 1. **Model the Dependency:** Create a computational model of the Data Availability reconstruction process using Python. 2. **Verify the Thesis:** Empirically demonstrate that a standard Ethereum blob, when encoded with a 2x extension factor, maintains full integrity even when subjected to the maximum theoretical data loss (50%). 3. **Analyze Performance:** Benchmark the computational cost of this reconstruction to validate its feasibility for real-time network clients. --- ## 2. Theoretical Framework: PeerDAS & Erasure Coding ### 2.1 The Data Availability Problem and PeerDAS Ethereum’s solution, **PeerDAS**, shifts the verification model from "downloading everything" to "sampling specifically." Instead of downloading a full 128KB blob, a node randomly requests small chunks (samples) of the data. If enough nodes successfully retrieve their random samples, the network probabilistically guarantees that the data is available. However, simple sampling is insufficient. If a block proposer withholds just 1% of the data, a node might not detect it via random sampling, yet that missing 1% could render the entire transaction invalid. To solve this, PeerDAS relies on **Reed-Solomon (RS) erasure coding**. ### 2.2 Reed-Solomon Erasure Coding The core dependency of the PeerDAS architecture is Reed-Solomon (RS) erasure coding. Unlike simple replication (copying data multiple times), RS coding extends the dataset mathematically, transforming the data into a format where the information is "holographically" distributed across the entire set. This ensures that the loss of specific bytes does not result in the loss of specific information, provided a minimum threshold of data remains. In the context of Ethereum, this is often referred to as a **2x Extension** strategy: 1. **Input:** A data vector $D$ of size $k$ (the original blob). 2. **Encoding:** The data is extended to a codeword $C$ of size $n$, where $n = 2k$. 3. **Output:** A dataset consisting of $k$ data symbols and $k$ parity symbols. ![Mechanism design (1)](https://hackmd.io/_uploads/BJgqWIHWWl.png) This configuration implies that for any set of $k$ symbols retrieved from the network, whether they are original data chunks, parity chunks, or a mix of both, the decoder can solve the linear system to recover the original $k$ data symbols perfectly. ### 2.3 Mathematical Foundation: Polynomial Interpolation The recoverability property of Reed-Solomon codes is derived from **Polynomial Interpolation over Finite Fields** (specifically Galois Fields). The mechanism operates on the fundamental theorem of algebra: > A unique polynomial of degree $k-1$ is determined by exactly $k$ points. In this framework: * The original data chunks are treated as $y$-coordinates (points) on a polynomial curve $P(x)$. * Because the data consists of $k$ chunks, the polynomial is of degree $k-1$. * The encoding process evaluates this polynomial at $n$ distinct points (where $n=2k$). **The Reconstruction Thesis:** Because any $k$ points are sufficient to uniquely reconstruct a polynomial of degree $k-1$ (via Lagrange Interpolation), any subset of the extended dataset $C$ of size $k$ allows for the perfect reconstruction of the original polynomial, and thus the original data. --- ## 3. Methodology: Modeling the Dependency To empirically verify the reconstruction properties of PeerDAS, we developed a computational simulation using Python. The objective was to model the "2x Extension" dependency and determine if a standard Ethereum blob could be fully recovered after sustaining the maximum theoretical data loss (50%). ### 3.1 Simulation Environment The simulation utilized the `reedsolo` library, a pure-Python implementation of Reed-Solomon error correction. The environment was configured to mirror the structural properties of EIP-4844 blobs, specifically focusing on the ratio between data size and parity overhead. ### 3.2 Data Construction and Segmentation To accurately model a 128KB Ethereum blob within standard library constraints ($GF(2^8)$), we implemented a **Row-Based Sharding** strategy: 1. **Blob Generation:** A pseudo-random byte stream of 131,072 bytes (128KB) was generated to represent the transactional payload. 2. **Segmentation:** The payload was sliced into $R$ rows, where each row contained a discrete chunk of data ($d_{row} = 100$ bytes). 3. **Extension:** For each row, we applied Reed-Solomon encoding with an expansion factor of 2. We appended $p_{row} = 100$ parity bytes, resulting in a total row size of 200 bytes. ![peerdas matrix](https://hackmd.io/_uploads/HyiE-SSZbl.png) ### 3.3 Erasure Experiment To test the resilience of the architecture, we simulated a "Worst-Case Availability Scenario." * **Targeting:** Indices $100$ through $199$ (the Parity section) were identified for every row. * **Destruction:** These bytes were explicitly overwritten with zeros, effectively destroying the redundancy layer. * **Erasure Mapping:** Crucially, the simulation recorded the *indices* of the destroyed bytes. This models the PeerDAS mechanism, where a client is aware of *which* samples failed to download. --- ## 4. Results & Analysis ### 4.1 Reconstruction Integrity The simulation empirically validated the core thesis of the PeerDAS architecture. * **Input:** A 128KB random binary blob (partitioned into 1,311 shards). * **Loss Vector:** 50% of the total dataset (Data + Parity) was erased. * **Outcome:** The decoding algorithm successfully reconstructed 100% of the original data. A binary comparison confirmed that the reconstructed blob was bit-for-bit identical to the original input ($D_{reconstructed} == D_{original}$). This confirms that under a 2x extension scheme, the **Information Theoretic Threshold** is exactly 50%. As long as the sampling nodes collectively hold half of the extended data, the full blob remains retrievable. ### 4.2 The "Cliff Edge" of Availability To define the precise limits of this dependency, a secondary experiment was conducted where the data loss was increased to $50\% + 1 \text{ byte}$. ![peerdascliff](https://hackmd.io/_uploads/r1a734SWbe.png) * **Result:** The reconstruction failed immediately. * **Analysis:** This demonstrates the "all-or-nothing" property of polynomial interpolation. Unlike heuristic repair methods, Reed-Solomon is binary. If available symbols $< k$, the system has infinite solutions for the polynomial curve, rendering the data mathematically irretrievable. ### 4.3 Computational Performance The simulation also benchmarked the computational cost of this reconstruction: * **Encoding Time (Prover):** ~0.2 seconds per 128KB blob. * **Reconstruction Time (Verifier):** ~0.6 to 1.5 seconds. While this Python-based simulation operates in an interpreted environment, the linear performance scaling indicates that compiled implementations (such as Ethereum’s Go/Rust clients) can perform this operation in the order of milliseconds, validating its feasibility for real-time block verification. --- ## 5. Limitations of the Simulation While this computational model successfully validates the information-theoretic threshold of Reed-Solomon erasure coding, it is important to distinguish the simulation environment from the production constraints of the Ethereum Mainnet. ### 5.1 KZG Commitments vs. Pure Reed-Solomon The primary abstraction in this study is the use of standard Reed-Solomon encoding over a generic field. In the actual EIP-4844 and PeerDAS specifications, Ethereum utilizes **KZG (Kate-Zaverucha-Goldberg) Commitments**. * **The Simulation:** Focuses purely on *Data Reconstruction* (can we rebuild the bytes?). * **Ethereum Mainnet:** Requires both *Reconstruction* AND *validity proofs*. KZG allows nodes to verify that a specific chunk belongs to a specific polynomial without downloading the entire blob. * *Impact:* This simulation does not model the generation or verification of KZG proofs, which adds a distinct computational overhead (elliptic curve pairings) not captured here. ### 5.2 Field Size Discrepancy To utilize standard Python libraries, this simulation operated over the Galois Field $GF(2^8)$ (byte-level arithmetic). Ethereum’s PeerDAS operates over the **BLS12-381 scalar field** (a massive prime field of size $\approx 5.2 \times 10^{77}$). * *Impact:* While the 50% reconstruction threshold remains a universal mathematical constant regardless of field size, the efficiency of "packing" data into polynomials differs. The BLS12-381 curve allows 128KB blobs to be represented as a single polynomial (4096 elements), whereas our model relied on sharding the data into 1,311 smaller rows. ### 5.3 Network Latency vs. CPU Time Our benchmarks measured the **CPU time** required to reconstruct data once it is present in memory. In a live PeerDAS network, the bottleneck is often **Network Propagation Latency**, the time required to query peer nodes and download the missing samples over the wire. * *Impact:* The 1.5-second reconstruction time reported here is a "best-case" scenario assuming instant data availability in local memory. Real-world recovery would be bounded by network bandwidth and peer health. --- ## 6. Conclusion ### 6.1 Summary of Findings This research note set out to determine if the core mathematical dependency of Ethereum’s data availability roadmap, Reed-Solomon erasure coding, could be modeled and verified in a simplified computational environment. The simulation successfully demonstrated that by extending a dataset with a $2x$ expansion factor, the information content becomes robust against catastrophic data loss, validating the threshold required for PeerDAS. ### 6.2 Implications for Fusaka These findings are central to the upcoming **Fusaka** (Fectra/Osaka) upgrade cycle. As Ethereum moves toward full Danksharding, the network will rely on PeerDAS to increase blob capacity. Our simulation proves that the cryptographic "safety net" provided by erasure coding is mathematically sound, allowing the network to decouple **Data Bandwidth** (downloading) from **Data Capacity** (storing). ### 6.3 Final Thought Ultimately, this dependency transforms the problem of scaling from a hardware challenge into a mathematical one. Through the elegance of polynomial interpolation, we can scale the "World Computer" not by forcing every computer to work harder, but by allowing them to work smarter, verifying the whole by only holding a part. #### Resources GitHub repository for simulation code: https://github.com/brownneth/ethereum-peerdas-simulation