Skip to content

Commit d6a090f

Browse files
committed
Introduce ChangeDestinationSource trait
.. which users should implement on their on-chain wallet to allow us to retrieve a new change destination script.
1 parent 9a90677 commit d6a090f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lightning/src/sign/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,17 @@ pub trait SignerProvider {
909909
fn get_shutdown_scriptpubkey(&self) -> Result<ShutdownScript, ()>;
910910
}
911911

912+
/// A helper trait that describes an on-chain wallet capable of returning a (change) destination
913+
/// script.
914+
pub trait ChangeDestinationSource {
915+
/// Returns a script pubkey which can be used as a change destination for
916+
/// [`OutputSpender::spend_spendable_outputs`].
917+
///
918+
/// This method should return a different value each time it is called, to avoid linking
919+
/// on-chain funds controlled to the same user.
920+
fn get_change_destination_script(&self) -> Result<ScriptBuf, ()>;
921+
}
922+
912923
/// A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
913924
///
914925
/// This implementation performs no policy checks and is insufficient by itself as

0 commit comments

Comments
 (0)