Documentation

CslibFrontier.Computability.Distributed.AsyncByzantine.Bracha

Bracha's asynchronous Byzantine reliable broadcast (n > 3t) #

This module formalizes the streamlined three-phase presentation of Bracha's asynchronous reliable broadcast protocol (brachaProtocol, [Bra87]) and proves its correctness against up to t static Byzantine faults whenever 3 * t < n, where n = Fintype.card P. Combined with CslibFrontier.Computability.Distributed.AsyncByzantine.Impossibility and directProtocol, exists_solvesReliableBroadcast_iff gives the sharp threshold: for any nonempty value domain V, deterministic asynchronous Byzantine reliable broadcast tolerating t faults exists if and only if n ≤ 2 or 3 * t < n.

Streamlined echo rule (difference from [Bra87] original rule) #

In this formalization, a correct process sends echo v only upon receiving its first initial v message directly from dealer. In some presentations of Bracha's original protocol, a process also emits echo v upon receiving echoThreshold n t echo v or t + 1 ready v messages when it has not yet sent an echo. Omitting those echo-amplification branches yields the same safety and liveness guarantees under n > 3t (because ready amplification and the honest-echo quorum still force totality and consistency), keeps the exact O(n²) message bound tighter, and avoids checking an extra transition rule; see the brachaStep specification below.

The protocol #

Every process maintains BrachaState P V: write-once fields recording the single ECHO and READY values it has emitted (sentEcho, sentReady : Option V), and per-sender tables storing the first ECHO and first READY received from each sender j : P (echoFrom, readyFrom : P → Option V). Keeping only the first message per sender deduplicates Byzantine replays and equivocations without requiring [Fintype V].

For threshold echoThreshold n t := (n + t) / 2 + 1 = ⌈(n + t + 1) / 2⌉:

  1. Initial phase: if dealer is correct with input = some v, it sends initial v to every process (including itself). Upon receiving its first initial v from dealer, a process sets sentEcho := some v and broadcasts echo v to all processes.
  2. Echo phase: upon receiving the first echo v from src, record echoFrom src := some v. If at least echoThreshold n t distinct senders carry echo v and sentReady is none, set sentReady := some v and broadcast ready v to all processes.
  3. Ready phase: upon receiving the first ready v from src, record readyFrom src := some v.
    • If at least t + 1 distinct senders carry ready v and sentReady is none, set sentReady := some v and broadcast ready v to all processes (amplification).
    • If at least 2 * t + 1 distinct senders carry ready v, deliver v.

Safety, liveness, and communication bound #

Safety uses the echo-quorum witness invariant: whenever a correct process holds sentReady = some v, there exists a quorum S with echoThreshold n t ≤ S.card every correct member of which has sentEcho = some v. Two such quorums intersect in strictly more than t processes (echo_quorum_inter_notMem), hence share a correct process; since each correct process emits at most one echo, all correct sentReady values agree.

By exact telescoping over the counts of correct processes with sentEcho.isSome and sentReady.isSome, brachaSentInTrace_le proves that along every finite execution trace—even under arbitrary Byzantine message flooding—the total number of authentic envelopes emitted by correct processes (Protocol.sentInTrace) is at most n + 2 * (n - F.card) * n.

Main definitions #

Main results #

References #

Threshold arithmetic and quorum intersection #

The Bracha echo-quorum threshold ⌈(n + t + 1) / 2⌉ = (n + t) / 2 + 1.

theorem Cslib.Distributed.AsyncByzantine.echo_quorum_inter_notMem {P : Type u_1} [Fintype P] [DecidableEq P] {F S₁ S₂ : Finset P} {t : ℕ} (hF : F.card ≤ t) (h₁ : echoThreshold (Fintype.card P) t ≤ S₁.card) (h₂ : echoThreshold (Fintype.card P) t ≤ S₂.card) :
∃ p ∈ S₁ ∩ S₂, p ∉ F

Any two echo quorums (of size at least echoThreshold |P| t) share a correct process (∉ F) when F.card ≤ t.

Protocol definition #

Message payloads exchanged by Bracha's three-phase reliable broadcast protocol.

  • initial {V : Type u_1} (v : V) : BrachaMsg V

    Phase 1: original value sent by dealer.

  • echo {V : Type u_1} (v : V) : BrachaMsg V

    Phase 2: echo confirmation of a value.

  • ready {V : Type u_1} (v : V) : BrachaMsg V

    Phase 3: ready amplification/delivery confirmation of a value.

structure Cslib.Distributed.AsyncByzantine.BrachaState (P : Type u_1) (V : Type u_2) :
Type (max u_1 u_2)

Local internal state of a process running brachaProtocol. Retaining only the first message per sender deduplicates Byzantine replays and equivocations without assuming [Fintype V].

  • sentEcho : Option V

    The unique echo value emitted by this process, if any.

  • sentReady : Option V

    The unique ready value emitted by this process, if any.

  • echoFrom : P → Option V

    First echo value received from each sender j : P.

  • readyFrom : P → Option V

    First ready value received from each sender j : P.

def Cslib.Distributed.AsyncByzantine.echoSenders {P : Type u_1} {V : Type u_2} [Fintype P] [DecidableEq V] (st : BrachaState P V) (v : V) :

Senders from whom st has recorded echo v.

def Cslib.Distributed.AsyncByzantine.readySenders {P : Type u_1} {V : Type u_2} [Fintype P] [DecidableEq V] (st : BrachaState P V) (v : V) :

Senders from whom st has recorded ready v.

structure Cslib.Distributed.AsyncByzantine.BrachaStepResult (P : Type u_1) (V : Type u_2) :
Type (max u_1 u_2)

Output record of one local step of Bracha's protocol.

  • nextState : BrachaState P V

    Updated local internal state.

  • outgoing : Multiset (P × BrachaMsg V)

    Outgoing (dest, msg) multiset emitted in this step.

  • delivered : Option V

    Value delivered (some v), if the delivery threshold 2t + 1 was reached.

def Cslib.Distributed.AsyncByzantine.brachaStep {P : Type u_1} {V : Type u_2} [Fintype P] [DecidableEq P] [DecidableEq V] (dealer : P) (t : ℕ) (st : BrachaState P V) (src : P) :

Shared local transition handler for the streamlined three-phase brachaProtocol. Unlike variants that also emit echo v after collecting enough echo/ready messages, this handler emits echo v only upon receiving the first initial v from dealer.

Initial local state of a process running Bracha's protocol.

def Cslib.Distributed.AsyncByzantine.brachaProtocol (P : Type u_1) (V : Type u_2) [Fintype P] [DecidableEq P] [DecidableEq V] (dealer : P) (t : ℕ) :
Protocol P (BrachaState P V) (BrachaMsg V) V dealer

Streamlined three-phase asynchronous Byzantine reliable broadcast protocol for sender dealer and fault threshold t ([Bra87]). A correct process emits echo v only upon its first initial v from dealer (without secondary echo amplification from echo/ready thresholds), then emits ready v and delivers v via the standard echoThreshold n t, t + 1, and 2 * t + 1 thresholds.

Private specification lemmas for brachaStep #

Global inductive invariant #

Liveness helpers and uniform stabilization #

Correctness theorem (n > 3t) #

Bracha's reliable broadcast correctness theorem ([Bra87]). For any finite P with 3 * t < Fintype.card P, arbitrary value type V (no finiteness assumption on V), and any broadcaster dealer : P, the streamlined three-phase protocol brachaProtocol P V dealer t solves asynchronous Byzantine reliable broadcast against t static Byzantine faults.

Exact O(n²) communication complexity #

theorem Cslib.Distributed.AsyncByzantine.brachaSentInTrace_le {P : Type u_1} {V : Type u_2} [Fintype P] [DecidableEq P] [DecidableEq V] (dealer : P) (t : ℕ) (F : Finset P) (input : Option V) {s : State P (BrachaState P V) (BrachaMsg V) V} {xl : List (Action P (BrachaMsg V))} (hmtr : ((brachaProtocol P V dealer t).lts F).MTr ((brachaProtocol P V dealer t).start F input) xl s) :
(brachaProtocol P V dealer t).sentInTrace F input xl ≤ Fintype.card P + 2 * (Fintype.card P - F.card) * Fintype.card P

Exact message-complexity bound for the streamlined brachaProtocol: across any finite execution trace xl (independent of trace length, fault threshold t, or Byzantine flooding), correct processes emit at most n + 2 * (n - F.card) * n authentic envelopes in total (initial + echo + ready).

Exact threshold characterization #

theorem Cslib.Distributed.AsyncByzantine.exists_solvesReliableBroadcast_iff (P V : Type u) [Fintype P] [DecidableEq P] [Nonempty V] (dealer : P) (t : ℕ) :
(∃ (S : Type u) (M : Type u) (x : DecidableEq M) (π : Protocol P S M V dealer), π.SolvesReliableBroadcast t) ↔ Fintype.card P ≤ 2 ∨ 3 * t < Fintype.card P

Exact solvability threshold for asynchronous Byzantine reliable broadcast. For any finite process type P with distinguished broadcaster dealer : P and any nonempty value domain V in the same universe (including a singleton such as Unit), a deterministic asynchronous protocol solving reliable broadcast against t static Byzantine faults exists if and only if Fintype.card P ≤ 2 or 3 * t < Fintype.card P.