Git Product home page Git Product logo

Comments (1)

phad avatar phad commented on May 1, 2024

Example data:
(Using the sets of leaf hashes for tree sizes in [1, 8] in testonly/compact_merkle_tree.go

tree_size:1 hashes:"n4\013\234\377\263z\230\234\245D\346\273x\n,x\220\035?\26378v\205\021\243\006\027\257\240\035" root_hash:"n4\013\234\377\263z\230\234\245D\346\273x\n,x\220\035?\26378v\205\021\243\006\027\257\240\035"

tree_size:2 hashes:"" hashes:"\372\305B\003\347\314il\360\337\313B\311_\035\235\272\367\n\331\346!\364\275\215\230f/\000\343\301%" root_hash:"\372\305B\003\347\314il\360\337\313B\311_\035\235\272\367\n\331\346!\364\275\215\230f/\000\343\301%"

tree_size:3 hashes:"\002\230\321"\220m\317\301\010\222\313S\2479\222\374[\237I>\244\311\272\333'\267\221\264\022z\177\347" hashes:"\372\305B\003\347\314il\360\337\313B\311*\035\235\272\367\n\331\346!\364\275\215\230f/\000\343\301%" root_hash:"\256\266\274\376'Kp\241O\260g\245\345W\202d\333\017\251\265\032\365\340\272\025\221X\363)\340nw"

tree_size:4 hashes:"" hashes:"" hashes:"\323~\344\030\227m\331WS\301\3078b\2719\217\242\242\317\233O\360\375\376\2130\315\225 \226\024\267" root_hash:"\323~\344\030\227m\331WS\301\3078b\2719\217\242\242\317\233O\360\375\376\2130\315\225 \226\024\267"

tree_size:5 hashes:"\274\032\006C\261.M-|w\221\217D\340\364\367\232\203\213l\371\354[(>\037M\210Y\236k" hashes:"" hashes:"\323~\344\030\227m\331WS\301\3078b\2719\217\242\242\317\233O\360\375\376\2130\315\225 \226\024\267" root_hash:"N;\273\037{G\215\317\347\037\2661c\025\031\243\274\241,\232\357\312\026\022\277\316L\023\250bd\324"

tree_size:6 hashes:"" hashes:"\016\274]47\373\342\333\025\213\237\022j\035\021\2160\201\201\003\035\n\224\237\215\355\355\353\305X\357j" hashes:"\323~\344\030\227m\331WS\301\3078b\2719\217\242\242\317\233O\360\375\376\2130\315\225 \226\024\267" root_hash:"v\346}\255\274\337\036\020\341\267M\334`\212\275/\230\337\261o\274\347Rw\265#*\022\177 \207\357"

tree_size:7 hashes:"\260\206\223\354.r\025\227\023\006A\350!\036~\355\314\264\302d\023\226>\356l\036.\321o\373\032_" hashes:"\016\274]47\373\342\333\025\213\237\022j\035\021\2160\201\201\003\035\n\224\237\215\355\355\353\305X\357j" hashes:"\323~\344\030\227m\331WS\301\3078b\2719\217\242\242\317\233O\360\375\376\2130\315\225 \226\024\267" root_hash:"\335\270\233\344\003\200\2362WP\323\322c\315x\222\234)B\267\224*4\267~\022,\225\224\247L\214"

tree_size:8 hashes:"" hashes:"" hashes:"" hashes:"]\311\332y\247\006Y\251\255U\234\267\001\336\331\242\253\235\202:\255/I\317\343p\357\364C(" root_hash:"]\311\332y\247\006Y\251\255U\234\267\001\336\331\242\253\235\202:\255/I\317\343p\357\364C("

The general pattern is that for 'perfect' trees sized 2^n, the Hashes() func returns 'n' nil hashes followed by a hash equal to the root hash.

from trillian.

Related Issues (20)

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.