Bitcoinjs-lib: Can't create regtest p2wpkh address

Created on 14 Nov 2018  路  6Comments  路  Source: bitcoinjs/bitcoinjs-lib

Hello,

I am trying to run the P2WPKH test on my machine, using Bitcoin Core on regtest mode to fund the p2wpkh address manually.
The address starts with tb, which is not what I want because Core is using bcrt address prefix on regtest.

Bitcoinjs doesn't have a regtest object in bitcoin.networks, so what am I suppose to do?
Is bitcoinjs able to produce a regtest p2wpkh address?
Thank you.

how to / question / docs

All 6 comments

Is bitcoinjs able to produce a regtest p2wpkh address?

If you create a custom network, yes.

The network object is not that complicated, you can make a custom one to meet your needs.

Check the integration tests, they use testnet for regtest?

edit: PR wanted

@dcousens He is saying that regtest has a different bech32 value for segwit.

bech32: 'bcrt'

Make a PR please that adds regtest and respective constants and use it in the integration tests :+1:

@Janaka-Steph please see #1261, thanks @junderw

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thrastarson picture thrastarson  路  3Comments

panpan2 picture panpan2  路  3Comments

tuyennvtb picture tuyennvtb  路  3Comments

Mr-Mondragon picture Mr-Mondragon  路  3Comments

ghost picture ghost  路  3Comments