Skip to content
/ mpt-noir Public

Merkle Patricia Trie (MPT) circuits written in Noir

License

Notifications You must be signed in to change notification settings

RadNi/mpt-noir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Merkle Patricia Trie (MPT) circuits written in Noir

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages