15

What are the key differences between regtest and the proposed signet?

One of the key differences is that using regtest is not ideal for public networks as anyone anywhere can just rewrite the blockchain at their whim by mining a ton of blocks. Are there any others?

Is signet a strictly superior replacement to regtest?

If not, when would someone use regtest as opposed to signet in future?

1
  • Since submitting this question I have also found this Kanzure transcript from the Bitcoin Core meetup (2019) that also discusses the differences between regtest and signet. To be used to supplement Pieter's and Andrew's great answers below. diyhpl.us/wiki/transcripts/bitcoin-core-dev-tech/… Aug 11, 2019 at 12:31

2 Answers 2

11

The main difference between signet and regtest is that signet is an actual network, as opposed to a sandboxed environment.

In regtest, the network topology is entirely manual. You spin up nodes, and manually establish connections between them. You have exact control over what blocks are mined and when. This is great for testing things like consensus logic, but it's inconvenient and artificial to use it for testing actual large-scale network effects.

In signet, there is an actual network, with public nodes, operating in a way that's similar to the mainnet network. It doesn't just let you test consensus logic, but also peer discovery, transaction and block propagation, how transactions get selected, ...

Signet doesn't replace regtest; regtest was designed for use in Bitcoin Core automated integration tests and it will continue to be used there. But for other larger-scale tests, of Core and other software, signet(s) may turn out to be a better choice.

8

Signet is more comparable to testnet than it is to regtest.

Regtest is for private use and testing things. Even if signet were available, it is still useful to have your own blockchain for testing where you can generate coins, blocks, forks, and reorgs at will. It allows tests to run quickly and for a specific set of conditions to be tested. There is no need to rely on outside parties, or even having a connection to the internet at all. This makes regtest extremely useful for development. Bitcoin Core's regression tests use regtest (hence the name, regtest is short for regression testing network) and will continue to use regtest.

Signet is a public network where blocks will be produced at some interval by the signer. The signer determines at what rate blocks are produced, what transactions are included in them, whether there are forks, and whether there are reorgs. As a user, you have no control over blocks whatsoever, unlike regtest, where you have absolute control. So this is more comparable to testnet, which is the current public testing network. Both signet and testnet will allow you to use a blockchain where someone else is going through the work of producing blocks. This gives you a more realistic simulation of mainnet.

The main difference between signet and testnet is that signet will have blocks be produced more evenly distributed (like they are on mainnet), and even have planned reorgs to allow you to test your software under these conditions. The main issue with testnet is that due to its difficulty reset behavior, blocks are mined very quickly and often clustered together. So there are usually large gaps between blocks, followed by several (thousand) blocks mined in a short timespan. Signet avoids this issue.

Lastly, you can use different signets by simply choosing someone else to be the signer. There is no need to create a new genesis block and define a new network, you can use the same rules, just a different signer. This allows you to test different scenarios with almost no work at all, just choose a signer that is doing some pattern of blocks that you want to test.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.