Signature
org.sigilaris.core.crypto.Signature
ECDSA signature with recovery parameter for secp256k1.
Represents a recoverable ECDSA signature consisting of (v, r, s) where:
- v is the recovery parameter (27-30) allowing public key recovery
- r is the x-coordinate of the ephemeral public key
- s is the signature proof value
Value parameters
- r
-
signature component r, 32-byte datatype.UInt256
- s
-
signature component s, 32-byte datatype.UInt256, normalized to Low-S form (s ≤ n/2)
- v
-
recovery parameter, typically 27 or 28 (27 + recId where recId is 0 or 1)
Attributes
- See also
-
Sign for signature creation
Recover for public key recovery
CryptoOps.sign for signing
CryptoOps.recover for recovery
- Note
-
Signatures are normalized to Low-S form (s ≤ n/2) to prevent malleability
- Example
-
val keyPair = CryptoOps.generate() val hash = CryptoOps.keccak256("message".getBytes) val signature = CryptoOps.sign(keyPair, hash).toOption.get // Recover public key from signature val recovered = CryptoOps.recover(signature, hash) - Source
- Signature.scala
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Members list
In this article