Bounded append-only Merkle log with inclusion and consistency proofs
| 导入路径 | 功能 | 后端 |
|---|---|---|
| ShiChengxu/moonappend | 内存日志、批量追加、compact range、三类证明、外部节点读取接口 | native / wasm-gc / JS |
| ShiChengxu/moonappend/wire | 严格 JSON 快照、证明、十六进制记录交换 | native / wasm-gc / JS |
| ShiChengxu/moonappend/disk | 磁盘日志、提交检查点、重启恢复、随机读取和全量审计 | native |
| cmd/moonappend | 上述能力的文件命令行入口 | native |
moon update
moon run cmd/moonappend --target native -- --help
python tools/verify_storage_cli.pylet log = @tree.MemoryLog::new()
let old = log.append_batch([b"one", b"two"])
let head = log.append_batch([b"three", b"four"])
let growth = log.prove_consistency(2UL, 4UL)
assert_true(@tree.verify_consistency(old, head, growth).is_verified())
let proof = log.prove_range(1UL, 3UL, 4UL)
assert_true(@tree.verify_range(head, 1UL, [b"two", b"three"], proof).is_verified())moon fmt --check
moon check --target native --deny-warn
moon build --target native --deny-warn
moon test --target native --deny-warn
python tools/verify_reference.py --target native --go go
python tools/verify_expanded_reference.py --target native --go go
python tools/verify_consumer.py --target native
python tools/verify_storage_cli.pyfn CompactRange::from_leaves(start : UInt64, leaves : Array[Bytes]) -> CompactRange raise AppendErrorfn CompactRange::new(start : UInt64, end : UInt64, nodes : Array[Hash32]) -> CompactRange raise AppendErrorfn 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 MemoryLog::prove_range(self : MemoryLog, start : UInt64, end : UInt64, size : UInt64) -> RangeProof raisefn RangeProof::new(start : UInt64, end : UInt64, size : UInt64, nodes : Array[Hash32]) -> RangeProof raise AppendErrorfn compact_from_reader(start : UInt64, end : UInt64, read_node : (Int, UInt64) -> Hash32 raise) -> CompactRange raisefn consistency_from_reader(old : UInt64, size : UInt64, reader : (Int, UInt64) -> Hash32 raise) -> ConsistencyProof raisefn inclusion_from_reader(index : UInt64, size : UInt64, reader : (Int, UInt64) -> Hash32 raise) -> InclusionProof raisefn range_from_reader(start : UInt64, end : UInt64, size : UInt64, reader : (Int, UInt64) -> Hash32 raise) -> RangeProof raisefn verify_consistency(trusted_old : Snapshot, trusted_new : Snapshot, proof : ConsistencyProof) -> Verificationfn verify_inclusion(trusted : Snapshot, index : UInt64, leaf : Bytes, proof : InclusionProof) -> Verificationfn verify_range(trusted : Snapshot, start : UInt64, leaves : Array[Bytes], proof : RangeProof) -> VerificationInstall
Download zipBounded append-only Merkle log with inclusion and consistency proofs