Fix a bug that personal signet can not be created. #20970

pull fujicoin wants to merge 1 commits into bitcoin:master from fujicoin:fix-personal-signet changing 1 files +7 −3
  1. fujicoin commented at 4:20 AM on January 20, 2021: none

    Since signet_header is set as a constant, personal signet cannot be created. The v0.21.0 release notes say 'It is also possible to create personal signets. `.

  2. Fix a bug that personal signet can not be created. 48668e65d7
  3. ajtowns commented at 7:31 AM on January 20, 2021: member

    You create a personal (aka custom) signet by changing the signet challenge (with -signetchallenge) and pointing at a fresh datadir. The signet header is just used to identify the challenge response in the coinbase.

  4. MarcoFalke commented at 7:55 AM on January 20, 2021: member

    The SIGNET_HEADER is a bit like a file type magic (edit: maybe not the best comparison), so it must be constant. Closing.

  5. MarcoFalke closed this on Jan 20, 2021

  6. fujicoin commented at 10:06 AM on January 20, 2021: none

    You create a personal (aka custom) signet by changing the signet challenge (with -signetchallenge) and pointing at a fresh datadir. The signet header is just used to identify the challenge response in the coinbase.

    Personal signets cannot be created even if pointing at a fresh datadir. When mining is done, the block is rejected with submit block returned bad-signet-blksig for height 1. It's natural because SIGNET_HEADER causes a mismatch.

  7. fujicoin commented at 10:11 AM on January 20, 2021: none

    The SIGNET_HEADER is a bit like a file type magic (edit: maybe not the best comparison), so it must be constant. Closing.

    SIGNET_HEADER is only used in two places in signet.cpp, not elsewhere. Where does it need to be constant?

  8. fujicoin commented at 10:17 AM on January 20, 2021: none

    ★ Anyway, no one can launch a personal signet with the released bitcoin v0.21.0.

  9. sipa commented at 10:42 PM on January 21, 2021: member

    Why does a personal signet need a separate network magic?

  10. fujicoin commented at 12:46 AM on January 22, 2021: none

    A personal signet requires a personal signet challenge. The signet network magic is defined by the signet challenge. Therefore, network magic will be different for each personal signet. The signet commitment included in the coinbase transaction includes the signet header (magic). It is verified with the following code. https://github.com/bitcoin/bitcoin/blob/95ea54ba089610019a74c1176a2c7c0dba144b1c/src/signet.cpp#L41 If SIGNET_HEADER is specified as a constant on the 26th line, the personal signet block will be rejected. In the case of bitcoin v0.21.0, personal signet will not start just by modifying signet.cpp.

  11. ajtowns commented at 5:50 AM on January 22, 2021: member

    Why does a personal signet need a separate network magic?

    signet network magic is defined as the first four bytes of the sha256d of the signet challenge, so since a personal signet will have a unique challenge, each personal signet will also have an approximately unique network magic, which helps avoid accidently merging two incompatible personal signets at the p2p layer.

    SIGNET_HEADER is a different value, though -- it just identifies which part of the witness commitment is the block signature, and (as it stands, without this pr) doesn't differ between signets. It's similar to the witness commitment identifier; it's not the same as the signet network magic.

  12. fujicoin commented at 8:24 AM on January 22, 2021: none

    Well, I was confused with Signet derived magic (message start) from the name SIGNET_HEADER. That's a different value than the default signet magic (0a03cf40). I understand it very well, thank you.

  13. fujicoin deleted the branch on Jan 22, 2021
  14. fanquake locked this on Feb 22, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-29 03:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me