You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: 02-peer-protocol.md
+10-7
Original file line number
Diff line number
Diff line change
@@ -1765,7 +1765,7 @@ the closing transaction will likely never reach miners.
1765
1765
`OP_RETURN` is only standard if followed by PUSH opcodes, and the total script
1766
1766
is 83 bytes or less. We are slightly stricter, to only allow a single PUSH, but
1767
1767
there are two forms in script: one which pushes up to 75 bytes, and a longer
1768
-
one (OP_PUSHDATA1) which is needed for 76-80 bytes.
1768
+
one (`OP_PUSHDATA1`) which is needed for 76-80 bytes.
1769
1769
1770
1770
### Closing Negotiation: `closing_complete` and `closing_sig`
1771
1771
@@ -1819,6 +1819,7 @@ The sender of `closing_complete` (aka. "the closer"):
1819
1819
- MUST set `fee_satoshis` to a fee less than or equal to its outstanding balance, rounded down to whole satoshis.
1820
1820
- MUST set `fee_satoshis` so that at least one output is not dust.
1821
1821
- MUST use the last sent and received `shutdown.scriptpubkey` to generate the closing transaction specified in [BOLT #3](03-transactions.md#closing-transaction).
1822
+
- MUST set `locktime` to the desired `nLockTime` of the closing transaction.
1822
1823
- MUST set `signature` fields as valid signature using its `funding_pubkey` of:
1823
1824
-`closer_output_only`: closing transaction with only the local ("closer") output.
1824
1825
-`closee_output_only`: closing transaction with only the remote ("closee") output.
@@ -1858,12 +1859,12 @@ The receiver of `closing_complete` (aka. "the closee"):
1858
1859
- If the signature field is non-compliant with LOW-S-standard rule<sup>[LOWS](https://github.com/bitcoin/bitcoin/pull/6769)</sup>:
1859
1860
- MUST either send a `warning` and close the connection, or send an `error` and fail the channel.
1860
1861
- MUST sign and broadcast the corresponding closing transaction.
1861
-
- MUST send `closing_sig` with a single valid signature in the same tlv field as the `closing_complete`.
1862
+
- MUST send `closing_sig` with a single valid signature in the same TLV field as the `closing_complete`.
1862
1863
1863
1864
The receiver of `closing_sig`:
1864
1865
- if `tlvs` does not contain exactly one signature:
1865
1866
- MUST either send a `warning` and close the connection, or send an `error` and fail the channel.
1866
-
- if `tlvs` does not contain one of the tlv fields sent in `closing_complete`:
1867
+
- if `tlvs` does not contain one of the TLV fields sent in `closing_complete`:
1867
1868
- MUST ignore `closing_sig`.
1868
1869
- if the signature field is not valid for the corresponding closing transaction specified in [BOLT #3](03-transactions.md#closing-transaction):
1869
1870
- MUST ignore `closing_sig`.
@@ -1881,9 +1882,9 @@ If one side has less funds than the other, it may choose to omit its own output,
1881
1882
dust MUST be omitted, to ensure that the resulting transaction can be broadcast.
1882
1883
1883
1884
The corner case where fees are so high that both outputs are dust is addressed in two ways: paying
1884
-
a low fee to avoid the problem, or using an OP_RETURN (which is never "dust"). If one side chooses
1885
-
to use an `OP_RETURN` output, its amount must be 0 to ensure that the resulting transaction can be
1886
-
broadcast.
1885
+
a low fee to avoid the problem, or using an `OP_RETURN` (which is never "dust"). If one side
1886
+
chooses to use an `OP_RETURN` output, its amount must be 0 to ensure that the resulting transaction
1887
+
can be broadcast.
1887
1888
1888
1889
Note that there is usually no reason to pay a high fee for rapid processing, since an urgent child
1889
1890
could pay the fee on the closing transactions' behalf. If rapid processing is desired and CPFP is
@@ -1900,7 +1901,9 @@ signatures are simply ignored.
1900
1901
When sending a new `shutdown`, we must receive a new `shutdown` from the remote node before
1901
1902
sending `closing_complete`. This is necessary to be compatible with future taproot channels
1902
1903
that use musig2 and need to exchange random nonces every time a transaction spending the channel
1903
-
output is signed.
1904
+
output is signed. Note that the remote `shutdown` doesn't need to be an explicit response to the
1905
+
local `shutdown` that was sent: if both nodes concurrently send `shutdown`, they can exchange
1906
+
`closing_complete` immediately after receiving the remote `shutdown`.
1904
1907
1905
1908
If the closer proposes a transaction which will not relay (an output is dust, or the fee rate it
1906
1909
proposes is too low), it doesn't harm the closee to sign the transaction.
@@ -349,7 +350,7 @@ The witness script for the output is:
349
350
350
351
To spend this via penalty, the remote node uses a witness stack `<revocationsig> 1`, and to collect the output, the local node uses an input with nSequence `to_self_delay` and a witness stack `<local_delayedsig> 0`.
351
352
352
-
## Classic Closing Transaction
353
+
## Legacy Closing Transaction
353
354
354
355
This variant is used for `closing_signed` messages (i.e. where `option_simple_close` is not negotiated).
| 18/19 |`option_support_large_channel`| Can create large channels | IN ||[BOLT #2](02-peer-protocol.md#the-open_channel-message)|
44
-
| 22/23 |`option_anchors`| Anchor commitment type with zero fee HTLC transactions | IN ||[BOLT #3][bolt03-htlc-tx], [lightning-dev][ml-sighash-single-harmful]|
| 18/19 |`option_support_large_channel`| Can create large channels | IN ||[BOLT #2](02-peer-protocol.md#the-open_channel-message)|
44
+
| 22/23 |`option_anchors`| Anchor commitment type with zero fee HTLC transactions | IN ||[BOLT #3][bolt03-htlc-tx], [lightning-dev][ml-sighash-single-harmful]|
0 commit comments