@@ -978,16 +978,16 @@ acceptance of the new channel.
978
978
* [ ` shutdown_len*byte ` :` shutdown_scriptpubkey ` ]
979
979
1 . type: 2 (` will_fund ` )
980
980
2 . data:
981
- * [ ` lease_rates ` :` lease_rates ` ]
982
981
* [ ` signature ` :` signature ` ]
982
+ * [ ` lease_rates ` :` lease_rates ` ]
983
983
984
984
1 . subtype: ` lease_rates `
985
985
2 . data:
986
- * [ ` u16 ` :` funding_fee_proportional_basis ` ]
987
- * [ ` u32 ` :` funding_fee_base_sat ` ]
988
- * [ ` u16 ` :` funding_weight_max ` ]
989
- * [ ` u16 ` :` channel_fee_proportional_basis_max ` ]
990
- * [ ` tu32 ` :` channel_fee_base_max_msat ` ]
986
+ * [ ` u16 ` :` funding_weight ` ]
987
+ * [ ` u16 ` :` lease_fee_basis ` ]
988
+ * [ ` u16 ` :` channel_fee_max_proportional_thousandths ` ]
989
+ * [ ` u32 ` :` lease_fee_base_sat ` ]
990
+ * [ ` tu32 ` :` channel_fee_max_base_msat ` ]
991
991
992
992
Rationale and Requirements are the same as listed above,
993
993
for [ ` accept_channel ` ] ( #the-accept_channel-message ) with the following
@@ -1004,33 +1004,36 @@ The accepting node:
1004
1004
- if they decide to accept the offer:
1005
1005
- MUST include a ` will_fund ` tlv
1006
1006
- MUST set ` funding_satoshis ` to a value greater than 0msat
1007
- - MAY provide a ` funding_satoshis ` of any amount.
1008
- - MUST set ` funding_fee_base_sat ` to the base fee
1007
+ - MAY send ` funding_satoshis ` less than ` requested_sats `
1008
+ - MUST set ` lease_fee_base_sat ` to the base fee
1009
1009
(in satoshi) it will charge for the ` funding_satoshis `
1010
- - MUST set ` funding_fee_proportional_basis ` to the amount
1010
+ - MUST set ` lease_fee_basis ` to the amount
1011
1011
(in thousandths of satoshi) it will charge per ` funding_satoshi `
1012
- - MUST set ` funding_weight ` to the weight they
1013
- will contribute to this channel, to fund the request .
1014
- - MUST set ` channel_fee_base_max_msat ` to the base fee
1012
+ - MUST set ` funding_weight ` to the weight they will charge
1013
+ the peer for .
1014
+ - MUST set ` channel_fee_max_base_msat ` to the base fee
1015
1015
(in millisatoshi) it will charge for any HTLC on this channel
1016
1016
during the funding period.
1017
- - MUST set ` channel_fee_proportional_basis_max ` to the amount
1017
+ - MUST set ` channel_fee_max_proportional_thousandths ` to the amount
1018
1018
(in thousandths of a satoshi) it will charge per transferred
1019
1019
satoshi during the funding period.
1020
1020
- MUST set ` signature ` to the ECDSA signature of
1021
- SHA256("option_will_fund" || ` funding_pubkey ` || ` blockheight ` ||
1022
- ` channel_fee_base_max_msat ` || ` channel_fee_proportional_basis_max ` )
1021
+ SHA256("option_will_fund" || ` funding_pubkey ` || ` blockheight ` + 4032 ||
1022
+ ` channel_fee_max_base_msat ` || ` channel_fee_max_proportional_thousandths ` )
1023
1023
using the node_id key.
1024
1024
1025
1025
The receiving node:
1026
1026
- SHOULD fail the negotiation if:
1027
1027
- they sent ` request_funds ` tlv and:
1028
1028
- the ` funding_satoshi ` is less than required
1029
- - the ` funding_fee_proportional_basis ` is too high
1030
- - the ` funding_fee_base_sat ` is too high
1029
+ - the ` lease_fee_basis ` is too high
1030
+ - the ` lease_fee_base_sat ` is too high
1031
1031
- the ` funding_weight ` is too high
1032
- - the ` channel_fee_proportional_basis_max ` is too high
1033
- - the ` channel_fee_base_max_msat ` is too high
1032
+ - the ` channel_fee_max_proportional_thousandths ` is too high
1033
+ - the ` channel_fee_max_base_msat ` is too high
1034
+ - the ` signature ` is invalid
1035
+ - SHOULD accept the negotiation if:
1036
+ - the ` funding_satoshi ` is excess of ` requested_sats `
1034
1037
- MUST fail the negotiation if they receive a ` will_fund ` tlv and:
1035
1038
- they DID NOT send a ` request_funds ` tlv
1036
1039
@@ -1064,26 +1067,29 @@ total lease fee at a rate of `funding_weight` times the
1064
1067
` funding_feerate_perkw ` established in ` open_channel2 ` .
1065
1068
1066
1069
The total lease fee is added to the accepter node's output in the
1067
- commitment transaction. It is equal to the ` funding_fee_base_sat ` +
1068
- ` accept_channel2 ` .` funding_satoshis ` * ` funding_fee_proportional_basis `
1069
- + ` funding_feerate_perkw ` * ` funding_weight ` / 1000, rounded
1070
- down to the nearest satoshi. See [ Appendix A: The lease fee] ( #appendix-a-the-lease-fee ) .
1071
-
1072
- ` signature ` signs the accepter node's ` funding_pubkey ` , the opener's
1073
- ` locktime ` , and the returned ` channel_fee ` parameters. This provides the opener
1070
+ commitment transaction. It is equal to the ` lease_fee_base_sat ` +
1071
+ min(` accept_channel2 ` .` funding_satoshis ` ,` open_channel2 ` .` requested_sats ` )
1072
+ * ` lease_fee_basis ` / 10_000 + ` funding_feerate_perkw ` *
1073
+ ` funding_weight ` / 1000, rounded down to the nearest satoshi. See [ Appendix A: The lease fee] ( #appendix-a-the-lease-fee ) .
1074
+
1075
+ ` signature ` signs the leasing node's ` funding_pubkey ` , the
1076
+ lease expiration block (opener's ` blockheight ` + 4032), and the returned
1077
+ ` channel_fee ` parameters. This provides the opener
1074
1078
with proof in the case the accepter does not maintain the stated
1075
1079
` channel_fee ` rates during the channel's funding lease.
1076
1080
1077
- If the initiating node sent ` request_funds ` and the accepting node replied
1078
- with ` will_fund ` this channel is considered 'leased'. The lease ends
1079
- 4032 blocks after the ` open_channel2 ` ` blockheight ` , i.e.
1080
- ` lease_end ` is defined as the ` open_channel2 ` .` blockheight ` + 4032.
1081
+ The lessor is the ` accepter ` , who contributes funds to the channel for a fee.
1082
+ The lessee is the ` opener ` , who requests for funds and pays the lessor a fee
1083
+ for the funds they contribute to the channel. A lease is defined as being for
1084
+ 4032 blocks; a ` lease_end ` is defined as the ` open_channel2 ` .` blockheight `
1085
+ + 4032 . If the initiating node sent ` request_funds ` and the
1086
+ accepting node replied with ` will_fund ` this channel is considered 'leased'.
1081
1087
1082
- During the lease, the initiator should consider limiting
1083
- the rate funds are routed through the channel as this provides the opener
1088
+ During the duration of the lease, the lessee may limit
1089
+ the rate funds are routed through the channel as this provides the lessor
1084
1090
the opportunity to move the funds elsewhere (and renders the
1085
- lease fairly useless). A sensible policy here depends on the motivation of the
1086
- opener in acquiring the leased funds .
1091
+ lease lock fairly useless). A sensible policy here depends on the
1092
+ motivation of the lessee in acquiring the lease .
1087
1093
1088
1094
### Funding Composition
1089
1095
Funding composition for channel establishment v2 makes use of the
@@ -1986,25 +1992,33 @@ The node _responsible_ for initiating the channel:
1986
1992
1987
1993
The node _ not responsible_ for initiating the channel:
1988
1994
- MUST NOT send ` update_blockheight ` .
1995
+ - if last received ` blockheight ` is > 1008:
1996
+ - SHOULD fail he channel
1989
1997
1990
1998
A receiving node:
1991
1999
- if the ` update_blockheight ` is less than the last received ` blockheight ` :
1992
2000
- SHOULD fail the channel.
1993
2001
- if the sender is not the initiator:
1994
2002
- MUST fail the channel.
1995
- - if ` blockheight ` is more than 504 blocks behind the current blockheight:
2003
+ - if ` blockheight ` is more than 1008 blocks behind the current blockheight:
1996
2004
- SHOULD fail the channel
1997
2005
- MUST apply the provided blockheight to their commitment transaction
1998
2006
1999
2007
#### Rationale
2000
2008
An up-to-date ` blockheight ` is required to ensure that the funding
2001
- lease expires 4032 blocks after the channel is established. (??)
2009
+ lease expires 4032 blocks after the channel is established.
2002
2010
2003
2011
The opener updates the blockheight, as they are motivated to keep
2004
2012
the channel open. They do this by continuing to decrement the lock on
2005
2013
the commitment output for their peer as the funding lease expiration
2006
2014
approaches.
2007
2015
2016
+ The lessor's lease is only shortened when a new ` blockheight ` is committed,
2017
+ otherwise it's always 4032 blocks in the future. If the peer doesn't
2018
+ update the blockheight, at some point it has to start the closing process
2019
+ to retrieve its funds. 1008 blocks seems a reasonable (but not compulsory!)
2020
+ answer here.
2021
+
2008
2022
## Message Retransmission
2009
2023
2010
2024
Because communication transports are unreliable, and may need to be
@@ -2247,38 +2261,49 @@ the lease fee, and their tx weight * `funding_feerate_perkw` / 1000.
2247
2261
2248
2262
The lease fee is calculated as:
2249
2263
2250
- `funding_fee_base_sat ` +
2251
- `accept_channel2`.`funding_satoshis` * `funding_fee_proportional_basis ` / 1000 +
2264
+ `lease_fee_base_sat ` +
2265
+ min( `accept_channel2`.`funding_satoshis`, `open_channel2`.`requested_sats`) * `lease_fee_basis ` / 10_000 +
2252
2266
`funding_weight` * `funding_feerate_perkw` / 1000
2253
2267
2254
2268
E.g.
2255
- An node requests 100.0000sats at a feerate of 2500perkw. They
2256
- are contributing 50.0000sats . Their weight contribution to the
2269
+ An node requests 1_000_000sats at a feerate of 2500perkw. They
2270
+ are contributing 500_000sats . Their weight contribution to the
2257
2271
funding transaction will be 720.
2258
2272
2259
- The accepter charges a base funding fee of 233sats with a
2260
- proportional basis of 22. Their weight charge is 444. The lease fee is as
2261
- follows:
2273
+ The accepter adds 1,100,000sats and charges a base funding fee of
2274
+ 233sats with a lease fee basis of 22. Their funding weight is 444.
2275
+ The lease fee is as follows:
2262
2276
2263
- 233 + 100.0000 * 22 / 1000 + 444 * 2500 / 1000
2277
+ 233 + min(1_000_000,1_100_000) * 22 / 10_000 + 444 * 2500 / 1000
2264
2278
2265
- The total lease fee for this open is 3.3333sats .
2279
+ The total lease fee for this open is 3543sats .
2266
2280
2267
2281
The outputs to the peers in the commitment transaction will be
2268
2282
2269
- to-initiator: 50.0000sats
2270
- to-accepter: 103.3333sats
2283
+ to-opener: 500_000sats
2284
+ to-accepter: 1_103_543sats
2285
+
2286
+ The miner fee for the opener will be 720 * 2500 / 1000 or 1800sats.
2271
2287
2272
- The miner fee for the initiator will be 720 * 2500 / 1000 or 1800sats.
2288
+ Minimum funds that the opener must contribute to the channel open
2289
+ transaction:
2290
+
2291
+ open_channel2.funding_satoshis: 500_000sats
2292
+ lease fee: 3_543sats
2293
+ miner fee: 1_800sats
2294
+
2295
+ total required contribution: 505_343sats
2273
2296
2274
- Minimum funds that the initiator must contribute to the channel open
2297
+ Minimum funds that the accepter must contribute to the channel open
2275
2298
transaction:
2276
2299
2277
- open_channel2.funding_satoshis: 50.0000sats
2278
- lease fee: 3.3333sats
2279
- miner fee: 1800sats
2300
+ accept_channel2.funding_satoshis: 1_100_000sats
2301
+ miner fee[1]: 1_110sats
2302
+
2303
+ total required contribution: 1_101_110sats
2304
+
2280
2305
2281
- total required contribution: 53.5133sats
2306
+ [ 1 ] assumes ` 444 ` is their total weight for this transaction.
2282
2307
2283
2308
2284
2309
# Authors
0 commit comments