diff --git a/da/da_calculators/README.md b/da/da_calculators/README.md new file mode 100644 index 0000000..ee08c06 --- /dev/null +++ b/da/da_calculators/README.md @@ -0,0 +1,22 @@ +# DA Calculators + +Interactive parametric calculators for the Logos Blockchain Data Availability layer. Both calculators run entirely in the browser with no dependencies beyond the bundled libraries. + +## Calculators + +### [DA Sampling Calculator](da_calculator.html) + +Explores the statistical properties of the Logos Blockchain DA sampling protocol. Models data availability sampling as a binary hypothesis test and provides interactive tools to sweep parameter spaces and observe how sampling configuration affects error bounds and chain growth dynamics. + +### [Adversary Attack Surface Calculator](adversary_calculator.html) + +Analyses the capabilities of an adversary who controls a fraction of DA nodes. Models two complementary attacks — making available data appear unavailable (Attack A, liveness threat) and making unavailable data appear available (Attack B, safety threat) — and shows how each protocol parameter shapes the adversary's effective capability as a function of the adversarial node fraction p_d. + +## Usage + +Open either HTML file directly in a browser. No build step or server required. + +## Related Documents + +- [Data Availability — Statistical Properties of Sampling](https://www.notion.so/Data-availability-statistical-properties-of-sampling-2d1261aa09df805facbcfd8184009928) +- [Adversary — Selective Availability Attack](https://www.notion.so/nomos-tech/Adversary-Selective-Availability-Attack-General-Analysis-32f261aa09df80ac922be1d774095321) diff --git a/da/da_calculators/README_adversary.md b/da/da_calculators/README_adversary.md new file mode 100644 index 0000000..a5ba599 --- /dev/null +++ b/da/da_calculators/README_adversary.md @@ -0,0 +1,97 @@ +# Adversary Attack Surface Calculator + +**Live:** [adversary_calculator.html](adversary_calculator.html) + +Interactive calculator for analysing the capabilities of an adversary who controls a fraction of DA nodes in the Logos Blockchain DA layer. Derives general formulas for two complementary attacks and shows how each protocol parameter shapes the adversary's effective capability as a function of the adversarial node fraction p_d. + +--- + +## Background + +This calculator assumes a **silence-only adversary model**: adversarial nodes simply do not respond to sampling requests. They do not send false proofs or invalid data. The analysis of adversarial nodes that respond with equivocating proofs is a separate topic. + +Two attacks are modelled: + +**Attack A — Available → Unavailable (Type II exploitation)** +The data is genuinely available. The adversary instructs controlled nodes to withhold responses from targeted validators, causing them to observe fewer than τ successes and declare the data unavailable. This is a liveness threat: honest leaders waste slots, validators develop split views, chain growth slows. + +**Attack B — Unavailable → Available (Type I exploitation)** +The adversary is the encoder. It disperses data only to its fully controlled subnetworks and withholds from the rest. Validators that happen to sample only adversarially controlled subnetworks receive valid responses and incorrectly conclude the data is available. This is a safety threat. + +--- + +## Parameters + +| Parameter | Description | Default | +| --- | --- | --- | +| N | Total subnetworks = total columns in expanded data | 2048 | +| e | RS expansion factor | 2 | +| R | Nodes assigned to each subnetwork | 5 | +| S | Subnetworks sampled per validation round | 20 | +| τ | Acceptance threshold (declare available if ≥ τ successes out of S) | 13 | +| t | Nodes queried per subnetwork before declaring it failed (1 ≤ t ≤ R) | 5 | +| p_d | Adversarial node fraction (%) | 33 | + +--- + +## Core Formulas + +**Subnetwork failure probability** — probability all t queried nodes are adversarial given a adversarial nodes out of R: + +``` +P_fail(a, R, t) = C(a,t) / C(R,t) for a ≥ t, else 0 +``` + +**Effective subnetwork failure probability** — averaged over the adversarial occupancy distribution: + +``` +P_fail_eff(p_d, R, t) = Σ_{a=t}^{R} B(R, a, p_d) · P_fail(a, R, t) +``` + +**Attack A probability** — validator needs S−τ+1 failures: + +``` +P_A(p_d, R, t, S, τ) = Σ_{j=S−τ+1}^{S} C(S,j) · P_fail_eff^j · (1−P_fail_eff)^{S−j} +``` + +**Attack B probability** — adversary needs τ hits from Y_full = N·p_d^R captured subnetworks: + +``` +P_B(p_d, R, N, S, τ) = Σ_{g=τ}^{S} Hypergeometric(N, Y_full, S, g) +``` + +--- + +## Regime Thresholds + +The adversarial fraction p_d determines which attack regime the network is in: + +| Regime | Condition | Threat | +| --- | --- | --- | +| Safe | p_d < (τ/S)^{1/R} | Neither attack effective | +| Attack A only | (τ/S)^{1/R} ≤ p_d < (1−1/e)^{1/R} | Liveness risk | +| Attack A + B | p_d ≥ (1−1/e)^{1/R} | Liveness + safety risk | + +The Attack B threshold (1−1/e)^{1/R} always exceeds 0.5 for any e ≥ 2 and R ≥ 1. No sub-majority adversary can threaten global data recovery in expectation. + +--- + +## Tabs + +### Attack A vs B +Shows both P_A and P_B as functions of p_d at current parameters. The regime bar shows which zone the current p_d falls in, with a teal marker. + +### τ effect +Shows P_A and P_B curves for multiple τ values simultaneously. τ is the sole parameter with opposite effects on the two attacks: +- Higher τ → Attack A easier (S−τ+1 failures needed, decreasing) +- Higher τ → Attack B harder (τ hits needed, increasing) + +Regime bars show how the Attack A threshold shifts with τ while the Attack B threshold stays fixed. + +### t effect +Shows P_A for multiple t values and P_B for multiple t values. All P_B curves are identical — t has zero effect on Attack B. P_A curves decrease as t increases, with t=R eliminating all partial-capture contribution. + +### R effect +Shows both P_A and P_B curves for R ∈ {1, 3, 5, 7, 10}. Both attacks collapse exponentially as R increases. Both regime thresholds shift right. R is the primary structural defence parameter. + +--- diff --git a/da/da_calculators/README_da_sampling.md b/da/da_calculators/README_da_sampling.md new file mode 100644 index 0000000..f3da0cb --- /dev/null +++ b/da/da_calculators/README_da_sampling.md @@ -0,0 +1,71 @@ +# DA Sampling Calculator + +**Live:** [da_calculator.html](da_calculator.html) + +Interactive calculator for the Logos Blockchain data availability sampling protocol. Models sampling as a binary hypothesis test and allows interactive exploration of how protocol parameters affect Type I error, Type II error, grey zone width, wasted slots, and blockchain security horizon. + +--- + +## Background + +Logos Blockchain DA uses column sampling to verify data availability without downloading the entire dataset. A node draws S columns uniformly at random and applies a threshold decision rule: declare the blob available if at least τ out of S samples succeed. + +This produces two error types that cannot be minimised independently: + +- **Type I error α(τ)** — data is unrecoverable but sampling concludes it is recoverable. Threatens chain safety. +- **Type II error β(τ, Δ)** — data is recoverable but sampling concludes it is unrecoverable. Wastes slots, threatens liveness. + +The calculator computes exact hypergeometric expressions for both errors and derives all downstream quantities from them. + +--- + +## Parameters + +| Parameter | Description | Default | +| --- | --- | --- | +| N | Total columns = total subnetworks (N = r·K) | 2048 | +| r | RS expansion factor | 2 | +| K | Reconstruction threshold = N/r | 1024 | +| S | Sample size (columns drawn per round) | 20 | +| τ | Acceptance threshold (declare available if ≥ τ successes) | 20 | +| Δ | Grey zone width (derived from ε target) | 500 | +| ε | Error bound target | 10⁻⁴ | +| N_B | Blobs per block | 1024 | +| n | Number of validator nodes | 50 | +| f | Slot fill rate | 1/30 | +| T | Slots per epoch | 388800 | + +--- + +## Tabs + +### Detection Probability +Shows P(data detected as recoverable) as a function of N_A/N (fraction of available columns). Illustrates the grey zone between unrecoverable (N_A ≤ K) and certified recoverable (N_A ≥ K+Δ) regions. + +### α & β Curves +Plots α(τ) and β(τ, Δ) on a log₁₀ scale as functions of the threshold τ. The intersection of the two curves shows the jointly optimal τ* that minimises max{α, β}. + +### Multi-Δ Overlay +Compares α and β curves for multiple Δ values simultaneously, showing how the grey zone width affects the tradeoff. + +### τ* vs ε Sweep +Plots the jointly optimal τ*(ε) and Δ*(ε) as functions of the error bound ε for multiple sample sizes S. Shows how tightening ε requires increasing Δ. + +### Network Bounds +Shows the network-level error bounds as a function of validator count n: +- Left panel: P(majority accepts unrecoverable block) = 2ⁿ · ε^{N_B·⌈n/2⌉} +- Right panel: P(majority rejects recoverable block) = 2ⁿ · [1−(1−ε)^{N_B}]^{⌈n/2⌉} + +### Chernoff Bound +Plots the Chernoff-based bounds for the grey zone regime. + +### Block Builder +Shows the q-quantile of the hitting time τ_{N_B,q} — the number of blobs a block builder must consider to fill a block with N_B valid blobs, as a function of ε and N_B. + +### Wasted Slots +Shows the average number of wasted slots per epoch as a function of validator count n, across three regimes (Code 2 basic upper bound, Code 3 tight Chernoff upper bound, Code 4 lower bound). + +### Blockchain +Shows the median time T₁/₂ to the first invalid block accepted by a majority of validators, as a function of validator count n and error bound ε. + +--- diff --git a/da/da_calculators/adversary_calculator.html b/da/da_calculators/adversary_calculator.html new file mode 100644 index 0000000..d9e1ad6 --- /dev/null +++ b/da/da_calculators/adversary_calculator.html @@ -0,0 +1,476 @@ + + + + + + Adversary Attack Surface Calculator + + + +
+ + + + + + + diff --git a/da/da_calculators/da_calculator.html b/da/da_calculators/da_calculator.html new file mode 100644 index 0000000..d5759a6 --- /dev/null +++ b/da/da_calculators/da_calculator.html @@ -0,0 +1,1999 @@ + + + + + + DA Sampling Calculator + + + +
+ + + + + + + \ No newline at end of file diff --git a/da/da_calculators/index.html b/da/da_calculators/index.html new file mode 100644 index 0000000..d028c86 --- /dev/null +++ b/da/da_calculators/index.html @@ -0,0 +1,64 @@ + + + + + + Logos DA Calculators + + + +
LOGOS BLOCKCHAIN — DATA AVAILABILITY LAYER
+

DA Calculators

+

Interactive parametric calculators for the Logos Blockchain DA protocol. Open directly in any modern browser.

+ +
+ +
SAMPLING ANALYSIS
+
DA Sampling Calculator
+
+ Models data availability sampling as a binary hypothesis test. Sweep parameter spaces and observe how sampling configuration affects Type I/II error bounds, grey zone width, wasted slots, and blockchain security horizon. +
+
+ Hypergeometric + α / β errors + Grey zone Δ + Wasted slots + T₁/₂ security + Block builder +
+
+ + +
ADVERSARIAL ANALYSIS
+
Adversary Attack Surface Calculator
+
+ Analyses the capabilities of an adversary controlling a fraction p_d of DA nodes. Models Attack A (liveness) and Attack B (safety) and shows how each protocol parameter shapes adversarial effectiveness. +
+
+ Attack A (Type II) + Attack B (Type I) + p_d regimes + τ / t / R effect + Silence model +
+
+
+ +