Git Product home page Git Product logo

merkle-generator's Introduction

Merkle Generator

Bootstrap your merkle tree, in Rust.

Table of Contents

 

Features

  • Merkle Tree creation
  • Merkle Proof generation.
  • Multi data type compatibility.
  • Odd leaf amount compatibility w/o duplication of leaf.

 

Installation

First, make sure that you have Rust installed.

 

Install from source

git clone https://github.com/DeGatchi/merkle-generator &&
cd merkle-generator &&
cargo install --path .

 

Usage

Now that you have the project installed, you can use the merkle-generator command from anywhere in your terminal. By default, merkle-generator looks for inputs.json in the current directory and outputs to output.json.

At any point you can use merkle-generator --help to see a list of all commands and options.

Usage: merkle-generator [OPTIONS]

Options:
  -i, --input-path <INPUT_PATH>    [default: src/input.json]
  -o, --output-path <OUTPUT_PATH>  [default: src/output.json]
  -h, --help                       Print help information

Make sure to have everything as a String within the input file. The program converts the String into it's corresponding type.

JSON Input

{
        "types": [
            "Address",
            "Uint",
            "Uint"
        ]
    },
    {
        "inputs": [
            "0x599a9d94b12dd3313211bd1ae9e35a30c0753f5e",
            "250000000000000000000",
            "0"
        ]
    },

JSON Output

[
  {
    "inputs": [
      "0x599a9d94b12dd3313211bd1ae9e35a30c0753f5e",
      "250000000000000000000",
      "0"
    ],
    "proof": [
      "0x69d3ca75db69c48c0569d359a5f110f5101ae898fe7a89e9537aa4a487110801",
      "0x5074756108d06d9e89bfa45aa7fcf1ab486e98cffce378a9bc71098e5687cb84"
    ],
    "root": "0x97c7f98805481c199f21f29a2390071af3f73b91e19797d5a5d6f6c8bed296c6",
    "leaf": "0x6fcec51a48c67ee2de86adc83fb1d9e65b8b8c8f60548cd839e3c463c9e5a46a"
  }
]

 

Contributing

First off, thanks for taking the time to contribute! PRs are welcomed and greatly appreciated <3.

merkle-generator's People

Contributors

0xclandestine avatar degatchi avatar x676f64 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.