[bisq-network/bisq-assets] List Nano (NANO) (#32)

Will Bresnahan notifications at github.com
Tue Jun 26 21:15:35 UTC 2018


Nano addresses can't be fully checked with a regex expression. It contains the public key encoded with base 32 with a unique char set and a blake2b checksum also base 32 encoded. While the format of the address can be validated with regex, validating the checksum requires decoding the public key, hashing it, and b32 encoding that hash. 

While it seems complicated, the majority of the code was copy-pasted from other places. Blake2b was an exact duplicate from [here](https://github.com/alphazero/Blake2b/blob/master/src/main/java/ove/crypto/digest/Blake2b.java), and the base 32 came from [here](https://gist.github.com/markov/5206312) with only the slightest modifications possible to use nano's base 32 character set. I did this in the hopes that you could see that this code came from established, open source libraries and while being long and complicated doesn't do anything malicious.

Possible solutions:
1. Only use regex. I don't want to do this since the addresses this implementation reports valid would been seen as invalid from other wallets. Address checksums are a nice thing to have to prevent any typos or extra characters that might have been pasted in with the address. I would rather have a full address checker than an incomplete one. 
2. I could simplify the code down to only what is needed. This would remove the symmetry between the code in here and the other code I used, but be bare-bones. I could also change the checking to only use base 32 decoding, which would remove even more code. However, I am not sure how much code this solution will remove and I don't have the knowledge of the blake2b hashing algorithm to do anything other than remove unused methods. 
3. Split up this class. Is there any way to move the blake2b hashing code and base 32 code into some common crypto package or find some other dependency that handles this case? 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq-assets/pull/32#issuecomment-400464968
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20180626/4a188b1d/attachment-0001.html>


More information about the bisq-github mailing list