Code Monkey home page Code Monkey logo

krakendb's Introduction

krakendb
========

This is a quickly written utility that generates a binary tree containing a
summation of the nodes below it and a verifier hash, similar to the one
described by gmaxwell (https://iwilcox.me.uk/v/nofrac).

Usage: krakendb <dbname> [key=verifier key] [<position>|<hash>|root|dump|gendata]

When run, if the db file <dbname>.tree does not exist, it will attempt to
use <dbname>.data to generate <dbname>.tree.  For testing purposes, the
gendata option can be used to generate a test <dbname>.data file.

Generation of the tree requires a verifier key, set with the key=verifier-key
option.  The nodes of the tree are hashed using:

Leaf nodes:

hash = SHA256(SHA256(code || ":" || value))

, where code is a random salt code for the account to make brute forcing of
value more difficult and value is the value of the account.  code and value
are known to the account holder but not to anyone else so that thee user can
verify that their node hash is indeed what is claimed.

Interior nodes:

hash = SHA256(left.hash || right.hash)

After the tree has been generated, the key option is no longer necessary and
options to dump the entire tree, query for the root node, or query for all
the nodes and adjacent nodes between the leaf node and the root node are
available.  Note that when querying by leaf node hash value, the hashes are
not guaranteed to be unique and only the first entry is returned.


In order to protect privacy (both the business and its users), a third party
is necessary to ensure that the tree is correctly being generated with the
proper math at every node, and that there aren't any negative values at the
leaf nodes designed to deflate the value of the root.  Note that there may
sometimes be negative values for some accounts for various reasons, but
there should not be a lot of negative amounts and any that have a large
negative amount require further investigation as to the reason for it.

krakendb's People

Contributors

intelliot avatar

Watchers

 avatar  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.