Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PierreRochard/7c7ce932868315dfbaa6c92d5c337b43 to your computer and use it in GitHub Desktop.
Save PierreRochard/7c7ce932868315dfbaa6c92d5c337b43 to your computer and use it in GitHub Desktop.
Your version of the commitment transaction that you are holding off-chain (with HTLCs)
# Based on a diagram posted by @pm47 https://github.com/lightningnetwork/lightning-rfc/issues/553#issuecomment-455641943
+------------------------------------------------+
| 2-of-2 multi-sig funding tx confirmed on-chain |
+------------------------------------------------+
|
|
|
|
|
|
|
| +---------------------------------------------------------------------------+
\------| your version of the commitment transaction that you are holding off-chain |
+---------------------------------------------------------------------------+
| | | |
| | | |
* * | | output with my channel balance
| | | \------------------------------------- I can spend it immediately upon you broadcasting this tx
| | |
* * |
| | |
| | |
* * |
| | | ,-- you can spend it one day after you broadcast this tx
| | | output with your channel balance /
* * \-----------------------------------<
| | \
| | `-- I can spend it if you broadcast this tx and I have the revocation key (punishment!)
* *
| |
| |
* *
| | ,-- you can spend it one day after you broadcast this tx
| | /
* * ,-- if the absolute timelock expires... ---<
| | your payment to me / (refund to you) \
| \-------------------< `-- I can spend it if you broadcast this tx and I have the revocation key (punishment!)
* (HTLC output) \
| `-- I can spend it if you broadcast this tx and I have the secret payment preimage
| \
* `- I can spend it if you broadcast this tx and I have the revocation key (punishment!)
|
|
*
|
| ,-- you can spend it one day after broadcasting this tx
* /
| ,-- if you have the secret payment preimage ---<
| my payment to you / \
\----------------------< `-- I can spend it if you broadcast this tx and I have the revocation key (punishment!)
(HTLC output) \
`-- I can spend it if the absolute timelock expires (refund to me)
\
`- I can spend it if you broadcast this tx and I have the revocation key (punishment!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment