fix gen_pub_key bug; encode58 should operate on byte array, not hex string in order to preserve leading 00