Skip to content

Commit

Permalink
dual-funding: accept_channel2 must also use the temporary channel-id
Browse files Browse the repository at this point in the history
So that it knows what open_channel2 is responding to.

Spotted-By: @rustyrussell
  • Loading branch information
niftynei committed Apr 23, 2021
1 parent f53ca23 commit fceb18a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions 02-peer-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ SHA256(lesser-revocation-basepoint || greater-revocation-basepoint),
where the lesser and greater is based off the order of the basepoint.
The basepoints are compact DER-encoded public keys.

If the peer's revocation basepoint is unknown (e.g. `open_channel2`),
a temporary `channel_id` should be found by using a zeroed out basepoint for the unknown peer.
If the peer's revocation basepoint is unknown (e.g. `open_channel2`
and `accept_channel2`), a temporary `channel_id` should be found by
using a zeroed out basepoint for the unknown peer.

#### Rationale
These values must be remembered by both peers for correct operation anyway.
Expand Down Expand Up @@ -979,6 +980,10 @@ Instead, the channel reserve is fixed at 1% of the total channel balance
rounded down to the nearest whole satoshi or the `dust_limit_satoshis`,
whichever is greater.

`channel_id` for the `accept_channel2` MUST be derived using a zero-d out
basepoint for the peer's revocation basepoint. This allows the peer to
return channel-assignable errors before the *accepter*'s revocation
basepoint is known.

### Funding Composition
Funding composition for channel establishment v2 makes use of the
Expand Down

0 comments on commit fceb18a

Please sign in to comment.