An Rust implementation of the Modified Merkle Patricia Tree described by ETH Yellow Paper
Find a file
2022-10-07 10:50:46 +08:00
src opt. optimized error processing 2022-05-10 16:08:19 +08:00
tests opt. optimized error processing 2022-05-10 16:08:19 +08:00
.gitignore opt. gitignore updated 2022-05-10 14:43:04 +08:00
Cargo.toml added a real-world testcase 2022-01-23 10:34:00 +08:00
COPYING added license 2022-01-23 18:06:03 +08:00
README.md Update README.md 2022-10-07 10:50:46 +08:00

Merkle Patricia Tree的Rust实现

博客文章:https://m4tsuri.io/2022/01/24/eth-trie/

本实现参考下列项目:

  1. https://ethereum.github.io/yellowpaper/paper.pdf
  2. https://github.com/ethereum/go-ethereum
  3. https://github.com/zhangchiqing/merkle-patricia-trie

实现的功能:

  • Merkle Patricia Tree数据结构定义
  • Persistent Trie的插入insert查询get和回退revert
  • Merkle Proof构造与验证
  • 数据持久化

注意,相比较于以太坊的官方实现的节点粒度的脏标志,本实现的脏标志粒度为整棵树,这会带来潜在的性能问题,可我太懒了。

食用方式

git clone https://github.com/M4tsuri/mpt-rs
cd mpt-rs && cargo test

文档

cargo doc --open