lnd.xprv/lnwallet
Olaoluwa Osuntokun 94c242073a
lnwallet: finish initial draft of LightningChannel state machine
This commit finishes the initial draft of the commitment state machine.
A full re-write of the prior protocol which combines aspects of the
former ‘lnstate’ package has replaced the prior un-finished
stop-and-wait protocol.

This new protocol is designed to operate in an asynchronous environment
and to facilitate non-blocking batched and pipelined updates to the
committed channel states. The protocol is also de-synchronized meaning
that either side can propose new commitment states independent of the
actions of the other party.

The state machine implemented is very similar to that of c-lightning,
however we allow multiple unrevoked commentates in order to minimize
blocking, and also to reduce latency across several hops in a
bi-directional setting.

The current implementation consists of 3 main data structures: a
commitment chain which consist of unrevoked commitment transactions
(one for each side), and a (mostly) append-only log of HTLC updates
shared between both sides. New commitments proposed index into the log
denoting which updates they include, this allows both parties to
progress chains independent of one another. Revoked commitments, reduce
the length of the chain by one, and free up space within the revocation
window.

At this point only basic tests are in place for the state machine,
however more extensive testing infrastructure along with formal proofs
using PlusCall are planned.
2016-07-05 17:02:03 -07:00
..
channel_test.go lnwallet: finish initial draft of LightningChannel state machine 2016-07-05 17:02:03 -07:00
channel.go lnwallet: finish initial draft of LightningChannel state machine 2016-07-05 17:02:03 -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: update reservation workflow to revoke keys 2016-06-30 12:02:51 -07:00
script_utils_test.go lnwallet: createCommitTx now a revocation key 2016-06-30 12:12:19 -07:00
script_utils.go lnwallet: correct comment in revoke derivation explanation 2016-07-05 16:49:27 -07:00
setup.go multi: change all imports to roasbeef's forks 2016-05-15 17:22:37 +03:00
wallet_test.go lnwallet: finish initial draft of LightningChannel state machine 2016-07-05 17:02:03 -07:00
wallet.go lnwallet: keep commitments cold at all times, store sig instead 2016-07-05 16:55:47 -07:00