hsmtools: add a tool to recover a to_remote
output from peer unilateral close
#3217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This builds upon #3186 (starts at 02a1934).
I suffered a power outage some weeks ago and lost the
dbid
of many channels from the database, the remote peer has then unilaterally closed the channel : I was not able to recover the private key from theto_remote
output of its commitment transaction without thedbid
. Since I've seen others in the same situation (this has been in the news, too...), here is a tool which derivesn
payment keys for everydbid
and compares it to the pubkeyhash output in the witness program (we just take a bech32 P2WPKH address and derive the goal hash from it).