-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed as not planned
Labels
I5-enhancementAn additional feature request.An additional feature request.
Description
Is there an existing issue?
- I have searched the existing issues
Experiencing problems? Have you tried our Stack Exchange first?
- This is not a support question.
Motivation
The sp_core::ecdsa::Signature represents a recoverable ECDSA signature in a compact form (65 bytes: 64-byte signature + 1-byte recovery ID). While signature verification can be performed without the recovery ID when the associated public key is known, the current implementation of sp_core::ecdsa::Signature mandates the inclusion of the recovery ID. Specifically, sp_core::ecdsa::Pair::verify() utilizes the recover() method internally, thus preventing the verification of a 64-byte signature without the recovery ID. This feature is necessary to support signature verification for external protocols such as Cosmos SDK.
Request
Introduce a method to verify a 64-byte ECDSA signature without requiring the recovery ID.
Solution
- Modify
sp_core::ecdsa::Pair::verify()to leverage the underlying libraries (k256 or secp256k1) to handle the verification with a 64-byte signature. In this scenario, the last byte ofsp_core::ecdsa::Signature(recovery ID) will be ignored, potentially altering the function's behavior. - Implement a new function, such as
sp_io::crypto::secp256k1_ecdsa_verify(), that accepts a 64-byte signature, the message hash, and the public key for verification purposes.
Are you willing to help with this request?
Yes!
Metadata
Metadata
Assignees
Labels
I5-enhancementAn additional feature request.An additional feature request.