A comprehensive proofs handler for Ethereum and Starknet tries. This repository provides proof-building functionalities and includes a CLI tool.
-
Ethereum Transaction/Receipt MPT Handler: Constructs transaction and receipt tries using a target block number or transaction hash, following Ethereum's Merkle Patricia Tree (MPT) specification.
-
Starknet Transaction/Receipt MPT Handler: Constructs transaction and receipt tries using a target block number, following Starknet's Merkle Patricia Tree (MPT) specification.
-
Transaction Trie Handler
- Builds a trie with a target block number.
- Builds a trie with a target transaction hash.
- Retrieves proof by transaction index.
- Verifies proof.
-
Transaction Receipt Trie Handler
- Builds a trie with a target block number.
- Builds a trie with a target transaction hash.
- Retrieves proof by transaction index.
- Verifies proof.
Currently only supports Ethereum MPT.
The CLI tool supports generating proofs for transactions and receipts. Use the following commands based on your requirements.
Install the CLI tool using Cargo:
cargo install --path ./
Or run it without installing:
cargo run --bin etp-cli
To generate a proof for a transaction:
etp-cli tx <TRANSACTION_HASH> [RPC_URL]
To generate a receipt proof:
etp-cli receipt <TRANSACTION_HASH> [RPC_URL]
By default, https://ethereum-rpc.publicnode.com
is used as the RPC provider. While this may work for recent transactions, it is advisable to use a dedicated RPC provider for better reliability.
Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
trie-proofs
is licensed under the GNU General Public License v3.0.
Herodotus Dev Ltd - 2024