A Python toolkit for FRIDA: Data Availability Sampling from FRI, based on the paper "FRIDA: FRI-based Data Availability Sampling" (2024).
- Compute optimal FRIDA parameters (rounds, repetitions) for any data size.
- Multiple schemes: FRIDA, Merkle, Hash, Tensor, TDAS, LT, RS, etc.
- Export performance metrics to CSV.
- Generate LaTeX tables and publication-quality plots.
- Bin–Ball sampling simulation in
collectiveBallsInBins/.
fri.pyCore FRI/FRIDA parameter computation and scheme assembly.schemes.pyUnderlying codes: Reed–Solomon, Hash, Pedersen, etc.codes.pyLow-level algebraic code definitions.Listing4.pyGenerate summary table in terminal or LaTeX.Listing5.py–Listing7.pyExport scheme metrics to CSV for different parameters.plot_*.pyPlot scripts for commitment size, query cost, total cost, encoding, samples.collectiveBallsInBins/Bin–Ball sampling scripts and precomputed plots (*.py,figs/).csvdata/Collected CSV metrics for all schemes.figs/Generated figures (PDF/PNG).table/LaTeX source (table.latex) for summary tables.README.mdThis file.LICENSEMIT License.
- Python ≥3.8
- pip
git clone https://github.com/your-org/transparentSampling.git
cd transparentSampling
python -m venv venv # Optional virtual environment
.\venv\Scripts\Activate
pip install pandas numpy matplotlib tabulatefrom fri import makeFRIScheme
scheme = makeFRIScheme(datasize=32*1024*1024, invrate=4, fsize=128, verbose=True)
print(scheme)python Listing4.py <datasize_in_MB> # Default table in text
python Listing4.py <datasize_in_MB> -l # LaTeX table
# Output LaTeX saved under table/table.latexpython Listing5.py # Vary datasize
python Listing6.py # Vary invrate (n/k ratio)
python Listing7.py # Vary both invrate and k for sample metricsCSV files are stored in csvdata/.
python plot_com.py # Commitment size
python plot_comm_pq.py # Query cost
python plot_comm_total.py # Total communication
python plot_encoding.py # Encoding overhead
python plot_hash_sample.py # Sample count comparison
# Additional scripts with `_kn` suffix for fixed k/nFigures saved in figs/ or collectiveBallsInBins/figs/.
Navigate to collectiveBallsInBins/ and run:
python plot_samples_to_prob.py # Plot failure probability vs samples
python plot_to_prob_bin.py # Bin–probability mappingSee collectiveBallsInBins/figs/ for output.
CSV files in csvdata/ are named <scheme>_<metric>.csv, e.g.:
fri_com.csvCommitment size vs. data dimensionhash_comm_pq.csvPer-query communication costrs_samples.csvSample count for RS scheme
If you use this work, please cite:
J. Doe et al., "FRIDA: FRI-based Data Availability Sampling", XYZ 2024.
MIT License – see LICENSE.