Skip to content

Instantly share code, notes, and snippets.

Last active February 15, 2024 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xmrk-btc/f21fd8649dcd573679f043836e3ef05f to your computer and use it in GitHub Desktop.
Save xmrk-btc/f21fd8649dcd573679f043836e3ef05f to your computer and use it in GitHub Desktop.
How to return money from penalty tx
See first 2 comments for instructions and signature, signed by my node's private key.
Pay by lightning:
On chain - separate address for each node:
⚡️🪐 Parsecs 🪐⚡️ bc1qnlpmtusnycwws9zm862cpj4wtuctrsrm9tv4vh
Horseshoe bc1q2cujjpw2l2ax6smjtz5ju3f62eaexdzwflfyqv
Viva Bitcoin bc1q3g8wrft3thtpnleg2pterv5wgx8skgrxgsefhl
Cypher bc1qtc3cjn893j6hmrzec8rstlaqnrl0lz0920wrys
Zireael🦅 [Main] bc1qjst9n3544rat74z3w0sfazgndn7l23udmgphcm
Shockwave Rider bc1qmrgdceqc9hrha4czslgp56n2z04jpch37kv7zv
wyssblitz bc1qdukqkjykyzn9jpg9t6f2k4lxw32kghjsggp4jl
MidWestLNd bc1qaa54wknuuzjgxrkpgyks59et3t5vk07pww7x93 bc1qjtj3ganp79efct8hsgkxj6h9jwfl2gtn6cjhfs
Satway bc1q384x5wkmqarx9xugkqr2jvquuualg0zh6rz60n
Aldebaran bc1qcs0svnyt06nn8ssl763e06sktkjj5s4zhshs2u
Garlic🧄 bc1q27wck75wl575rel0x4p8gwwqj77zwdxca9q4ye
Ngu Technologies bc1qkulqk203e0c6vg7e2ah0d2du3z7cryztdulvte
Copy link

xmrk-btc commented Feb 5, 2024

11/Feb - my instructions do not account for HTLCs which were not yet resolved at time of forced close, will update when I know more
7/Feb - signed by my node'd priv key, should be safe to pay now. Coinos may not work for large amounts, I can accept liquid if you want to save fees and get rid of liquid, ask for L-BTC address if interested.

Thank you for doing this.

  • determine the amount you should send. Note that my node broadcast old state of the channel which is not relevant.
    • lncli (command line): run lncli closedchannels | less , you may need to supply path where lncli is. Search for my channel by typing "/033878". Take value of fields "settled_amount" and "closing_tx_hash".
    • RTL - go to peers -> closed channel, search the channel with xmrk, take "Settled amount" and "Closing transaction hash".
    • others (c-lightning, eclair?) - TODO if needed
  • if the following is too complicated, just estimate on-chain fees you spent on my channel - opening, closing and penalty tx - I should pay for all 3. And send me channel_total_capacity - settled_balance - your_on_chain_fee_estimate.
  • to account exactly for on-chain fees, follow the closing_tx_hash in some blockchain explorer (for example - you need the tx which spends closing_tx_hash, ignore anchors (330 sats outputs) and follow some of the other output.
  • look how much you received from that channel. There will be 3 txs: opening, my incorrect close tx, and your penalty tx.
  • possible complication if your node didn't spend all UTXOs from closing_tx_hash in one tx, seems it didn't happen.
  • verify the text of this gist ("the original post") - see comment below. Send to the address according to the gist, every node has separate address so I can distinguish who sent it. Deduct your on-chain fees for that tx also (or I can refund it later via lightning if too complicated).

Example for Garlic:

  • Channel capacity was 10M sats.
  • closing_tx_hash is b881e337ff7a412df1a1ff0220afb6b4b96102cc71d81b82f570fd32349bab70
  • Penalty tx is , it spends only UTXOs from my closing tx, good. This tx has one UTXO of 9969447 sats, so 10M - 9969447 = 30553 sats was paid in onchain fees, I assume that cost.
  • Imagine Garlic's settled_amount is 5200000 sats (not real). Then Garlic should send me 9969447 - 5200000 = 4769447 sats.

Copy link

xmrk-btc commented Feb 7, 2024

Verify signature:
~/go/bin/lncli verifymessage "$(wget -O -" d71rrzrh837xtqf9e4f83853kknusx4fne8sssf5ua7zuk63f3gagzdrdb5hmzxxix7ghgg3xyo4yer5cnn77g7p7rs5fuqt8fofatp4

Expected output - pls check that pubkey is mine:

    "valid": true,
    "pubkey": "033878501f9a4ce97dba9a6bba4e540eca46cb129a322eb98ea1749ed18ab67735"

Copy link

xmrk-btc commented Feb 7, 2024

Hall of fame - nodes which returned me funds

Those at least contacted me

and seem ready to return funds, and I am slow to react, so not their fault:

Responded and willing to refund me

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment