The addressFromSecp256k1Private function passes it the full, uncompressed, serialized public key.
That is sane. But, it turns out you need to cut off the first/leading/signing byte of the full public key before keccak-256ing it. This should be as simple as .slice(1)ing the pubkey Buffer?
There is actually a bigger error, too -- addressFromSecp256k1Public Keccak-hashes the compressed public key, whereas it should be hashing the uncompressed key. Will clean it up and add some test cases.
The
addressFromSecp256k1Private
function passes it the full, uncompressed, serialized public key.That is sane. But, it turns out you need to cut off the first/leading/signing byte of the full public key before
keccak-256
ing it. This should be as simple as.slice(1)
ing the pubkeyBuffer
?Example correct values: (src 1, 2)
(Also this still says
pub
, which is incorrect.)