Class S256Point


  • public class S256Point
    extends Point
    A point (public key) on a secp256k1 elliptic curve
    • Field Detail

      • N

        public static final Int N
        Constant N
    • Method Detail

      • getG

        public static S256Point getG()

        Getter for the field g.

        Returns:
        a S256Point object
      • mul

        public S256Point mul​(Int coefficient)

        mul.

        Overrides:
        mul in class Point
        Parameters:
        coefficient - a Int object
        Returns:
        a Point object
      • verify

        public boolean verify​(Int z,
                              Signature signature)

        verify.

        Parameters:
        z - a Int object
        signature - a Signature object
        Returns:
        a boolean
      • sec

        public byte[] sec​(Boolean compressed)
        returns the binary version of the SEC format
        Parameters:
        compressed - a Boolean object
        Returns:
        an array of byte objects
      • hash160

        public byte[] hash160​(Boolean compressed)

        hash160.

        Parameters:
        compressed - a Boolean object
        Returns:
        an array of byte objects
      • address

        public String address​(Boolean compressed,
                              boolean testnet)
        Returns the address string
        Parameters:
        compressed - a Boolean object
        testnet - a boolean
        Returns:
        a String object
      • addressBech32P2wpkh

        public String addressBech32P2wpkh​(boolean testnet)
        Returns the bech32 p2wpkh address
        Parameters:
        testnet -
        Returns:
      • parse

        public static S256Point parse​(byte[] secBin)
        returns a Point object from a SEC binary (not hex)
        Parameters:
        secBin - an array of byte objects
        Returns:
        a S256Point object