Class LogicsigSignature


  • public class LogicsigSignature
    extends Object
    Serializable logicsig class. LogicsigSignature is constructed from a program and optional arguments. Signature sig and MultisigSignature msig property are available for modification by its clients.

    LogicsigSignature cannot sign transactions in all cases. Instead, use LogicSigAccount as a safe, general purpose signing mechanism. Since LogicSig does not track the provided signature's public key, LogicSig cannot sign transactions when delegated to a non-multisig account _and_ the sender is not the delegating account.

    • Constructor Detail

      • LogicsigSignature

        public LogicsigSignature​(byte[] logic,
                                 List<byte[]> args,
                                 byte[] sig,
                                 MultisigSignature msig)
      • LogicsigSignature

        public LogicsigSignature​(byte[] logicsig)
        Unsigned logicsig object.
        Parameters:
        logicsig -
      • LogicsigSignature

        public LogicsigSignature​(byte[] logicsig,
                                 List<byte[]> args)
        Unsigned logicsig object, and its arguments.
        Parameters:
        logicsig -
        args -
      • LogicsigSignature

        public LogicsigSignature()
        Uninitialized object used for serializer to ignore default values.
    • Method Detail

      • toAddress

        public Address toAddress()
                          throws NoSuchAlgorithmException
        Calculate escrow address from logic sig program NOTE: THIS RETURNS AN ESCROW ACCOUNT OF A LOGIC-SIG (FROM LOGIC ITSELF), IT WILL NOT RETURN THE DELEGATED ADDRESS OF THE LOGIC-SIG.
        Returns:
        Address
        Throws:
        NoSuchAlgorithmException
      • bytesToSign

        public byte[] bytesToSign()
        Return prefixed program as byte array that is ready to sign
        Returns:
        byte[]
      • verify

        public boolean verify​(Address singleSigner)
                       throws NoSuchAlgorithmException
        Perform signature verification against the sender address
        Parameters:
        singleSigner - only used in the case of a delegated LogicSig whose delegating account is backed by a single private key
        Returns:
        boolean
        Throws:
        NoSuchAlgorithmException