bitcoinjs-lib seems to skip a step in deriving addresses from a BIP 44 wallet

bitcoinjs-lib seems to skip a step in deriving addresses from a BIP 44 wallet

According to this wiki page to create a bitcoin address,

1) you have your public key of the properly derived path

2) Then SHA256 it

3) Then RIPEMD-160 it,

Add version byte at the front and boom blam you’re good.

But in bitcoinjs-lib, they have this function getAddress which seems to skip step 1 and continue down the path ensuring Base58Checking

function getAddress (node) {
  return baddress.toBase58Check(bcrypto.hash160(node.publicKey), bitcoin.networks.bitcoin.pubKeyHash)
}

My question is, why is bitcoinjs-lib skipping step 1? Don’t you have to SHA256 the pub key again?

Derivation occurs pretty straightforwardly with derivePath

var child1 = root.derivePath("m/44'/0'/0'/0/0")

https://ift.tt/2LmNKq8

Comments

Popular posts from this blog

Need help to recover blpckchain.info wallet, my wife forgot her password and the brute force with btcrecover is not catching the password

When downloading the blockchain my application is become unusable, is there an issue with my code or am I using the BitcoinJ library incorrectly?

Mistakenly sent BTC from my personal wallet back to one of the exchange wallet addresses that I had received BTC from before - help recovering!