lnwallet: update commitmentKeyRing to account for distinct HTLC keys

In this commit, we update all the key derivation within the state
machine to account for the recent spec change which introduces a
distinct key for usages within all HTLC scripts. This change means that
the commitment payment and delay base points, are only required to be
online in the case that a party is forced to go to chain.

We introduce an additional local tweak to the keyring for the HTLC
tweak. Additionally, two new keys have been added: a local and a remote
HTLC key. Generation of sender/receiver HTLC scripts now use the local
and remote HTLC keys rather than the “payment” key for each party.
Finally, when creating/verifying signatures for second-level HTLC
transactions, we use these the distinct HTLC keys, rather than re-using
the payment keys.
This commit is contained in:
Olaoluwa Osuntokun committed 2017-11-16 20:00:03 -08:00
1 parent a812974808
commit d7cdf822e3
3 files changed
+106 -63

No files matched your search

+1 -1
View File
@@ -74,7 +74,7 @@ func TestCommitmentSpendValidation(t *testing.T) {
keyRing := &commitmentKeyRing{
delayKey: aliceDelayKey,
revocationKey: revokePubKey,
paymentKey: bobPayKey,
noDelayKey: bobPayKey,
}
commitmentTx, err := CreateCommitTx(fakeFundingTxIn, keyRing, csvTimeout,
channelBalance, channelBalance, DefaultDustLimit())