Skip to content

Commit 35814b6

Browse files
Antoine RiardTheBlueMatt
Antoine Riard
authored andcommitted
Document more current security assumption of KeysInterface
Improve some comments of interface methods.
1 parent 262666a commit 35814b6

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

lightning/src/chain/keysinterface.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,22 @@ pub trait KeysInterface: Send + Sync {
9494

9595
/// Set of lightning keys needed to operate a channel as described in BOLT 3.
9696
///
97+
/// Signing services could be implemented on a hardware wallet. In this case,
98+
/// the current ChannelKeys would be a front-end on top of a communication
99+
/// channel connected to your secure device and lightning key material wouldn't
100+
/// reside on a hot server. Nevertheless, a this deployment would still need
101+
/// to trust the ChannelManager to avoid loss of funds as this latest component
102+
/// could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
103+
///
104+
/// A more secure iteration would be to use hashlock (or payment points) to pair
105+
/// invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
106+
/// at the price of more state and computation on the hardware wallet side. In the future,
107+
/// we are looking forward to design such interface.
108+
///
109+
/// In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
110+
/// to act, as liveness and breach reply correctness are always going to be hard requirements
111+
/// of LN security model, orthogonal of key management issues.
112+
///
97113
/// If you're implementing a custom signer, you almost certainly want to implement
98114
/// Readable/Writable to serialize out a unique reference to this set of keys so
99115
/// that you can serialize the full ChannelManager object.
@@ -106,9 +122,10 @@ pub trait ChannelKeys : Send {
106122
fn funding_key<'a>(&'a self) -> &'a SecretKey;
107123
/// Gets the local secret key for blinded revocation pubkey
108124
fn revocation_base_key<'a>(&'a self) -> &'a SecretKey;
109-
/// Gets the local secret key used in commitment tx htlc outputs
125+
/// Gets the local secret key used in to_remote output of remote commitment tx
126+
/// (and also as part of obscured commitment number)
110127
fn payment_base_key<'a>(&'a self) -> &'a SecretKey;
111-
/// Gets the local secret key used in HTLC tx
128+
/// Gets the local secret key used in HTLC-Success/HTLC-Timeout txn and to_local output
112129
fn delayed_payment_base_key<'a>(&'a self) -> &'a SecretKey;
113130
/// Gets the local htlc secret key used in commitment tx htlc outputs
114131
fn htlc_base_key<'a>(&'a self) -> &'a SecretKey;

0 commit comments

Comments
 (0)