Skip to content

Instantly share code, notes, and snippets.

@masterial
Last active September 29, 2023 21:11
Show Gist options
  • Save masterial/463f9e00f1350ddd692f925124803ca0 to your computer and use it in GitHub Desktop.
Save masterial/463f9e00f1350ddd692f925124803ca0 to your computer and use it in GitHub Desktop.
Lost Funds Recovery Procedure

Lost Fund Recovery

Preliminary

  1. Identify unused inputs (no a channel yielding input)
  2. Store into DB
  1. Export .lnd and seed phrase from node (database and filetree)
  2. Create lnd node setup + channel tools
  3. Create script for generating PSBT transaction for each unidentified input (TXN_A) COUNT_A
  4. Store output in DB
  1. Export .lnd from all and seed phrase nodes (database and filetree) Constraint disk space (N nodes times disc size per .lnd)
  2. Create lnd node setup + channel tools
  3. Create script for swapping .lnd and unlocking the wallet
  4. Create script for interfacing with channeltools to counter sign each of (TXN_A) (TXN_B)
  5. Create a script for broadcasting (TXN_B)

Number of transacriont to broadcast: COUNT_A times NODE_COUNT

Time: .lnd backup ~1-5mins -> times NODE_COUNT .lnd swap + unlock ~1-min -> times NODE_COUNT TXN_B broadcast + mempool clearing 10min - 1hour -> times TNX_A times NODE_COUNT

Questions: Will running any channeltools command modify the .lnd in any way? Does the .lnd need to be imported back? Does the remote node have to be down while pulling .lnd? What happens when fake TXN_B is broadcasted?

Total transactions to broadcast > 90,000, is that a problem?

https://1ml.com/node/031472f13e38602e9c05d51e521ad15bf0ddc22ee6cd96aa53a992564a42133c13

node_routing:
node_leaf: zion-8d22b9a-m


NEO_2 : chantools rescuefunding --channeldb /pathto/db --channelpoint 5d1fbbdfdb857ac978fb478c5af8fd98afe680ae3994c63916a633f0b611e3a6:0 --confirmedchannelpoint 4eb5b39e74f08f0f7d2e25660fc2064dd209d6f27dc4d136c1dc9275429430a7:0 --sweepaddr RECOVERYAADDRS --fee-rate x

checked thunderhub funds not there

Algorithm for finding good nodes ( 1 channel = 1 transaction)

Find all the good ones

  • Get list of all pub_keys for selected leaf nodes (Hub)

1 channel = 1 txns VALID

1 channel != 1 txns INVALID

BAD ADDRESS FORENSICS

  • Find txn_id:index for good and bad txns (S1) ** Good txn_id = original channel_point [ORIGIN_POINT] (S2) ** Bad (S1-S2) ** --confirmedchannelpoint == ??? also not sure where the transaction came from

Find the routing node based on the address

  • Need to know which routing node for channeltools input
  • Both keys have to be valid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment