bitaccess / coinlib

A unified nodejs API for sending and receiving crypto payments
MIT License
70 stars 28 forks source link

The generated wallet address is different from that of other wallet programs #224

Closed liuhuanhui closed 3 years ago

liuhuanhui commented 3 years ago

I tried to generate the bitcoin wallet address under the configuration. It is inconsistent with the wallet address generated by other wallet programs. I have tried to configure the address type address to generate the address Legacy = "p2pkh", SegwitP2SH = "p2sh-p2wpkh", SegwitNative = "p2wpkh",

dylanseago commented 3 years ago

There are many variables involved in being able to see matching derivations. They should match anything derived by libraries also following the bip44/bip49/bip84 standards. By default this library derives addresses under the following paths for mainnet bitcoin, other assets and testnet may vary:

p2pkh: m/44'/0'/0'/0/i
p2sh-p2wpkh: m/49'/0'/0'/0/i
p2wpkh: m/84'/0'/0'/0/i

Where i is the index provided to getAddress

What configuration and other wallet program are you using? Are you using a mnemonic, seed, xprv, xpub, private key, etc? Please provide all the necessary information to reproduce what you're seeing and we'll look into whether there's an issue