vbuterin / pybitcointools

SImple, common-sense Bitcoin-themed Python ECC library
1.3k stars 861 forks source link

Does get_pubkey_format need all the extra checks? #25

Closed eleutheros closed 9 years ago

eleutheros commented 10 years ago

In get_pubkey_format, you not only check the lengths of the pubkeys, but you also check substrings of the pubkeys. Do you need to do this? You don't do it in get_privkey_format. Also, it looks like the encode functions are correct, so why do you need to check in this function? These questions might not make much sense, but I'm trying to be clear about reasoning behind some parts of the code, because I am trying to translate it to Racket Scheme.

vbuterin commented 9 years ago

Yep, that's necessary. Pubkeys have more restrictive semantics in all standard formats.