Crates.io | verkle-tree |
lib.rs | verkle-tree |
version | 0.1.0 |
source | src |
created_at | 2024-07-17 17:11:40.979569 |
updated_at | 2024-07-17 17:11:40.979569 |
description | A Rust implementation of Verkle Trees, a powerful upgrade to Merkle Trees that offers improved efficiency and reduced proof sizes. This crate provides a robust, performant, and easy-to-use library for creating, manipulating, and verifying Verkle Trees. |
homepage | |
repository | |
max_upload_size | |
id | 1306355 |
size | 14,807 |
VerkleTree is a Rust library implementing Verkle Trees using the BLS12-381 elliptic curve and KZG commitments for efficient storage and verification of data. This library provides functionality to build a Verkle Tree, generate proofs, and verify them.
To use this library, add the following to your Cargo.toml
verkle-tree = "0.1.0"
Here is a basic example of how to use the library:
use verkle_tree::{VerkleTree, VerkleProof};
use ark_bls12_381::Fr as F;
fn main() {
let datas = vec![F::from(10), F::from(20), F::from(30), F::from(40), F::from(50), F::from(60), F::from(70), F::from(80), F::from(90), F::from(100), F::from(110), F::from(120), F::from(130), F::from(140), F::from(150), F::from(160)];
let width = 4;
let verkle_tree = VerkleTree::new(&datas, width);
let index = 0;
let data_at_index = datas[index];
let proof = verkle_tree.generate_proof(index, &data_at_index);
let is_valid = verkle_tree.verify_proof(&proof);
assert!(is_valid);
}
To run the tests, use the following command:
cargo test
Add support for multiproof using random evaluation
Store VerkleTree
Add benchmarks in comparison to Merkle Trees
VerkleTree solidity verifier???
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.