Description
This is in regard to the newly proposed support for ECDSA/secp256r1 (NIST P-256) account keys. See #7718 and #8899.
An important detail to capture with these signatures is malleability. For comparison, ECDSA/secp256k1 signatures are almost always low-S normalized in order to make them non-malleable. However, P-256 signatures are not typically used in consensus-critical applications and therefore are not normalized.
Normalization is a relatively simple procedure: if an ECDSA/secp256r1 signature is 64-bytes structured as r || s
, if s
is greater than half of the field modulus (i.e. curve order), subtract s
from the modulus. It can be retroactively applied to signatures generated from HSMs and other hardware devices.
Primarily this impacts the verification rules: signatures which are not low-S normalized MUST be rejected. Doing so will prevent malleability-related issues with ECDSA/secp256r1 signatures the same way the similar procedure prevents them with ECDSA/secp256k1 signatures.