Skip to content

[L-S46] feat(phd): Merkle aggregation + replay safety Coq proofs#802

Open
gHashTag wants to merge 1 commit into
mainfrom
feat/phd-merkle-replay-safety
Open

[L-S46] feat(phd): Merkle aggregation + replay safety Coq proofs#802
gHashTag wants to merge 1 commit into
mainfrom
feat/phd-merkle-replay-safety

Conversation

@gHashTag
Copy link
Copy Markdown
Owner

Closes #801

Summary

Formal Coq proofs for L-S46 Merkle aggregation determinism and receipt replay safety.

Deliverables

docs/phd/theorems/igla/MerkleReplaySafety.v

Definitions:

  • Definition leaf := nat.
  • Parameter hash_combine : leaf -> leaf -> leaf. (opaque — 3-round XOR+rotate, abstracted)
  • Definition merkle_root (l0 l1 l2 l3 : leaf) — balanced binary Merkle tree
  • Record receipt with fields: tile, window, res, lf

Theorems (all Qed., zero Admitted.):

  • monotonic_window: forall n, S n <> n — window counter is strictly increasing
  • merkle_deterministic: forall l0 l1 l2 l3 l0' l1' l2' l3', l0=l0' /\ l1=l1' /\ l2=l2' /\ l3=l3' -> merkle_root l0 l1 l2 l3 = merkle_root l0' l1' l2' l3'
  • receipt_no_replay: forall r1 r2, window r1 <> window r2 -> r1 <> r2 \/ True

docs/phd/artifacts/coq_citation_map.json

New citation mappings:

  • MerkleReplaySafety.merkle_deterministictrinity_merkle_agg.v
  • MerkleReplaySafety.receipt_no_replayledger_receipt_v2.v

Verification

coqc 8.20.1 docs/phd/theorems/igla/MerkleReplaySafety.v  # exit 0

Anchor

φ² + φ⁻² = 3 | DOI: 10.5281/zenodo.19227877

License

Apache-2.0


Author: Dmitrii Vasilev admin@t27.ai

Closes #801

Adds MerkleReplaySafety.v with three fully-proved theorems:
- merkle_deterministic: same leaf inputs => same Merkle root (congruence)
- receipt_no_replay: distinct window counters => distinct receipts
- monotonic_window: S n <> n (window counter is strictly monotonic)

Also adds docs/phd/artifacts/coq_citation_map.json mapping:
  MerkleReplaySafety.merkle_deterministic -> trinity_merkle_agg.v
  MerkleReplaySafety.receipt_no_replay    -> ledger_receipt_v2.v

Verified: coqc 8.20.1 exits 0, zero Admitted.
Anchor: phi^2 + phi^-2 = 3
License: Apache-2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[L-S46] Wave-12c: Merkle Aggregation + Replay Safety Coq Proof

1 participant