@@ -514,11 +514,6 @@ The origin node:
514514 - SHOULD NOT create redundant ` channel_update ` s
515515 - If it creates a new ` channel_update ` with updated channel parameters:
516516 - SHOULD keep accepting the previous channel parameters for 10 minutes
517- - If it is the seller of a currently active ` duration_based_funding_lease ` on this channel:
518- - MUST NOT set ` fee_base_msat ` greater than ` max_channel_fee_base_msat `
519- (as committed to in ` will_fund.signature ` ).
520- - MUST NOT set ` fee_proportional_millionths ` greater than ` max_channel_fee_basis * 100 `
521- (as committed to in ` will_fund.signature ` ).
522517
523518The receiving node:
524519 - if the ` short_channel_id ` does NOT match a previous ` channel_announcement ` ,
@@ -1172,9 +1167,6 @@ are selling depending on the guarantees offered to buyers.
11721167 1 . type: 1 (` basic_funding_leases ` )
11731168 2 . data:
11741169 * [ ` ...*basic_funding_lease ` :` funding_lease_rates ` ]
1175- 1 . type: 3 (` duration_based_funding_leases ` )
1176- 2 . data:
1177- * [ ` ...*duration_based_funding_lease ` :` funding_lease_rates ` ]
11781170
117911711 . subtype: ` request_funds `
118011722 . data:
@@ -1186,19 +1178,6 @@ are selling depending on the guarantees offered to buyers.
118611782 . data:
11871179 * [ ` u32 ` :` min_lease_amount_sat ` ]
11881180 * [ ` u32 ` :` max_lease_amount_sat ` ]
1189- * [ ` funding_lease_fee ` :` funding_lease_fee ` ]
1190-
1191- 1 . ` lease_type ` : 3 (` duration_based_funding_lease ` )
1192- 2 . data:
1193- * [ ` u16 ` :` lease_duration ` ]
1194- * [ ` u32 ` :` min_lease_amount_sat ` ]
1195- * [ ` u32 ` :` max_lease_amount_sat ` ]
1196- * [ ` funding_lease_fee ` :` funding_lease_fee ` ]
1197- * [ ` u16 ` :` max_channel_fee_basis ` ]
1198- * [ ` u32 ` :` max_channel_fee_base_msat ` ]
1199-
1200- 1 . subtype: ` funding_lease_fee `
1201- 2 . data:
12021181 * [ ` u16 ` :` funding_weight ` ]
12031182 * [ ` u16 ` :` lease_fee_basis ` ]
12041183 * [ ` u32 ` :` lease_fee_base_sat ` ]
@@ -1214,14 +1193,6 @@ are selling depending on the guarantees offered to buyers.
12141193 * [ ` u16 ` :` funding_script_size ` ]
12151194 * [ ` funding_script_size ` :` funding_script ` ]
12161195
1217- 1 . ` lease_witness_type ` : 3 (` duration_based_funding_lease_witness ` )
1218- 2 . data:
1219- * [ ` u32 ` :` lease_expiry ` ]
1220- * [ ` u16 ` :` funding_script_size ` ]
1221- * [ ` funding_script_size ` :` funding_script ` ]
1222- * [ ` u16 ` :` max_channel_fee_basis ` ]
1223- * [ ` u32 ` :` max_channel_fee_base_msat ` ]
1224-
12251196Sellers may offer multiple ` lease_type ` s, described in the following sections.
12261197Buyers select a specific lease offered by the seller and use ` request_funds `
12271198to purchase that lease. Sellers answer with ` will_fund ` containing a signature
@@ -1233,8 +1204,27 @@ A `basic_funding_lease` does not provide any guarantee that the seller won't
12331204close the channel or increase their routing fees after the purchase, if the
12341205liquidity isn't actually used.
12351206
1236- The ` funding_lease_fee ` is paid as detailed in the ` funding_lease_fee ` section
1237- below.
1207+ When ` request_funds ` and ` will_fund ` have been exchanged, the buyer must pay
1208+ fees to the seller for the funding they provide to the channel based on the
1209+ agreed upon ` funding_weight ` , ` lease_fee_basis ` and ` lease_fee_base_sat ` .
1210+
1211+ The lease fee is taken from the buyer's funding inputs and added to the
1212+ seller's channel balance during the funding flow. The buyer must contribute
1213+ enough funds to cover their channel balance, the lease fee, and the on-chain
1214+ fees for the weight of the funding transaction they're responsible for.
1215+
1216+ The lease fee has three components:
1217+
1218+ * a fixed amount: ` lease_fee_base_sat `
1219+ * a proportional amount based on the seller's ` funding_amount ` :
1220+ * ` paid_funding_contribution = min(funding_amount, request_funds.requested_sats) `
1221+ * ` lease_fee_proportional_sat = paid_funding_contribution * lease_fee_basis / 10_000 `
1222+ * a contribution to the on-chain fees paid by the seller:
1223+ * ` lease_fee_mining_sat = funding_weight * funding_feerate_perkw / 1000 `
1224+
1225+ The lease fee is then:
1226+
1227+ lease_fee_total = lease_fee_base_sat + lease_fee_proportional_sat + lease_fee_mining_sat
12381228
12391229The seller provides an ECDSA signature in ` will_fund ` using the private key
12401230associated with their ` node_id ` . The data signed is:
@@ -1256,58 +1246,6 @@ A node selling a `basic_funding_lease`:
12561246 It ensures that the funding node is refunded for some of the on-chain
12571247 fees it will pay to contribute the requested funds to a channel.
12581248
1259- ### The ` duration_based_funding_lease ` type
1260-
1261- A ` duration_based_funding_lease ` commits to a duration during which the seller
1262- will not remove the funds nor increase their routing fees above the maximum
1263- values provided in the lease. It is impossible to actually prevent them from
1264- doing so, but the signature they provide in ` will_fund ` can be used to prove
1265- that they cheated.
1266-
1267- The ` funding_lease_fee ` is paid as detailed in the ` funding_lease_fee ` section
1268- below.
1269-
1270- The seller provides an ECDSA signature in ` will_fund ` using the private key
1271- associated with their ` node_id ` . The data signed is:
1272-
1273- SHA256("duration_based_funding_lease" || duration_based_funding_lease_witness)
1274-
1275- We use a tagged hash to ensure that this signature cannot be used in a
1276- different context.
1277-
1278- #### Requirements
1279-
1280- A node selling a ` duration_based_funding_lease ` :
1281- - MUST set ` lease_duration ` to the number of blocks during which the lease
1282- will be active.
1283- - MUST set ` max_channel_fee_base_msat ` to the maximum ` fee_base_msat ` it
1284- will use in its ` channel_update ` while the lease is active.
1285- - MUST set ` max_channel_fee_basis ` to match (when converted from basis
1286- points to millionths) the maximum ` fee_proportional_millionths ` it will
1287- use in its ` channel_update ` while the lease is active.
1288-
1289- ### Paying the ` funding_lease_fee `
1290-
1291- When ` request_funds ` and ` will_fund ` have been exchanged, the buyer must pay
1292- fees to the seller for the funding they provide to the channel based on the
1293- agreed upon ` funding_lease_fee ` .
1294-
1295- The lease fee is taken from the buyer's funding inputs and added to the
1296- seller's channel balance during the funding flow. The buyer must contribute
1297- enough funds to cover their channel balance, the lease fee, and the on-chain
1298- fees for the weight of the funding transaction they're responsible for.
1299-
1300- The lease fee has three components:
1301-
1302- * a fixed amount: ` lease_fee_base_sat `
1303- * a proportional amount based on the seller's ` funding_amount ` :
1304- * ` paid_funding_contribution = min(funding_amount, request_funds.requested_sats) `
1305- * ` lease_fee_proportional_sat = paid_funding_contribution * lease_fee_basis / 10_000 `
1306- * a contribution to the on-chain fees paid by the seller:
1307- * ` lease_fee_mining_sat = funding_weight * funding_feerate_perkw / 1000 `
1308-
1309- The lease fee is then ` lease_fee_total = lease_fee_base_sat + lease_fee_proportional_sat + lease_fee_mining_sat ` .
1310-
13111249#### Example
13121250
13131251A node contributes ` 500_000 sats ` to a channel and requests ` 1_000_000 sats `
0 commit comments