Bounded append-only Merkle log with inclusion and consistency proofs
moon update
moon run examples/memory --target wasm-gcgrowth 3 -> 7: VERIFIED
rewritten history: ROOT_MISMATCH
release-2 inclusion: VERIFIED
changed leaf: ROOT_MISMATCHlet log = @moonappend.MemoryLog::new()
ignore(log.append(b"first record"))
let saved = log.snapshot()
ignore(log.append(b"second record"))
let grown = log.snapshot()
let proof = log.prove_consistency(1UL, 2UL)
assert_true(@moonappend.verify_consistency(saved, grown, proof).is_verified())| 能力 | alpha 状态 |
|---|---|
| SHA-256、叶/节点域分离、规范非二次幂树 | 已实现 |
| 有界内存追加、历史前缀根、快照 | 已实现 |
| 包含证明生成与严格验证 | 已实现 |
| 一致性证明生成与严格验证 | 已实现 |
| 无文件系统示例、独立 Python/Go 对照、三后端 CI | 已提供;具体运行状态见初验记录 |
| 严格 JSON、文件 CLI、其余场景集成 | 留待终验 |
| Mooncakes 发布、从包仓库安装 | 尚未进行 |
moon fmt --check
moon check --target wasm-gc --deny-warn
moon build --target wasm-gc --deny-warn
moon test --target wasm-gc --deny-warn
python tools/verify_reference.py --target wasm-gc --go go
python tools/verify_consumer.py --target wasm-gcfn ConsistencyProof::new(old_size : UInt64, new_size : UInt64, nodes : Array[Hash32]) -> ConsistencyProof raise AppendErrorfn InclusionProof::new(index : UInt64, size : UInt64, nodes : Array[Hash32]) -> InclusionProof raise AppendErrorpub struct Limits {
// private fields
}pub struct MemoryLog {
// private fields
}fn MemoryLog::prove_consistency(self : MemoryLog, old_size : UInt64, new_size : UInt64) -> ConsistencyProof raise AppendErrorfn MemoryLog::prove_inclusion(self : MemoryLog, index : UInt64, size : UInt64) -> InclusionProof raise AppendErrorfn verify_consistency(trusted_old : Snapshot, trusted_new : Snapshot, proof : ConsistencyProof) -> Verificationfn verify_inclusion(trusted : Snapshot, index : UInt64, leaf : Bytes, proof : InclusionProof) -> VerificationInstall
Download zipBounded append-only Merkle log with inclusion and consistency proofs