lnd.xprv/lnwallet
Olaoluwa Osuntokun e22734f9cf
lnwallet: update HTLC+commitment scripts
This commit updates the previous HTLC and commitment scripts to their
current latest evolution.

The HTLC scripts have been optimized for space savings, the
functionality itself has remained relatively unchanged. A trade off was
made to add additional bytes into the sigScript in order to avoid
extraneous CHECKSIG’s. The rationale is that an extra 1-2 bytes in the
sigScript to guide execution, are worthwhile since they’re in the
witness, and witness data may be pruned in the near future.

The primary change is within the commitment transaction itself. Instead
of using revocation hashes, we now use signature based revocation. This
saves space in the Script, and optimizes away an extra hashing
operation. Elkrem/shachain is still used but, we now use the pre-images
to homomorphically derive a public key which the other party will be
able to sign with, once we disclose the pre-image itself.

Finally, we have switched to using SHA-256 everywhere uniformly for
both revocation hashes, and payment hashes. The rationale is that the
output of ripemd160 is too small for modern security margins, and that
other coins/chains are more likely to have SHA-256 implemented, than
ripemd160.

A set of tests has also been included which contain (mostly) exhaustive
tests of all possible redemption paths for both commitment and HTLC.
2016-06-27 11:35:32 -07:00
..
channel.go lnwallet: update HTLC+commitment scripts 2016-06-27 11:35:32 -07:00
coin_select.go multi: change all imports to roasbeef's forks 2016-05-15 17:22:37 +03:00
config.go multi: change all imports to roasbeef's forks 2016-05-15 17:22:37 +03:00
interface.go multi: change all imports to roasbeef's forks 2016-05-15 17:22:37 +03:00
log.go multi: change all imports to roasbeef's forks 2016-05-15 17:22:37 +03:00
reservation.go lnwallet: payment and revocation hashes are now 32 bytes 2016-06-26 23:04:14 -07:00
script_utils_test.go lnwallet: update HTLC+commitment scripts 2016-06-27 11:35:32 -07:00
script_utils.go lnwallet: update HTLC+commitment scripts 2016-06-27 11:35:32 -07:00
setup.go multi: change all imports to roasbeef's forks 2016-05-15 17:22:37 +03:00
wallet_test.go lnwallet: payment and revocation hashes are now 32 bytes 2016-06-26 23:04:14 -07:00
wallet.go lnd: introduce the fundingManager 2016-06-21 13:13:49 -07:00