Research/Bitcoin Dev Archive / lightning-dev list
Recovering a channel state
2 messages, Oct 21 to 24, 2016. Started by Anton Kumaigorodskiy.
Anton Kumaigorodskiy, Rusty Russell
Mobile devices often get lost/stolen/data erased/etc so possibility of channel recovering or at least having an ability to break it unilaterally on a new device has to be somehow accounted for.
These are my thoughts so far:
1. The easiest one seems to be an ability to do a unilateral close: on new channel creation it's essential parameters (sufficient to establish an encrypted connection and send an `error` message) are recorded on some server and later retrieved in a case of need.
2. Ability to fully recover a latest channel state seems tricky: a server could be used to sync an entire state on each commit but in this case we'd have to trust a server to never provide an outdated snapshot (and attempt to use an outdated snapshot with a revoked commit is the worst possible scenario). Also once we lose a history of revoked transactions we'd have to completely rely on a chain watcher's honesty from here on (assuming we use a watcher which has to be a case on mobile device).
I was thinking maybe it is somehow possible to directly ask counterparty to provide us the latest channel state? Since counterparty has a mirrored view of our current state it should be fully reconstructible and we can check our own commit tx signature to make sure the snapshot is not completely made up (assuming commit and final keys are derived from a mnemonic code so we can always regenerate them). But once again there seems to be no way to check that snapshot supplied by counterparty is an unrevoked one because at this point we have neither a ShaChain nor a history of revoked commit transactions (we could probably ask a chain watcher if it has such a commit transaction but it once again involves trust).
I'd like to hear your thoughts whether it's possible to get a latest channel snapshot from counterparty in a trustless manner or if it's a good idea at all. If not then what about unilateral close in a way described above?
Anton
Anton Kumaigorodskiy <anton.kumaigorodskiy at outlook.com> writes:
Quoted text (3 lines)
> Mobile devices often get lost/stolen/data erased/etc so possibility of > channel recovering or at least having an ability to break it > unilaterally on a new device has to be somehow accounted for.
Yes, this is a fun topic! In particular it's one we deferred for 1.0, but it's important to discuss.
Let's assume you still have your ID: if you lose that key, you're screwed.
Tadge has done a lot of work on outsourcing vigilence: uploading encrypted information to watchers. This has almost enough information for you to reconstruct the current state, sufficient to mutually close the channel.
There's an interesting subset of this, which you could do with your peers. Each peer would keep some amount of (encrypted) data for you, and *always* send it to you whenever you first connect (if you have to ask for it, that's giving too much away).
As long as one peer is honest, you get enough state to at least cleanly shutdown the other peers without getting robbed, or, indeed, them knowing that you had data loss.
There's a lot more work to be done enumerating exactly how this works, however.
Cheers, Rusty.