File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ use bitcoin::blockdata::script::Script;
11
11
12
12
use secp256k1:: key:: SecretKey ;
13
13
14
+ use ln:: channel:: ChannelKeys ;
14
15
use util:: events;
15
16
16
17
/// A trait to describe a wallet which sould receive data to be able to spend onchain outputs
@@ -68,3 +69,21 @@ impl CustomOutputScriptDescriptor {
68
69
}
69
70
}
70
71
}
72
+
73
+ /// A trait to describe an object which should get secrets from user wallet and apply derivation
74
+ /// to provide keys materials downstream
75
+ pub trait KeysInterface : Send + Sync {
76
+ /// User wallet has to provide this KeysInterface with a master seed used to derive
77
+ /// node_id as /0' and destination_script as /N'
78
+ fn provide_master_seed ( & mut self , seed : & [ u8 ; 32 ] ) ;
79
+ /// Get node secret key to derive node_id
80
+ fn get_node_secret ( & self ) -> Option < SecretKey > ;
81
+ /// Get destination redeemScript to encumber static protocol exit points. For now
82
+ /// redeemScript is a pay-2-public-key-hash.
83
+ fn get_destination_script ( & self ) -> Option < Script > ;
84
+ /// Get shutdown_pubkey to use as PublicKey at channel closure
85
+ fn get_shutdown_pubkey ( & self ) -> Option < PublicKey > ;
86
+ /// Get a new set of ChannelKeys from per-channel random key /3/N'
87
+ /// For Channel N, keys correspond to ChannelKeys::new_from_seed(/3/N')
88
+ fn get_channel_keys ( & mut self ) -> Option < ChannelKeys > ;
89
+ }
You can’t perform that action at this time.
0 commit comments