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 Details

    • address

      public 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.
    • canonicalizeS

      public static Natural canonicalizeS​(Natural s)
      Canonicalizes the s 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.