Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecc: ecdsa_verify to enforce low-S rule #9070

Merged
merged 2 commits into from
May 28, 2024

Conversation

SomberNight
Copy link
Member

This is mainly an API change, which I think makes behaviour simpler to reason about.


The low-S rule for ecdsa signatures is mandated by Bitcoin Core policy/standardness (though not by consensus). If we get signatures from untrusted sources, we should mandate they obey the policy rules. (e.g. from LN peers)

Note that we normalize the signatures in the sig format conversion methods (DER <-> (r,s) <-> sig64).

The BOLTs treat high-S signatures as invalid, and this changes our behaviour to that.
(previously we would silently normalize the s value)

Note that $ bitcoin-cli verifymessage does NOT enforce the low-S rule for ecdsa sigs, and we make sure to do the same. (so no change for that)

see bitcoin/bitcoin#6769
see lightning/bolts#807

The low-S rule for ecdsa signatures is mandated by Bitcoin Core policy/standardness (though not by consensus). If we get signatures from untrusted sources, we should mandate they obey the policy rules. (e.g. from LN peers)

Note that we normalize the signatures in the sig format conversion methods (DER <-> (r,s) <-> sig64).

The BOLTs treat high-S signatures as invalid, and this changes our behaviour to that.
(previously we would silently normalize the S value)

see bitcoin/bitcoin#6769
see lightning/bolts#807
@SomberNight SomberNight merged commit 9f74ba4 into spesmilo:master May 28, 2024
13 of 15 checks passed
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.

1 participant