scriptHash: 0xc4, // TODO set this correctly, same as BTC for now
wif: 0xef // TODO set this correctly, same as BTC for now
};
+
+// https://github.com/bitcoinjs/bitcoinjs-lib/blob/3f6f5ef97a1ee1b8337865209282c0095e22b2e7/src/networks.js
+bitcoinjs.bitcoin.networks.regtest = {
+ messagePrefix: '\x18Bitcoin Signed Message:\n',
+ bech32: 'bcrt',
+ bip32: {
+ public: 0x043587cf,
+ private: 0x04358394,
+ },
+ pubKeyHash: 0x6f,
+ scriptHash: 0xc4,
+ wif: 0xef,
+};
setHdCoin(0);
},
},
+ {
+ name: "BTC - Bitcoin RegTest",
+ onSelect: function() {
+ network = bitcoinjs.bitcoin.networks.regtest;
+ // Using hd coin value 1 based on bip44_coin_type
+ // https://github.com/chaintope/bitcoinrb/blob/f1014406f6b8f9b4edcecedc18df70c80df06f11/lib/bitcoin/chainparams/regtest.yml
+ setHdCoin(1);
+ },
+ },
{
name: "BTC - Bitcoin Testnet",
onSelect: function() {
wif: 0xef
};
+bitcoinjs.bitcoin.networks.regtest.p2wpkh = {
+ baseNetwork: "regtest",
+ messagePrefix: '\x18Bitcoin Signed Message:\n',
+ bech32: 'bcrt',
+ bip32: {
+ public: 0x045f1cf6,
+ private: 0x045f18bc
+ },
+ pubKeyHash: 0x6f,
+ scriptHash: 0xc4,
+ wif: 0xef
+};
+
// p2wpkh in p2sh
bitcoinjs.bitcoin.networks.bitcoin.p2wpkhInP2sh = {
wif: 0xef
};
+bitcoinjs.bitcoin.networks.regtest.p2wpkhInP2sh = {
+ baseNetwork: "regtest",
+ messagePrefix: '\x18Bitcoin Signed Message:\n',
+ bech32: 'bcrt',
+ bip32: {
+ public: 0x044a5262,
+ private: 0x044a4e28
+ },
+ pubKeyHash: 0x6f,
+ scriptHash: 0xc4,
+ wif: 0xef
+};
+
// p2wsh
bitcoinjs.bitcoin.networks.bitcoin.p2wsh = {
wif: 0xef
};
+bitcoinjs.bitcoin.networks.regtest.p2wsh = {
+ baseNetwork: "regtest",
+ messagePrefix: '\x18Bitcoin Signed Message:\n',
+ bech32: 'bcrt',
+ bip32: {
+ public: 0x02575483,
+ private: 0x02575048
+ },
+ pubKeyHash: 0x6f,
+ scriptHash: 0xc4,
+ wif: 0xef
+};
+
// p2wsh in p2sh
bitcoinjs.bitcoin.networks.bitcoin.p2wshInP2sh = {
wif: 0xef
};
+bitcoinjs.bitcoin.networks.regtest.p2wshInP2sh = {
+ baseNetwork: "regtest",
+ messagePrefix: '\x18Bitcoin Signed Message:\n',
+ bech32: 'bcrt',
+ bip32: {
+ public: 0x024289ef,
+ private: 0x024285b5
+ },
+ pubKeyHash: 0x6f,
+ scriptHash: 0xc4,
+ wif: 0xef
+};
+
bitcoinjs.bitcoin.networks.litecoin.p2wpkh = {
baseNetwork: "litecoin",
messagePrefix: '\x19Litecoin Signed Message:\n',
};
testNetwork(done, params);
});
+it('Allows selection of bitcoin regtest', function(done) {
+ var params = {
+ selectText: "BTC - Bitcoin RegTest",
+ firstAddress: "mucaU5iiDaJDb69BHLeDv8JFfGiyg2nJKi",
+ };
+ testNetwork(done, params);
+});
it('Allows selection of litecoin', function(done) {
var params = {
selectText: "LTC - Litecoin",