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