Class TxCreationKeys


  • public class TxCreationKeys
    extends Object
    The set of public keys which are used in the creation of one commitment transaction. These are derived from the channel base keys and per-commitment data. A broadcaster key is provided from potential broadcaster of the computed transaction. A countersignatory key is coming from a protocol participant unable to broadcast the transaction. These keys are assumed to be good, either because the code derived them from channel basepoints via the new function, or they were obtained via CommitmentTransaction.trust().keys() because we trusted the source of the pre-calculated keys.
    • Method Detail

      • get_per_commitment_point

        public byte[] get_per_commitment_point()
        The broadcaster's per-commitment public key which was used to derive the other keys.
      • set_per_commitment_point

        public void set_per_commitment_point​(byte[] val)
        The broadcaster's per-commitment public key which was used to derive the other keys.
      • get_revocation_key

        public byte[] get_revocation_key()
        The revocation key which is used to allow the broadcaster of the commitment transaction to provide their counterparty the ability to punish them if they broadcast an old state.
      • set_revocation_key

        public void set_revocation_key​(byte[] val)
        The revocation key which is used to allow the broadcaster of the commitment transaction to provide their counterparty the ability to punish them if they broadcast an old state.
      • get_broadcaster_htlc_key

        public byte[] get_broadcaster_htlc_key()
        Broadcaster's HTLC Key
      • set_broadcaster_htlc_key

        public void set_broadcaster_htlc_key​(byte[] val)
        Broadcaster's HTLC Key
      • get_countersignatory_htlc_key

        public byte[] get_countersignatory_htlc_key()
        Countersignatory's HTLC Key
      • set_countersignatory_htlc_key

        public void set_countersignatory_htlc_key​(byte[] val)
        Countersignatory's HTLC Key
      • get_broadcaster_delayed_payment_key

        public byte[] get_broadcaster_delayed_payment_key()
        Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
      • set_broadcaster_delayed_payment_key

        public void set_broadcaster_delayed_payment_key​(byte[] val)
        Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
      • of

        public static TxCreationKeys of​(byte[] per_commitment_point_arg,
                                        byte[] revocation_key_arg,
                                        byte[] broadcaster_htlc_key_arg,
                                        byte[] countersignatory_htlc_key_arg,
                                        byte[] broadcaster_delayed_payment_key_arg)
        Constructs a new TxCreationKeys given each field
      • eq

        public boolean eq​(TxCreationKeys b)
        Checks if two TxCreationKeyss contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
      • write

        public byte[] write()
        Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
      • derive_new

        public static TxCreationKeys derive_new​(byte[] per_commitment_point,
                                                byte[] broadcaster_delayed_payment_base,
                                                byte[] broadcaster_htlc_base,
                                                byte[] countersignatory_revocation_base,
                                                byte[] countersignatory_htlc_base)
        Create per-state keys from channel base points and the per-commitment point. Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
      • from_channel_static_keys

        public static TxCreationKeys from_channel_static_keys​(byte[] per_commitment_point,
                                                              ChannelPublicKeys broadcaster_keys,
                                                              ChannelPublicKeys countersignatory_keys)
        Generate per-state keys from channel static keys. Key set is asymmetric and can't be used as part of counter-signatory set of transactions.