Skip to content

Slight cleanup of signet commitment description#976

Merged
luke-jr merged 2 commits intobitcoin:masterfrom
instagibbs:patch-13
Oct 5, 2020
Merged

Slight cleanup of signet commitment description#976
luke-jr merged 2 commits intobitcoin:masterfrom
instagibbs:patch-13

Conversation

@instagibbs
Copy link
Copy Markdown
Member

"either" and "Signet scriptSig header" seem to make no sense here, if other touchups are disagreeable I can drop them.

Copy link
Copy Markdown
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the either refers to the fact that one of (scriptSig, scriptWitness) can be empty, but not both.

Comment thread bip-0325.mediawiki Outdated
@maflcko
Copy link
Copy Markdown
Member

maflcko commented Aug 25, 2020

Could mention the BIP number in the pull subject line?

Also, cc @kallewoof

@kallewoof
Copy link
Copy Markdown
Contributor

ACK. Thanks for making that more understandable!

Ping @luke-jr.

Comment thread bip-0325.mediawiki Outdated
A new type of network ("signet"), which takes an additional consensus parameter called the challenge (scriptPubKey). The challenge can be a simple pubkey (P2PKH style), or a k-of-n multisig, or any other script you would want.

The witness commitment of the coinbase transaction is extended to include a secondary commitment (the signature/solution) of either:
Signet requires all blocks to have a BIP 141 commitment in the coinbase transaction. The BIP 141 commitment's optional data must include an additional commitment of the signature/solution for the block:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it contradicts the text from #983: "There is one other acceptable special case: if a block's challenge is e.g. OP_TRUE (0x51), where an empty solution would result in success, the block is also considered valid if the signet commitment is absent"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good point. @instagibbs there is an exception now for the case where if the challenge is enough to satisfy (e.g. OP_TRUE); in this case, the signet commitment may be omitted entirely.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which case the BIP 141 commitment isn't required either

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Signet requires all blocks to have a BIP 141 commitment in the coinbase transaction. In order to provide a solution to the block challenge, the BIP 141 commitment's optional data must include an additional commitment of the solution for the block: [...]. In the special case where an empty solution is valid (ie scriptSig and scriptWitness are both empty) this additional commitment can optionally be left out. This special case is to allow non-signet-aware block generation code to be used to test a custom signet chain where the challenge is OP_TRUE.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a modified version of what you posted, noting that bip141 commitment is only required with non-empty solutions, and that any "trivial" challenge can be used to avoid requiring fancy mining software for non-signature tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the current code requires a bip141 commitment even with empty solutions. Should this be changed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are correct: bitcoin/bitcoin@d0f364c#diff-4bdd7c44636dae0429a4d61909eeed17R90

I think for simplicity it's fine to require it. Any objections?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplicity is good. Let's require

Comment thread bip-0325.mediawiki Outdated
The witness commitment of the coinbase transaction is extended to include a secondary commitment (the signature/solution) of either:
Signet requires all blocks to have a BIP 141 commitment in the coinbase transaction. The BIP 141 commitment's optional data must include an additional commitment of the signature/solution for the block:

1-4 bytes - Push the following (4 + x + y) bytes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be 1-5 bytes (1 byte if 4+x+y <= 75, 2 bytes for PUSHDATA1 if 4+x+y < 256, 3 bytes for PUSHDATA2 if 4+x+y < 65536, and 5 bytes for PUSHDATA4).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maflcko
Copy link
Copy Markdown
Member

maflcko commented Sep 8, 2020

@instagibbs needs rebase

@instagibbs
Copy link
Copy Markdown
Member Author

rebased/squashed

@kallewoof
Copy link
Copy Markdown
Contributor

ACK, please merge at your convenience, @luke-jr.

Copy link
Copy Markdown
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better with or without my suggested change

Comment thread bip-0325.mediawiki Outdated
Co-authored-by: MarcoFalke <falkemarco@gmail.com>
@kallewoof
Copy link
Copy Markdown
Contributor

ACK

@maflcko
Copy link
Copy Markdown
Member

maflcko commented Sep 9, 2020

@luke-jr ;)

@luke-jr luke-jr merged commit 471ec4a into bitcoin:master Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants