Skip to content

Conversation

@petertodd
Copy link
Contributor

Makes it possible to compactly provide a delibrately invalid signature for use with CHECK(MULTI)SIG. For instance with BIP19 if m != n invalid signatures need to be provided in the scriptSig; prior to this change those invalid signatures would need to be large DER-encoded signatures.

Note that we may want to further expand on this change in the future by saying that only OP_0 is a "valid" invalid signature; BIP19 even with this change is inherently malleable as the invalid signatures can be any validly encoded DER signature.

CC: @sipa

Makes it possible to compactly provide a delibrately invalid signature
for use with CHECK(MULTI)SIG. For instance with BIP19 if m != n invalid
signatures need to be provided in the scriptSig; prior to this change
those invalid signatures would need to be large DER-encoded signatures.

Note that we may want to further expand on this change in the future by
saying that only OP_0 is a "valid" invalid signature; BIP19 even with
this change is inherently malleable as the invalid signatures can be any
validly encoded DER signature.
@petertodd petertodd force-pushed the bip62-compact-validly-encoded-invalid-sigs branch from 96e7c1e to 2fa9a8e Compare January 9, 2015 11:03
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not 100% clear on why this code was duplicated; the next lines are identical but with "OP_0 << OP_1" rather than "OP_0 << OP_0". I believe this was just exercising different ways of failing the DER encoding, so I removed the way that is now valid.

@petertodd
Copy link
Contributor Author

See also the corresponding pull-req to BIP62: bitcoin/bips#132

@sipa
Copy link
Member

sipa commented Jan 9, 2015

ACK

1 similar comment
@gmaxwell
Copy link
Contributor

ACK

@laanwj laanwj merged commit 2fa9a8e into bitcoin:master Jan 26, 2015
laanwj added a commit that referenced this pull request Jan 26, 2015
2fa9a8e Make empty byte arrays pass CheckSignatureEncoding() (Peter Todd)
laanwj pushed a commit that referenced this pull request Jan 26, 2015
Makes it possible to compactly provide a delibrately invalid signature
for use with CHECK(MULTI)SIG. For instance with BIP19 if m != n invalid
signatures need to be provided in the scriptSig; prior to this change
those invalid signatures would need to be large DER-encoded signatures.

Note that we may want to further expand on this change in the future by
saying that only OP_0 is a "valid" invalid signature; BIP19 even with
this change is inherently malleable as the invalid signatures can be any
validly encoded DER signature.

Rebased-From: 2fa9a8e
Github-Pull: #5627
@laanwj laanwj added this to the 0.10.0 milestone Jan 26, 2015
@laanwj
Copy link
Member

laanwj commented Jan 26, 2015

backported into 0.10 as b24ff47

reddink pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request May 27, 2020
Makes it possible to compactly provide a delibrately invalid signature
for use with CHECK(MULTI)SIG. For instance with BIP19 if m != n invalid
signatures need to be provided in the scriptSig; prior to this change
those invalid signatures would need to be large DER-encoded signatures.

Note that we may want to further expand on this change in the future by
saying that only OP_0 is a "valid" invalid signature; BIP19 even with
this change is inherently malleable as the invalid signatures can be any
validly encoded DER signature.

Rebased-From: 2fa9a8e
Github-Pull: bitcoin#5627
(cherry picked from commit b24ff47)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants