Glossary / Nodes & software
Regtest
Also known as Regression test mode.
- Definition
- Regtest is a private Bitcoin network that runs on your own machine, where you mine blocks on command instead of waiting for anyone else to produce them.
Nothing here is shared with anybody. The chain begins at its own genesis block, mining difficulty sits at the lowest value the software allows, and one command can produce a hundred blocks in under a second. This is where wallet software, payment processors, and Lightning implementations get tested before any of them touch money.
How it works
Starting bitcoind with the regtest option creates a chain with no peers and no history.
There are no DNS seeds for this network and no default nodes to dial, so unless you launch a second instance and connect it manually you are alone on your own blockchain. The daemon listens on port 18444 for peers and 18443 for RPC calls, keeps its data in a separate regtest directory, and hands out addresses with the bcrt1 prefix so there is no chance of confusing them with anything valuable.
Blocks appear when you ask for them. The generatetoaddress command mines to an address you name, and the usual first move is to mine 101 blocks rather than 1, because a coinbase output cannot be spent until 100 further blocks sit on top of it. Only when the 101st block exists do you have a spendable coin to build the rest of your test with.
Two other parameters are deliberately unlike mainnet. Regtest starts with the same 50 BTC subsidy, but it halves every 150 blocks instead of every 210,000, so a session that mines a few thousand blocks will drive the reward to zero and leave you unable to fund anything new. And because the difficulty floor is so low, reorganizations are free to arrange: invalidateblock rolls the chain back from any block you choose and reconsiderblock puts it back, which is the only practical way to watch what a six block reorganization does to a wallet balance.
Where you see it
Regtest is the network bitcoin's own test suite runs on.
Bitcoin Core's functional tests spin up regtest nodes, drive them through scenarios, and tear them down again, which is how changes to the software are checked before release. Core Lightning and LND do the same for channel logic, and Polar gives that workflow a graphical front end so you can create a small Lightning network on your laptop in a few clicks. BTCPay Server ships a regtest development stack for the same reason: nobody should discover a checkout bug with a customer's payment.
If you are wiring bitcoin payments into a website, this is where the first hundred payments belong. You control confirmation timing exactly, you can simulate a stuck transaction or a fee bump without paying for either, and you can rehearse the reorganization that would otherwise be a once-a-year surprise.
As someone buying or holding bitcoin you will never connect to regtest deliberately, but knowing the name is worth something. An address beginning bcrt1 is not a bitcoin address, and any wallet showing you one has been pointed at a private chain that exists nowhere but the machine in front of you.