Skip to content

Commit

Permalink
Use empty TLV flag
Browse files Browse the repository at this point in the history
Similar to what is done for `require_confirmed_inputs`.
We add a requirement for the receiver of `accept_channel` and
`accept_channel2`.
  • Loading branch information
t-bast committed Oct 25, 2023
1 parent 2b41937 commit 95f7ad1
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions blip-0030.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,12 @@ Additional TLV fields for the `open_channel2` message:
1. `tlv_stream`: `open_channel2_tlvs`
2. types:
1. type: 32768 (`zero_reserve`)
2. data:
* [`byte`:`use_zero_reserve`]

Additional TLV fields for the `accept_channel2` message:

1. `tlv_stream`: `accept_channel2_tlvs`
2. types:
1. type: 32768 (`zero_reserve`)
2. data:
* [`byte`:`use_zero_reserve`]

### Requirements

Expand All @@ -51,7 +47,7 @@ A node that wants to support zero-reserve channels:

When sending `open_channel`:

* If `zero_reserve` was negotiated:
* If the `zero_reserve` feature was negotiated:
* MAY set `channel_reserve_satoshis` to `0`

When receiving `open_channel`:
Expand All @@ -62,19 +58,31 @@ When receiving `open_channel`:
* Otherwise:
* MUST send an `error` and forget the channel

When receiving `accept_channel`:

* If `channel_reserve_satoshis` was set to `0` in `open_channel`, and it is
not set to `0` in `accept_channel`:
* MUST send an `error` and forget the channel

When sending `open_channel2`:

* If `zero_reserve` was negotiated:
* MAY set the `zero_reserve` TLV field to `1`
* If the `zero_reserve` feature was negotiated:
* MAY set the `zero_reserve` TLV field

When receiving `open_channel2`:

* If `zero_reserve` is set to `1`:
* If the `zero_reserve` TLV field is set:
* If it wants to use `zero_reserve`:
* MUST set the `zero_reserve` TLV field to `1` in `accept_channel2`
* MUST set the `zero_reserve` TLV field in `accept_channel2`
* Otherwise:
* MUST send an `error` and forget the channel

When receiving `accept_channel2`:

* If `zero_reserve` was set in `open_channel2`, and it is not set in
`accept_channel2`:
* MUST send an `error` and forget the channel

When sending or receiving `update_add_htlc`:

* If `zero_reserve` has been negotiated:
Expand Down

0 comments on commit 95f7ad1

Please sign in to comment.