Package com.norswap.nanoeth.signature
Class SignatureUtils
java.lang.Object
com.norswap.nanoeth.signature.SignatureUtils
public final class SignatureUtils extends Object
Signature-related utilities that don't obviously belong in other classes.
-
Method Summary
Modifier and Type Method Description static Address
address(ECPoint publicKey)
Returns the address of the Ethereum account associated with the public key, which is formed by the 20 rightmost byte of the hash of the public key's encoding.static Natural
canonicalizeS(Natural s)
Canonicalizes thes
signature value if needed.
-
Method Details
-
address
Returns the address of the Ethereum account associated with the public key, which is formed by the 20 rightmost byte of the hash of the public key's encoding. -
canonicalizeS
Canonicalizes thes
signature value if needed.Canonicalization is required because for every signature (r,s) the signature (r, -s (mod n)) is a valid signature of the same message. See signature package README for more information.
This change was introduced in EIP-2 (Homestead). We apply it to all transactions, since canonicalized transactions are valid before Homestead as well.
-