Skip to content
/ mpt-rs Public

An Rust implementation of the Modified Merkle Patricia Tree described by ETH Yellow Paper

License

Notifications You must be signed in to change notification settings

M4tsuri/mpt-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An Rust implementation of the Modified Merkle Patricia Tree described by ETH Yellow Paper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages