Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 1.44 KB

File metadata and controls

40 lines (24 loc) · 1.44 KB

MPT Noir

License: MIT Noir-Tests

This software is unaudited and should not be used in production. Use at your own risk.


MPT Noir includes tools to prove Ethereum Merkle Patricia Trie (MPT) proofs.


Installation

In your Nargo.toml file, add the following dependency:

[dependencies]
mpt = { tag = "v0.2.0", git = "https://github.com/radni/mpt-noir" }

Simple Usage

The mpt-noirjs package is made to facilitate witness generation for mpt-noir circuits. To generate inputs for address "MY_ADDRESS" against the latest block you can use the following:

const provider = new ethers.JsonRpcProvider("RPC_URL")
const address = "MY_ADDRESS"
const output = await provider.send("eth_getProof", [address, [], "latest"])
const mpt_proof = getNodesFromProof(output.accountProof, address)

The mpt_proof contains all the data necessary to generate proof using the mpt-noir circuits. To see an elaborated example you can checkout Balance Proof application.

License

This project is licensed under the MIT License. See the LICENSE file for details.