Skip to content

Commit cd4cc20

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 d8021c7 commit cd4cc20

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
@@ -904,6 +904,17 @@ pub trait SignerProvider {
904904
fn get_shutdown_scriptpubkey(&self) -> Result<ShutdownScript, ()>;
905905
}
906906

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

0 commit comments

Comments
 (0)