> For the complete documentation index, see [llms.txt](https://solana-unchained.gitbook.io/whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://solana-unchained.gitbook.io/whitepaper/technical-specifications/consensus-finality-and-epoch-anchored-state-settlement.md).

# Consensus Finality & Epoch-Anchored State Settlement

1\. **Solana's Base Consensus Layer**

Solana Unchained is built on Solana, which uses Tower BFT — a Proof-of-History (PoH) enhanced Byzantine Fault Tolerant consensus. Key properties relevant to reorg handling:

* Blocks achieve optimistic confirmation after \~32 validator votes (\~2–3 seconds)
* Blocks reach full finalization after a supermajority (>2/3 of stake) locks in via Tower BFT — approximately 13 seconds
* Deep reorgs (more than a few slots) are economically and cryptographically near-impossible due to exponential lockout penalties on validators who vote on conflicting forks

2\. **Epoch Structure on Solana**

A Solana epoch spans approximately 432,000 slots (\~2.5 days). At each epoch boundary:

* Validator stake weights are recalculated
* Leader schedules are rotated
* Staking rewards are distributed

For Solana Unchained's Vault and staking contracts, epoch boundaries act as settlement anchors — the point at which yield accrual, lock period progression, and reward distribution are finalized.

3\. **How Reorgs Are Handled at the Protocol Level**

| Scenario                             | Outcome                                                                                     |
| ------------------------------------ | ------------------------------------------------------------------------------------------- |
| Short-range fork (1–4 slots)         | Resolved by Tower BFT before epoch anchor is written; no impact on protocol state           |
| Medium-range fork (pre-finalization) | Tower BFT lockout penalties prevent validators from switching; fork resolved within seconds |
| Post-finalization reorg              | Cryptographically impossible — finalized blocks cannot be reversed under Tower BFT          |
| Epoch boundary reorg                 | Cannot occur — epoch anchors are only written after underlying slots are finalized          |

By the time an epoch anchor is recorded, every slot within that epoch is already Tower BFT finalized. The epoch anchor is a downstream artifact of finalized state, not a consensus mechanism itself.

4\. **Protocol-Level Safeguards for Unchained Contracts**

* All state-changing instructions require confirmed or finalized commitment level
* Yield snapshots reference epoch-boundary slot hashes, which are immutable post-finalization
* Lock period expirations are calculated using absolute slot numbers, not timestamps, to prevent clock drift manipulation
