The Signal: Ethereum — A Formal Analysis
This documentation provides the complete formal analysis for the TSEth consensus core. It is split into two primary parts, which are best read in order:
-
Formalization of the Consensus Algorithm
- This document formally defines the Atomic Finalization algorithm, its data structures, and proves its compatibility with the standard Casper FFG.
-
Safety Analysis of Balance Drift
- This document provides the detailed mathematical derivation of the safety margin required to account for validator balance drift when verifying proofs from a historical state.
Introduction and Framework
TSEth is a zkVM-friendly implementation of Casper FFG, designed around a simplified Atomic Finalization algorithm. The core of this approach is to verify a state transition from a given consensus state—derived from a previously finalized checkpoint—to a new, target consensus state. This verification is performed within a zkVM guest program, allowing a full node to generate a succinct proof of finality.
This process is initiated by providing the guest program with a consensus state containing a finalized checkpoint. The root of this checkpoint serves as a root of trust, allowing any data from the corresponding Beacon state (like the validator registry) to be proven via Merkle proofs and used as trusted inputs for the guest.
To prove this state transition, the guest program also requires information not contained in the trusted state. The prover must supply a witness that includes the sequence of supermajority links leading to the new finality, as well as auxiliary data like future RANDAO values for committee calculation.
The fundamental challenge is that the guest program must use the validator balances from the trusted state at to validate these attestations. This creates a discrepancy with the official Ethereum protocol, which uses the effective balances from the epoch in which the justification is applied. This balance drift grows with the number of epochs between the trusted checkpoint and the new target.
This body of work provides a formal safety analysis for this balance drift. We derive a conservative upper bound for this drift and use it to define a safety margin (). By requiring the attesting balance in our guest program to exceed the standard two-thirds supermajority by this margin, we can guarantee the safety of the finalized checkpoint, even without access to the most recent state.
Formalization of the Consensus Algorithm
Definition: Consensus State
Given two checkpoints and , where is also called the finalized checkpoint and the current justified checkpoint. We call the ordered pair a Consensus State, when is a predecessor of .
Algorithm: Atomic Finalization
Input:
- A consensus state .
- A sequence of supermajority links .
Procedure:
The algorithm proceeds only if the final link in the sequence, , satisfies the condition . Otherwise, the operation aborts.
Output:
- The new consensus state
Compatibility Analysis with Casper FFG
We argue the compatibility of our Consensus Algorithm with Casper FFG, assuming no 2-finalizations occur. The finalized_checkpoint
and current_justified_checkpoint
fields in the Beacon state induce a valid consensus state.
Definition: Induced Consensus State
We call a consensus state induced by the Beacon state at checkpoint , when matches the finalized_checkpoint
field and matches the current_justified_checkpoint
field of the Beacon state as referenced by the checkpoint .
Theorem 1
Let and be two finalized checkpoints in a view of Casper FFG, where is a predecessor of . Let be the chain of supermajority links ("attestations") included in the blocks between and that cause to be finalized. Executing the Atomic Finalization algorithm with the consensus state induced by and the chain of supermajority links ("attestations") included in the blocks between and , will return the consensus state induced by .
Proof:
By definition, for Casper FFG to finalize a checkpoint , there must exist a supermajority link from a justified checkpoint to , where . The sequence of attestations represents the chain of justifications leading to this final link. Our algorithm's procedural check, , directly mirrors this requirement. The algorithm's output therefore corresponds to , which is precisely the new (finalized_checkpoint
, current_justified_checkpoint
) state in Casper FFG.∎
This shows that our consensus algorithm will always be able to follow the Beacon chain's consensus, as long as there are no cases of 2-finality.
Theorem 2
Let be a finalized checkpoint in a view of Casper FFG. Let denote the output of our algorithm when executed with the consensus state induced by and a valid set of supermajority links as input. Under the accountable safety assumption ( of the validators by weight violate a slashing condition), will also be finalized for .
Proof Sketch:
This follows directly from Casper FFG's guarantee against finalizing conflicting checkpoints. Assume for contradiction that our algorithm finalizes but does not. This would require to justify a pair of checkpoints that "surround" the supermajority link that our algorithm used.
The existence of both the link and a surrounding link is a slashable "surround vote" offense. Therefore, a supermajority of honest validators would never create this situation. Any valid view must respect the finalization of . ∎
While is safe, is only justified. Due to malicious behavior or network latency issues, a failure to justify in is theoretically possible and would represent a liveness fault, not a safety violation.
A Note on 2-Finality
This algorithm deliberately excludes cases of 2-finality, as they introduce significant complexity to our atomic, single-chain model.
The core challenge lies with finalization rules such as a supermajority link , which finalizes . For this rule to be valid, both and must be justified. Our algorithm is designed to process one continuous chain of justifications from a single starting checkpoint (), whereas a 2-finality rule would require verifying two distinct justification chains.
One might think the Beacon state's previous_justified_checkpoint
and current_justified_checkpoint
fields could serve as these two required checkpoints. However, this is not a reliable solution. The previous_justified_checkpoint
field is defined as the current_justified_checkpoint
of the previous epoch. This can lead to situations with an intermediate justified checkpoint that isn't captured by either field. For example, previous_justified_checkpoint
could be and current_justified_checkpoint
could become , while was justified in the interim (Case 1 and Case 3 of Fig. 8. in Combining GHOST and Casper).
Fortunately, the FFG version implemented in the Ethereum Beacon Chain introduces practical constraints that simplify this problem. By only considering the justification status of the last four epochs and imposing other timing conditions, it prevents the most complex theoretical 2-finality scenarios from occurring. This ensures the conditions can be verified without needing a more complex algorithm that takes multiple justification chains as input.
Nevertheless, adapting our clean, single-chain model to formally handle even these simplified 2-finality rules would add considerable complexity. We therefore leave this extension for a future revision.
Safety Analysis of Balance Drift
The Safety Margin Formula
Key Variables and Notation
Let the trusted, finalized checkpoint be denoted by the pair , and the target checkpoint whose finality is being proven be . The number of elapsed epochs is . We define the following:
-
Validator Sets:
- : The set of active validators at .
- : The set of active validators at .
- : The subset of validators that have attested to the supermajority link required to justify .
-
Total Active Balance:
- : The total effective balance of all validators in , measured at . This is the value
get_total_active_balance
would return at . - : The total effective balance of all validators in , measured at .
- : The total effective balance of all validators in , measured at . This is the value
-
Attesting Weight:
- : The sum of the effective balances of the validators in , as measured from the trusted state at . This is the value our zkVM guest program calculates.
- : The sum of the effective balances of the validators in , as measured by the canonical protocol at . This is the value we are trying to safely reason about.
Derivation
The canonical requirement for finality is that the attesting weight at meets the two-thirds threshold:
To create a bound verifiable from the trusted state at , we must account for the maximum possible "balance drift". As slashings that occur after cannot be known from the trusted state, the total balance of these slashed validators must be provided as a separate input, . We then define:
- A: The maximum possible increase in the effective balance of the non-attesting validators () between and .
- E: The maximum possible decrease in the effective balance of the attesting validators () between and .
- S: The total effective balance of validators slashed between and . While slashed validators are penalized, their balance still contributes to the total active balance () for the supermajority calculation, but they are excluded from the attesting weight ().
The safety condition, as viewed from , can be expressed as:
Rearranging this to solve for the required attesting weight gives us our safety margin, : Thus, the safety margin is:
Unless otherwise stated, every - or -sub-term, and therefore , itself is expressed in ETH. When a term is derived from a raw validator count we implicitly multiply by 1 ETH per validator.
Bounding Balance Fluctuation Sources
We now derive conservative upper bounds for and over epochs, based on the Ethereum Electra specification.
Validator Churn and Consolidations
- Activations: In the current model, the set of validators that can become active during the lookahead period is completely determined by the trusted state at . A validator's activation requires that its
activation_eligibility_epoch
is less than or equal to thefinalized_checkpoint.epoch
.1 Since thefinalized_checkpoint
is fixed at for the entire verification process, any validator not already in the activation pipeline at cannot become active. Therefore, the increase in attesting weight from these known activations can be calculated precisely by the guest and is not a source of unbounded drift. - Exits & Consolidations: For the zkVM guest to compute correct committee shuffles, it must account for any validator exits or consolidations that occur after the trusted checkpoint. This information is provided as part of the untrusted witness data. From the perspective of the validator registry, a voluntary exit and a consolidation are indistinguishable. To create a single, safe upper bound for balance churn, their respective churn limits must be combined. This combined value corresponds to the
get_balance_churn_limit
in the specification, which is based on the constantCHURN_LIMIT_QUOTIENT
(65536). The official specification calculates this dynamic churn limit against the current total active balance at any given epoch , with a floor ofMIN_PER_EPOCH_CHURN_LIMIT_ELECTRA
(128 ETH). To prevent a malicious prover from supplying fraudulent data, the guest program validates the witness against a hardcoded churn limit. Simply using a limit based on could be unsafe, as the total active balance might increase over epochs, thus increasing the real churn limit. To account for this potential growth, the implementation uses a conservative factor of two. While a full formal analysis of this factor is complex, it serves as a safe, static bound for a reasonably small lookahead period . Because the guest strictly enforces this specific check, our formal analysis must adopt the exact same bound:
Rewards and Penalties
The total issuance per epoch is a function of the total active balance, in Gwei. It is a well-known design choice that per epoch the total issuance is Even with a total active balance as high as 100 million ETH, the total issuance would be only a little over 20 ETH. For simplicity and to be highly conservative, we use a constant upper bound of 48 ETH per epoch for both rewards and penalties. This is more than enough to account for future balance increases or "catch up" rewards for missed attestations due to skipped slots in the previous epoch
- Rewards (contributing to A):
- Penalties (contributing to E):
Inactivity Leak Penalty
During a prolonged non-finality event (an "inactivity leak"), inactive validators are penalized with increasing severity. The penalty over epochs for validator with effective balance is .2 This quadratic penalty growth is a key feature of the inactivity leak.
To derive a conservative upper bound for this penalty's contribution to , we make the following worst-case assumptions:
- All attesting validators in our set () are considered inactive from the beginning of the period.
- The inactivity leak starts at the first epoch, i.e. we are not considering
MIN_EPOCHS_TO_INACTIVITY_PENALTY
. - The total balance of these attesting validators is bounded by the total active balance of the entire network, .
Slashing
The slashing penalty has two parts: an initial penalty and a larger correlation penalty.
- Initial Penalty: This penalty is immediately applied but does not change the total active balance (it's redistributed). Its primary effect is that the slashed validator's weight is removed from the attesting set (even though they may still attest), which is already captured by the term in our formula.
- Correlation Penalty: This is applied much later, after the validator is already withdrawable and thus no longer part of the active set. It can be ignored for this analysis.
Hysteresis
The protocol updates a validator’s effective_balance
only when
the actual balance
crosses a hysteresis band.3 This creates two distinct sources of drift we must account for: a baseline drift from ordinary rewards and a large, event-driven jump from EIP-7251.
- Baseline Hysteresis Drift: For any validator, ordinary rewards and penalties can cause their
balance
to cross a threshold, changing theireffective_balance
by at most 1 ETH. This creates a baseline drift potential for every validator in the set. - EIP-7251 Compounding Switch: With EIP-7251, a validator can submit a
ConsolidationRequest
to switch to compounding credentials, raising their maximum effective balance fromMIN_ACTIVATION_BALANCE
(32 ETH) toMAX_EFFECTIVE_BALANCE_ELECTRA
(2048 ETH). This can trigger a one-time jump of up to 2016 ETH. However, the number of these "switch" events is strictly limited by the protocol. TheBeaconBlockBody
can contain at mostMAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD
(2) per block. With 32 slots per epoch, a maximum of 64 switches can be processed per epoch.
To construct our final bound, we combine these two effects. We assume the worst case where all 64n
possible switches occur and all benefit non-attesting validators. Each switch contributes an additional 2015 ETH of drift on top of the 1 ETH baseline drift already accounted for.
- (The decrease remains bounded by the 1 ETH baseline drift)
From Formal Model to Implemented Parameter
While this document derives a dynamic safety margin, , the implementation employs a simplified, fixed supermajority threshold. For instance, the default configuration requires a justification of 85% (justification_threshold_factor: 85
, justification_threshold_quotient: 100
).
This fixed threshold is not an alternative to the analysis; it is a practical parameter chosen based on it. The formal derivation of allows us to calculate the worst-case balance drift for the configured epoch_lookahead_limit
. The implemented 85% threshold is a conservative value chosen to exceed for all permissible lookahead scenarios, thereby guaranteeing safety without requiring the zkVM guest to perform the complex calculation at runtime. The formal analysis thus serves as the fundamental justification for the safety of the implemented fixed threshold.
Bounding the Total Safety Margin
By combining the individual components for the maximum possible increase in non-attesting weight () and the maximum decrease in attesting weight (), we get the following bounds:
Substituting these into the safety margin formula, , yields the final comprehensive bound:
To make this formula computable, we replace the unknown values at epoch with conservative upper bounds derived from the trusted state at . While the balance from validators activating during the lookahead period can be calculated precisely, it is simpler for the purpose of this meta-analysis to use a conservative upper bound. The upper bound for the total active balance is thus composed of the initial balance, a bound on balance from new activations (MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT
), the maximum rewards, and the maximum hysteresis drift:
Similarly, the upper bound for the number of validators is:
The resulting safety margin can be calculated programmatically as shown in the Python implementation below.
def calculate_delta(B_0: int, V_0: int, S: int, n: int) -> int:
"""
Calculates a conservative safety margin delta for TSEth.
Args:
B_0: Total active effective balance at the trusted epoch (in ETH).
V_0: Number of active validators at the trusted epoch.
S: Total slashed balance since the trusted epoch (in ETH).
n: Number of epochs to look ahead.
"""
# An upper bound for the total active balance at the target epoch
# +V_0 (≤1 ETH hysteresis jump per validator)
B_n = B_0 + (256 * n) + (48 * n) + V_0 + 128960 * n
# An upper bound for the active validators at the target epoch
V_n = V_0 + (8 * n)
churn_term = n * 2 * max(128, B_0 / 65536)
reward_term = 48 * n
inactivity_term = (B_n * n * (n + 1)) / 100663296
hysteresis_term = 2 * (V_n + 128960 * n) / 3
delta = reward_term + churn_term + inactivity_term + hysteresis_term + S
# Return the final margin, rounded up for a conservative estimate.
return math.ceil(delta)
Conclusion
This analysis provides a self-contained, conservative bound for the safety margin , depending only on the initial state at , the slashed balance , and the lookahead period . The model's robustness is best illustrated by examining its sensitivity to these parameters.
With the current TSEth default configuration requiring ≥85% voting participation and a finalization lookahead of at most 10 epochs, the system maintains strong security guarantees. For instance, using Ethereum mainnet data from July 2025 (35,475,927 ETH staked by 1,087,747 active validators), TSEth can safely finalize checkpoints even if validators with a combined effective balance of over 4.9 million ETH were slashed.
The safety margin is most sensitive to the lookahead period, . While a short lookahead results in a modest , the margin grows quadratically as increases due to the inactivity leak term, demonstrating the importance of the configured epoch_lookahead_limit
. Similarly, the model correctly scales with the total slashed balance, , ensuring that large-scale slashing events are safely accounted for. This framework provides a transparent and verifiable method for ensuring the safety of a ZKVM-based FFG implementation.