Consensus
Proof-of-Work, DAG ordering, and deterministic finality. No voting, no committee, no validator set. The order is a pure function of the graph.
1. The Problem
A linear blockchain imposes a total order on blocks by construction: each block references exactly one predecessor. This simplicity has a cost. When two miners independently discover valid blocks at the same height, one must be discarded. The hash power spent on the discarded block is wasted — it contributes nothing to network security.
A DAG permits parallel production. Multiple valid blocks can exist at the same height. Every valid block contributes its work to the network. The question becomes: given a set of parallel blocks, in what order should they be processed?
Sahyadri answers this question with a deterministic function. Two honest nodes with identical DAG views compute identical orderings. There is no negotiation, no voting round, no tie-breaking by authority.
2. Formal Definition
The consensus state is a graph:
𝒢 = (V, ≺_h)
V = { B : valid(B) = ⊤ }
≺_h = hash-ancestor relation (transitive, acyclic)
Properties:
V is monotonically growing. No valid block is ever removed.
≺_h is a partial order, not a total order.
Acyclicity is enforced by the hash function — a block cannot
reference a block that hashes to include it.The state transition function — the function that produces the next state from the current state and a new block — is deterministic:
δ : Σ × Β → Σ
σ_{n+1} = δ(σ_n, B_n)
Σ = state space (account balances + Crest objects)
Β = block space
δ = pure function (no clock, no randomness, no external input)
Determinism:
∀ nodes i, j: view_i = view_j ⟹ δ_i(σ, B) = δ_j(σ, B)Every honest node with the same (σ, B) computes the same σ'. This is the property that makes consensus possible without communication between nodes — they all run the same function.
3. DAG Structure
A block references one or more parents. The reference set is stored in the header as parents_by_level, which records the block's parents at every level of the DAG. A block with one parent is a linear extension; a block with many parents merges parallel history.
Header (DAG-relevant fields):
parents_by_level: CompressedParents
// Parents at every level — typically 1-10 per level
// Selected from current tips at block creation time
blue_score: u64
// Count of accepted blocks in this block's past closure
// Monotonically non-decreasing along any ancestry path
blue_work: BlueWorkType
// Cumulative proof-of-work in the past closure
// The metric used for ordering and finality
daa_score: u64
// Difficulty-adjusted accumulated score
// Used for difficulty adjustment and transaction expiry
Source: consensus/core/src/header.rsParent selection is a miner's choice. The protocol does not mandate an exact number. More parents means wider merging of parallel history; fewer parents means deeper linear chains. Both are valid; both contribute to the DAG. The choice affects only the shape of the graph, not the correctness of the ordering function.
4. Depth and Work
Two quantities determine ordering. Both are functions of the graph alone.
depth(b) = | longest path from genesis to b | Computed by walking the DAG backwards from b. Well-defined because ≺_h is acyclic.
W(b) = d(b) + Σ_{p ∈ parents(b)} W(p)
d(b) = block b's difficulty (from header bits field)
parents(b) = blocks that b directly references
Well-defined because ≺_h is acyclic.
W(b) is finite for any finite DAG.
W(b) monotonically grows as more blocks reference b.Cumulative work W(b) is the metric by which finality is measured. It is not a protocol parameter; it is a mathematical property of the DAG's structure. Two nodes computing W(b) for the sameb arrive at identical results.
5. The Ordering Function
Ashwa Consensus is the function that converts the partial order ≺_h into a total order over V.
Order : 𝒢 → 𝒮
For blocks b_i, b_j ∈ V:
b_i ≺_ord b_j ⟺
depth(b_i) < depth(b_j)
∨ ( depth(b_i) = depth(b_j) ∧ W(b_i) > W(b_j) )
∨ ( depth(b_i) = depth(b_j) ∧ W(b_i) = W(b_j) ∧ hash(b_i) < hash(b_j) )Three keys, applied lexicographically:
- Depth. A block at greater depth comes before a block at smaller depth. Deeper blocks are ordered first because they have more history behind them.
- Cumulative work. Blocks at the same depth are ordered by total work in their ancestor sets. Higher work first. This is the tiebreak that matters — work is the scarce resource.
- Hash. Blocks with identical depth and work (rare) are ordered by hash. This is deterministic and verifiable by any node — no randomness, no external input.
The result is a total order that every honest node with the same DAG view computes identically. There is no fork choice rule; the choice is forced by the graph.
6. Finality
A block is final when its cumulative work exceeds what any plausible adversary could produce from an alternative history.
final(b) ⟺ W(b) > W_adversary / ε W_adversary = total work an adversary can produce ε = protocol safety margin Finality is a threshold. Crossed once, then deterministic.
Because W(b) monotonically increases as more blocks reference b, every additional reference makes b strictly more final. A block's finality is not a function of how much time has passed but of how much work stands behind it.
Reorg probability. Let α be the adversary's hash rate fraction and β the honest network's, with α + β = 1 and α < β. The probability that an adversary can produce a competing chain at depth k is bounded:
Pr[reorg(k)] ≤ (α / β)^k, α < β k = confirmations (block depth behind a block) Example: α = 0.30, β = 0.70 k = 1: Pr ≤ 0.43 k = 3: Pr ≤ 0.079 k = 6: Pr ≤ 0.0066 k = 12: Pr ≤ 4.3 × 10⁻⁵ k = 24: Pr ≤ 1.9 × 10⁻⁹
The bound decays geometrically. Each additional block multiplies the adversary's required work by 1 / (α/β) and reduces the probability of success by α/β. After a small number of blocks, reorg becomes economically irrational.
7. Proof-of-Work Binding
Every block must satisfy a work condition. The condition is a search for a nonce that makes the PoW hash fall below the current difficulty target:
pow(header, nonce) ≤ target
pow(header, n) = Poseidon2_12(
MemLoop_1024(
B3Chain_524288( pre_pow ‖ timestamp ‖ n )
)
)
pre_pow = header with nonce = 0 and timestamp = 0
target = difficulty-derived threshold (from header bits)
Verification: one hash computation per block.
Production: expected 2^κ / (H · difficulty) seconds per block,
where H is the miner's hash rate.The PoW function is memory-hard. Every nonce attempt requires a 16 MB working set, so mining cost is dominated by memory bandwidth rather than raw arithmetic throughput. This compresses the ASIC/CPU gap: a specialized chip must include 16 MB of on-chip SRAM per hash pipeline, while a commodity CPU with L3 cache gets the same capability for free.
The final stage — a Poseidon2 permutation over the Goldilocks field — provides a compact binding suitable for proof systems. The PoW output is verifiable inside a STARK at ~300 constraints, versus ~30,000 for BLAKE3. This is what makes the PoW recursively provable without proving every hash iteration.
8. Network Partition Behavior
A partition occurs when a group of nodes cannot reach another group. Both groups continue producing blocks independently. When the partition heals, both DAGs merge and the ordering function applies to the merged DAG.
During partition: Group A: DAG_A (blocks produced during partition) Group B: DAG_B (blocks produced during partition) After merge: DAG_merged = DAG_A ∪ DAG_B Order(DAG_merged) is well-defined. All blocks from both sides enter the canonical order. No block is discarded. No work is wasted. Transaction handling: Duplicate transactions (identical flash_id) are rejected by per-account replay protection — independent of partition. Conflicting transactions (same balance spent twice) are resolved by canonical order: the later transaction fails balance validation and is dropped. The earlier transaction is applied.
This is a property unique to DAG-based consensus among hash-power-based protocols. In a linear chain, one side of a partition must be discarded. In a DAG, both sides merge — no work is lost.
9. Security Assumptions
The security of Ashwa Consensus rests on three assumptions. Each is stated formally. None are policy; all are cryptographic or economic.
Assumption 1: Hash resistance. The hash function H is collision-resistant. Adversary cannot find b_1 ≠ b_2 with H(b_1) = H(b_2) faster than 2^(κ/2) attempts, where κ is the hash size. Assumption 2: Honest majority hash power. Let α = adversary's hash rate fraction, β = 1 - α. Requires α < β. If α ≥ β, adversary can produce competing chains faster than the honest network can extend the real one. Assumption 3: Signature unforgeability. ML-DSA-65 signature forgery requires solving MLWE, which no known classical or quantum algorithm does in polynomial time.
The first assumption provides integrity of the chain: no reordering of blocks is possible without changing their hashes. The second provides liveness and safety: an adversary with less than half the hash power cannot outweigh honest production. The third provides account security: no one can spend from another account without the private key.
10. What Is Measured
The following properties have been measured on the current implementation. They are not extrapolations.
| Property | Value | Status |
|---|---|---|
| Chain depth measured | 39+ blocks, zero breaks | Live testnet |
| Chain proofs generated | 142 continuous | Live testnet |
| Chain proof verify time | 1.5 ms (constant) | Measured |
| Chain proof size at 4444 leaves | ~200 KB (O(log N) bounded) | Measured |
| 4444-leaf tree build time | 603 s (16-core) | Measured |
| Real FRI fold validation | 427 / 427 relations | Measured |
| Target block interval | 1 second (mean) | Protocol target |
| Signature scheme | ML-DSA-65 | Deployed at genesis |
The ~200 KB figure is the size of the serialized chain proof after aggregating 4444 independent FRI proofs into a single root. The size grows logarithmically with chain length — a proof at height 100 is smaller than a proof at height 4444, but the growth is sublinear (O(log N)). Verification time is similarly constant.
The 603 s figure is the time to build the entire 4444-leaf aggregation on a 16-core consumer CPU with AVX2. The figure scales with leaf count (build cost is O(N)) but not with chain length (verify cost is O(1)).
11. Open Problems
Two properties are not yet implemented. Both are documented on the proof aggregation page in detail.
- Full adversarial soundness (Path A). Current aggregation uses Path B — public-value binding, sound against honest-prover attacks. Full adversarial soundness requires in-circuit Merkle verification, which is architecturally non-viable at 4444 scale (~19 min per path). Research on reduced-constraint approaches is ongoing.
- Full recursive STARK compaction. The ~350 KB root proof at 4444 leaves is already O(log N) bounded. Wrapping it in another STARK layer — proving the proof itself — is not implemented. Its benefit is primarily cross-chain verification, not single-chain O(1).
Neither of these blocks the O(1) chain-verification claim. Both are documented so that the state of the implementation is unambiguous.
12. Summary
Sahyadri Consensus combines Proof-of-Work with a DAG-based ordering function. Every valid block contributes to cumulative work. No valid work is orphaned. Finality is deterministic — a threshold crossed once, not a probability that slowly converges. The order is a pure function of the graph, so two honest nodes with the same view compute the same state.
The result is a consensus mechanism that preserves the security model of Nakamoto consensus (honest majority hash power) while removing its throughput limitation (single block per interval). Parallel block production is not a compromise; it is a structural improvement enabled by the DAG.