ripple-unmaintained / ripple-lib-java

Java version of ripple-lib (work in progress)
ISC License
126 stars 109 forks source link

Hash prefix for inner nodes is wrong in documentation #72

Open MarkusTeufelberger opened 8 years ago

MarkusTeufelberger commented 8 years ago

https://github.com/ripple/ripple-lib-java/blob/master/ripple-core/src/main/java/com/ripple/core/types/shamap/README.md claims that "Converted to ascii letters the hex 40494E00 is MIN\x00, meaning sham)ap i)nner n)ode." - correct value would be "4D494E00" (40 --> 4D).

This is consistently used wrongly in that file.

I'm also not able to hash the data from the "7C0B1C90CD3AE3446F65A1F59B36E5C990A7386C1D513E224A59BA404B6ED58C" node to that value - are the hashes just made up, or am I doing something wrong? I simply concatenated the 16 values in the shown order, added "4D494E00" in front, hashed the result with SHA512 and removed the last 256 bits.

MarkusTeufelberger commented 8 years ago

Also the "272D03DC4D1A559FF23DADA65FFFB652E7A727F5D857BEC83C029BC662F79034" node from the example has an odd number of digits...?!

sublimator commented 8 years ago

Hrmmm, thanks! I can't recall exactly now! I will check over this

sublimator commented 8 years ago

Yeah, I don't know what went wrong there! I vaguely recall when writing this that I was using made up prefixes for examples, and then changed to try to use the real prefixes. Clearly I messed up somewhere.

The overall gist, if the not the details is correct though. I'll try and update with verified examples soon. Thanks for the report, and apologies for the slow response.

sublimator commented 6 years ago

haha, Stumbled upon this at BountSource, who apparently seem to think ripple needs my support and are asking for a fiat donation :)

Anyway, this is fixed here: https://github.com/sublimator/ripple-lib-java/blob/master/ripple-core/src/main/java/com/ripple/core/types/shamap/README.md