Class PhantomKeysManager


  • public class PhantomKeysManager
    extends Object
    Similar to [`KeysManager`], but allows the node using this struct to receive phantom node payments. A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be paid to one of multiple nodes. This works because we encode the invoice route hints such that LDK will recognize an incoming payment as destined for a phantom node, and collect the payment itself without ever needing to forward to this fake node. Phantom node payments are useful for load balancing between multiple LDK nodes. They also provide some fault tolerance, because payers will automatically retry paying other provided nodes in the case that one node goes down. Note that multi-path payments are not supported in phantom invoices for security reasons. Switching between this struct and [`KeysManager`] will invalidate any previously issued invoices and attempts to pay previous invoices will fail.
    • Method Detail

      • as_EntropySource

        public EntropySource as_EntropySource()
        Constructs a new EntropySource which calls the relevant methods on this_arg. This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
      • as_NodeSigner

        public NodeSigner as_NodeSigner()
        Constructs a new NodeSigner which calls the relevant methods on this_arg. This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
      • as_SignerProvider

        public SignerProvider as_SignerProvider()
        Constructs a new SignerProvider which calls the relevant methods on this_arg. This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
      • of

        public static PhantomKeysManager of​(byte[] seed,
                                            long starting_time_secs,
                                            int starting_time_nanos,
                                            byte[] cross_node_seed)
        Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed` that is shared across all nodes that intend to participate in [phantom node payments] together. See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and `starting_time_nanos`. `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the same across restarts, or else inbound payments may fail. [phantom node payments]: PhantomKeysManager
      • spend_spendable_outputs

        public Result_TransactionNoneZ spend_spendable_outputs​(SpendableOutputDescriptor[] descriptors,
                                                               TxOut[] outputs,
                                                               byte[] change_destination_script,
                                                               int feerate_sat_per_1000_weight)
        See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
      • derive_channel_keys

        public InMemorySigner derive_channel_keys​(long channel_value_satoshis,
                                                  byte[] params)
        See [`KeysManager::derive_channel_keys`] for documentation on this method.
      • get_node_secret_key

        public byte[] get_node_secret_key()
        Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
      • get_phantom_node_secret_key

        public byte[] get_phantom_node_secret_key()
        Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the last-hop onion data, etc.