JAR: Join-Accumulate Refine

17.4. Merkle Mountain Range (Appendix E)🔗

🔗def
Jar.mmrAppend (peaks : Array (Option Hash)) (leaf : Hash) : Array (Option Hash)
Jar.mmrAppend (peaks : Array (Option Hash)) (leaf : Hash) : Array (Option Hash)

Append a leaf to an MMR peaks array using Keccak-256. GP Appendix E eq (E.8). Matches Grey's mmr_append in history.rs.

🔗def
Jar.mmrSuperPeak (peaks : Array (Option Hash)) : Hash
Jar.mmrSuperPeak (peaks : Array (Option Hash)) : Hash

Compute MMR super-peak MR. GP Appendix E eq (E.10). MR([]) = H_0, MR([h]) = h, MR(h) = H_K("peak" ++ MR(h[..n-1]) ++ h[n-1])