bech32 addresses beginning with "bcrt..." on regtest

2

I'm playing around with regtest and wanted to generate a bech32 address. My Bitcoin Core version is 0.18.0.

I ran getnewaddress "" bech32 and got an address that began with bcrt, like this one : bcrt1qs758ursh4q9z627kt3pp5yysm78ddny6txaqgw.

I'm a bit surprised, because I was thinking that testnet bech32 addresses were different, and indeed I checked this page that says it should begin with tb1...

I tried to send some tbtc to this address with Electrum and a faucet, none worked, they indeed both say address is invalid.

So what am I missing here?

Sosthène

Posted 2019-10-23T19:23:47.780

Reputation: 128

Answers

2

Regtest and testnet are different networks. They are not compatible with each other.

Regtest is a private local network which is used solely for testing. It is primarily used for the regression tests, hence the name regtest.

Testnet is the public testing network which is very similar to mainnet, the main network. It has a different genesis block and has actual miners, DNS seeds, and nodes that you can connect to.

Andrew Chow

Posted 2019-10-23T19:23:47.780

Reputation: 40 910

Thanks got it, but if I'm not mistaken both testnet and regtest use the same addresses' prefix? At least it is the case for legacy and P2SH addresses, and since I don't find any specific format for bech32 on the page I linked to I was also expecting Bitcoin Core will generate addresses beginning with tb1 on regtest.Sosthène 2019-10-23T20:13:50.450

They use different prefixes for bech32 addresses.Andrew Chow 2019-10-23T20:20:03.623

Ok, but then it means this page need to be updated https://en.bitcoin.it/wiki/List_of_address_prefixes I created an account on Bitcoin Wiki and see how to do it myself, thanks for your help

Sosthène 2019-10-24T13:17:23.033