Changelly

Cryptocurrency

bitcoind – Address starting with 2, what mode I am in?

1 Mins read


I am using https://github.com/freewil/bitcoin-testnet-box to run bitcoind in docker to test signing of transactions.

make start tells me the bitcoind is started without -regtest flag. See https://github.com/freewil/bitcoin-testnet-box/blob/master/Makefile#L13

When I run bitcoin-cli -datadir=1 getblockchaininfo, I indeed see "chain": "regtest" in output, so both the nodes are running in regression test mode, I believe.

If I generate an address for either of these 2 nodes, I get an address starting with 2:

[email protected] ~/bitcoin-testnet-box$ make address1
bitcoin-cli -datadir=1  getnewaddress
2N4DTeBWDF9yaF9TJVGcgcZDM7EQtsGwFjX
[email protected] ~/bitcoin-testnet-box$ make address2
bitcoin-cli -datadir=2  getnewaddress
2MwxP8fyh9MFqKnZXZuqt3ZYByhLpNVoiX3

make getinfo tells me its not testnet either:

[email protected] ~/bitcoin-testnet-box$ make getinfo
bitcoin-cli -datadir=1  -getinfo
{
  "version": 170100,
  "protocolversion": 70015,
  "walletversion": 169900,
  "balance": 0.00000000,
  "blocks": 0,
  "timeoffset": 0,
  "connections": 1,
  "proxy": "",
  "difficulty": 4.656542373906925e-10,
  "testnet": false,
  "keypoololdest": 1599940906,
  "keypoolsize": 1000,
  "paytxfee": 0.00000000,
  "relayfee": 0.00001000,
  "warnings": ""
}
bitcoin-cli -datadir=2  -getinfo
{
  "version": 170100,
  "protocolversion": 70015,
  "walletversion": 169900,
  "balance": 0.00000000,
  "blocks": 0,
  "timeoffset": 0,
  "connections": 1,
  "proxy": "",
  "difficulty": 4.656542373906925e-10,
  "testnet": false,
  "keypoololdest": 1599940906,
  "keypoolsize": 1000,
  "paytxfee": 0.00000000,
  "relayfee": 0.00001000,
  "warnings": ""
}

So what mode I am running these bitcoin nodes as? If I was to trust the output that its not testmode but somehow regression test mode, shouldn’t the address start with 1 if its really regtest mode or with m/n if its testnet mode?

Also, when I dump the private key for any of such address and try to derive the P2PKH address from it, it doesn’t match. Same code works fine with address and key taken from mainnet. What’s going on?



Source link

Related posts
Cryptocurrency

blockchain - What function to use to model probabilistic bitcoin mining?

1 Mins read
I would like to calculate profitability of various mining strategies. For that, i need to simulate many random mining intervals, that reflect…
Cryptocurrency

What are the main technical differences between Bitcoin-core (BTC), Bitcoin Cash (BCH), and Bitcoin SV (BSV)

1 Mins read
What are the main technical differences between Bitcoin-core (BTC), Bitcoin SV (BSV) and Bitcoin Cash (BCH)? At what block number did the…
Cryptocurrency

mining reward - Do Bitcoin deposits happen in 3 phases?

1 Mins read
I recently had someone convert my sumcoin and said they were going to send to my Bitcoin wallet. I noticed that about…

Leave a Reply

Your email address will not be published. Required fields are marked *