[ad_1]
I am producing SegWit keys and addresses utilizing bitcoinjs-lib. I am new to Blockchain so I am utilizing Ian Coleman’s bip39 repo for steering. Nonetheless, I encountered completely different key and deal with outputs when producing them with bitcoinjs-lib
in comparison with the outcomes from Ian Coleman’s device.
I discovered that the reason being within the community config, I am utilizing the bitcoin
community config straight from bitcoinjs-lib
, whereas in that repo there is a customized config.
This is the config I used:
messagePrefix: 'x18Bitcoin Signed Message:n',
bech32: 'bc',
bip32:
public: 0x0488b21e,
non-public: 0x0488ade4,
,
pubKeyHash: 0x00,
scriptHash: 0x05
wif: 0x80,
And right here’s the config from Ian Coleman’s device:
messagePrefix:"u0018Bitcoin Signed Message:n",
bech32:"bc",
bip32:
public: 78792518, // 0x4B24746
non-public: 78791436 // 0x4B2430C
,
pubKeyHash: 0, // 0x00
scriptHash: 5, // 0x05
wif: 128 // 0x80
My outcome outputs keys that begin from xprv
and xpub
whereas Ian Coleman’s resulted in zprv
and zpub
.
Provided that BIP84 mandates zprv
and zpub
prefixes for native SegWit keys, Ian Coleman’s config appears extra applicable. Nonetheless, each configurations generate seemingly appropriate addresses.
So, my questions are:
- Which configuration is appropriate for producing native SegWit (BIP84) addresses?
- Are there any dangers or drawbacks in utilizing the xpub/xprv prefixes for SegWit addresses, or will it simply have an effect on compatibility with sure wallets?”
[ad_2]
Supply hyperlink
Leave a Reply