Closed katat closed 4 years ago
I guess this is relating to https://learnmeabitcoin.com/technical/public-key
If the current public_key
is a uncompressed public key, can we generate the compressed public key instead?
We do provide an uncompressed public key, and it's much easier to go from uncompressed to compressed than the other way around: given an uncompressed public key in hex,
compressed = ("13579bdf".includes(uncompressed[129])?"03":"02") + uncompressed.slice(2,66)
that is to say, the prefix is 0x02 | last_byte & 0x1 and the rest is just the first 32 bytes of key data. Uncompressed is also tagged with 0x04 instead of 0x02 or 0x03.
Hi,
I am trying to test out the extended public key from the ledger. The following is result from the device:
The
public_key
got a length of 130 characters. This doesn't seem to align with the assumption in Neuron, which follows the format in https://learnmeabitcoin.com/technical/extended-keys. The public key is assumed to be 33 bytes, while 32 bytes for chain code. When importing axpubkey
, Neuron basically parses the serialized string by simply splitting the first 66 characters as public key and the rest 64 characters for chain code.So I am wondering if the
public_key
generated from the ledger is actually correct?