Interface KeysInterface.KeysInterfaceInterface

  • Enclosing class:
    KeysInterface

    public static interface KeysInterface.KeysInterfaceInterface
    • Method Detail

      • get_node_secret

        Result_SecretKeyNoneZ get_node_secret​(Recipient recipient)
        Get node secret key based on the provided [`Recipient`]. The node_id/network_key is the public key that corresponds to this secret key. This method must return the same value each time it is called with a given `Recipient` parameter.
      • get_destination_script

        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

        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.
      • get_channel_signer

        Sign get_channel_signer​(boolean inbound,
                                long channel_value_satoshis)
        Get a new set of Sign for per-channel secrets. These MUST be unique even if you restarted with some stale data! This method must return a different value each time it is called.
      • get_secure_random_bytes

        byte[] get_secure_random_bytes()
        Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting onion packets and for temporary channel IDs. There is no requirement that these be persisted anywhere, though they must be unique across restarts. This method must return a different value each time it is called.
      • read_chan_signer

        Result_SignDecodeErrorZ read_chan_signer​(byte[] reader)
        Reads a `Signer` for this `KeysInterface` from the given input stream. This is only called during deserialization of other objects which contain `Sign`-implementing objects (ie `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.
      • sign_invoice

        Result_RecoverableSignatureNoneZ sign_invoice​(byte[] hrp_bytes,
                                                      UInt5[] invoice_data,
                                                      Recipient receipient)
        Sign an invoice. By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of this trait to parse the invoice and make sure they're signing what they expect, rather than blindly signing the hash. The hrp is ascii bytes, while the invoice data is base32. The secret key used to sign the invoice is dependent on the [`Recipient`].
      • get_inbound_payment_key_material

        byte[] get_inbound_payment_key_material()
        Get secret key material as bytes for use in encrypting and decrypting inbound payment data. If the implementor of this trait supports [phantom node payments], then every node that is intended to be included in the phantom invoice route hints must return the same value from this method. This method must return the same value each time it is called. [phantom node payments]: PhantomKeysManager