- /// Get a secret and PRNG seed for constructing an onion packet
- fn get_onion_rand(&self) -> (SecretKey, [u8; 32]);
- /// Get a unique temporary channel id. Channels will be referred to by this until the funding
- /// transaction is created, at which point they will use the outpoint in the funding
- /// transaction.
- fn get_channel_id(&self) -> [u8; 32];
-}
-
-#[derive(Clone)]
-/// Holds late-bound channel data.
-/// This data is available after the channel is known to be accepted, either
-/// when receiving an open_channel for an inbound channel or when
-/// receiving accept_channel for an outbound channel.
-struct AcceptedChannelData {
- /// Remote public keys and base points
- remote_channel_pubkeys: ChannelPublicKeys,
- /// The to_self_delay value specified by our counterparty and applied on locally-broadcastable
- /// transactions, ie the amount of time that we have to wait to recover our funds if we
- /// broadcast a transaction. You'll likely want to pass this to the
- /// ln::chan_utils::build*_transaction functions when signing local transactions.
- remote_to_self_delay: u16,
- /// The to_self_delay value specified by us and applied on transactions broadcastable
- /// by our counterparty, ie the amount of time that they have to wait to recover their funds
- /// if they broadcast a transaction.
- local_to_self_delay: u16,
+ /// 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.
+ fn get_secure_random_bytes(&self) -> [u8; 32];
+
+ /// Reads a `ChanKeySigner` for this `KeysInterface` from the given input stream.
+ /// This is only called during deserialization of other objects which contain
+ /// `ChannelKeys`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
+ /// The bytes are exactly those which `<Self::ChanKeySigner as Writeable>::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.
+ fn read_chan_signer(&self, reader: &[u8]) -> Result<Self::ChanKeySigner, DecodeError>;