Class SignerProvider


  • public class SignerProvider
    extends Object
    A trait that can return signer instances for individual channels.
    • Method Detail

      • destroy

        public void destroy()
        Destroys the object, freeing associated resources. After this call, any access to this object may result in a SEGFAULT or worse. You should generally NEVER call this method. You should let the garbage collector do this for you when it finalizes objects. However, it may be useful for types which represent locks and should be closed immediately to avoid holding locks until the GC runs.
      • generate_channel_keys_id

        public byte[] generate_channel_keys_id​(boolean inbound,
                                               long channel_value_satoshis,
                                               UInt128 user_channel_id)
        Generates a unique `channel_keys_id` that can be used to obtain a [`Self::Signer`] through [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow implementations of [`SignerProvider`] to maintain a mapping between itself and the generated `channel_keys_id`. This method must return a different value each time it is called.
      • derive_channel_signer

        public WriteableEcdsaChannelSigner derive_channel_signer​(long channel_value_satoshis,
                                                                 byte[] channel_keys_id)
        Derives the private key material backing a `Signer`. To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be re-derived from its `channel_keys_id`, which can be obtained through its trait method [`ChannelSigner::channel_keys_id`].
      • read_chan_signer

        public Result_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer​(byte[] reader)
        Reads a [`Signer`] for this [`SignerProvider`] from the given input stream. This is only called during deserialization of other objects which contain [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). The bytes are exactly those which `::write()` writes, and contain no versioning scheme. You may wish to include your own version prefix and ensure you've read all of the provided bytes to ensure no corruption occurred. This method is slowly being phased out -- it will only be called when reading objects written by LDK versions prior to 0.0.113. [`Signer`]: Self::Signer [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
      • get_destination_script

        public byte[] get_destination_script()
        Get a script pubkey which we send funds to when claiming on-chain contestable outputs. This method should return a different value each time it is called, to avoid linking on-chain funds across channels as controlled to the same user.
      • get_shutdown_scriptpubkey

        public ShutdownScript get_shutdown_scriptpubkey()
        Get a script pubkey which we will send funds to when closing a channel. This method should return a different value each time it is called, to avoid linking on-chain funds across channels as controlled to the same user.