3

I have set up my custom signet, with my own challenge.

I expected to fail to generate blocks using the 'generatetoaddress' API before importing the private key related to the challenge script in the node wallet, but using bitcoincore 0.21.1 the blocks generation works with just the PoW.

Why?

1

generatetoaddress doesn't actually have a restriction on which networks it operates on. You can use it on mainnet, it will just not find any blocks. The way that it is implemented is that it just tries the nonce range for a single block, and if none of those block proposals are valid, then it exits. So if the difficulty is low enough that it is possible to find a block with just the nonce range (rather than needing to change block templates or increment an extra nonce), then generatetoaddress will find blocks.

4
  • Hello Andrew. So signet blocks are not strictly committed to the challenge script? At this point, I don't know how it works. – JonSnow Jul 1 at 7:13
  • Signet blocks need to be mined using a separate utility so that the challenge script is valid. Instructions for mining signet blocks can be found at github.com/bitcoin/bitcoin/blob/master/contrib/signet/… – Andrew Chow Jul 1 at 16:39
  • Thanks again for your answer. I have already checked the signet documentation on how to mine blocks (unluckily the current miner on master is broken, using the 0.21.1, but this is another story). What I don't get is why the generatetoaddress API is still used to produce blocks in a custom signet, I expected to see it fail due to lack of signature. – JonSnow Jul 1 at 19:04
  • It would only fail if you have set up the mining utility to require a block signer and not provided a valid block signature. By default a custom signet doesn't require a block signature, you have to set that up if you want that. – Michael Folkson Jul 7 at 12:58

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.