Thomas Voegtlin [ARCHIVE] on Nostr: 📅 Original date posted:2023-06-20 🗒️ Summary of this message: Thomas suggests ...
đź“… Original date posted:2023-06-20
🗒️ Summary of this message: Thomas suggests adding a feature bit to the invoice to make prepayment optional or required, and subtracting the prepayment amount from the main payment amount.
đź“ť Original message:
Hello Dave,
That is an interesting idea; it would indeed save space for the prepayment hash.
I think the invoice would still need a feature bit, so that the receiver can
decide to make prepayment optional or required.
Note that for the feature to be optional, we need to subtract the prepayment
amount from the main payment amount. Thus, in your example, Alice would expect
to receive either:
(1 BTC, invoice payment_hash)
or:
(1 BTC - minus 10k sats, invoice payment_hash) + (10k sats, prepayment_hash via keysend)
cheers
Thomas
On 19.06.23 22:29, David A. Harding wrote:
> On 2023-06-12 22:10, Thomas Voegtlin wrote:
>> The semantics of bundled payments is as follows:
>> Â - 1. the BOLT-11 invoice contains two preimages and two amounts:
>> prepayment and main payment.
>> Â - 2. the receiver should wait until all the HTLCs of both payments
>> have arrived, before they fulfill the HTLCs of the pre-payment. If the
>> main payment does not arrive, they should fail the pre-payment with a
>> MPP timeout.
>> Â - 3. once the HTLCs of both payments have arrived, the receiver
>> fulfills the HTLCs of the prepayment, and they broadcast their
>> on-chain transaction. Note that the main payment can still fail if the
>> sender never reveal the preimage of the main payment.
>
> Hi Thomas,
>
> Do you actually require a BOLT11 invoice to contain a payment hash for
> the prepayment, or would it be acceptable for the prepayment to use a
> keysend payment with the onion message payload for the receiver
> indicating what payment hash to associate with the prepayment (e.g.,
> Alice wants to receive 1 BTC to hash 0123...cdef with a prepayment of
> 10k sats, so the 10k sats is sent via keysend with metadata indicating
> the receiver shouldn't claim it until they receive the 1 BTC HTLC to
> 0123...cdef).
>
> If so, I think then you'd only need BOLT11 invoices to be extended with
> an extra_fee_via_keysend field. That would be significantly smaller and
> it also allows encoding the extra_fee_via_keysend field in an existing
> BOLT11 field like (d) description or the relatively new (m) metadata
> field, which may allow immediate implementation until an updated version
> of BOLT11 (or an alternative using offers) becomes widely deployed.
>
> Thanks,
>
> -Dave
--
Electrum Technologies GmbH / Paul-Lincke-Ufer 8d / 10999 Berlin / Germany
Sitz, Registergericht: Berlin, Amtsgericht Charlottenburg, HRB 164636
Geschäftsführer: Thomas Voegtlin
Published at
2023-06-20 11:15:34Event JSON
{
"id": "be190f2389787cc681bd3c3291b6c839dd637e3f67627cd843556025f7cb9066",
"pubkey": "7a4ba40070e54012212867182c66beef592603fe7c7284b72ffaafce9da20c05",
"created_at": 1687259734,
"kind": 1,
"tags": [
[
"e",
"043a2b35dbcb1356289d59114e00fee40fb32cc69bf8e3d2ab2d8da4ebc027ca",
"",
"root"
],
[
"e",
"a52056be626bb725dae41688f341eccde4e9f5b98f1480eee4c096e248db653a",
"",
"reply"
],
[
"p",
"d3574a24208f4e3d0821bb4a69a0c3ae842043d444fa5c4a8c49c369918a6fb2"
]
],
"content": "📅 Original date posted:2023-06-20\n🗒️ Summary of this message: Thomas suggests adding a feature bit to the invoice to make prepayment optional or required, and subtracting the prepayment amount from the main payment amount.\n📝 Original message:\nHello Dave,\n\nThat is an interesting idea; it would indeed save space for the prepayment hash.\nI think the invoice would still need a feature bit, so that the receiver can\ndecide to make prepayment optional or required.\n\nNote that for the feature to be optional, we need to subtract the prepayment\namount from the main payment amount. Thus, in your example, Alice would expect\nto receive either:\n (1 BTC, invoice payment_hash)\nor:\n (1 BTC - minus 10k sats, invoice payment_hash) + (10k sats, prepayment_hash via keysend)\n\ncheers\n\nThomas\n\n\n\n\nOn 19.06.23 22:29, David A. Harding wrote:\n\u003e On 2023-06-12 22:10, Thomas Voegtlin wrote:\n\u003e\u003e The semantics of bundled payments is as follows:\n\u003e\u003e  - 1. the BOLT-11 invoice contains two preimages and two amounts:\n\u003e\u003e prepayment and main payment.\n\u003e\u003e  - 2. the receiver should wait until all the HTLCs of both payments\n\u003e\u003e have arrived, before they fulfill the HTLCs of the pre-payment. If the\n\u003e\u003e main payment does not arrive, they should fail the pre-payment with a\n\u003e\u003e MPP timeout.\n\u003e\u003e  - 3. once the HTLCs of both payments have arrived, the receiver\n\u003e\u003e fulfills the HTLCs of the prepayment, and they broadcast their\n\u003e\u003e on-chain transaction. Note that the main payment can still fail if the\n\u003e\u003e sender never reveal the preimage of the main payment.\n\u003e \n\u003e Hi Thomas,\n\u003e \n\u003e Do you actually require a BOLT11 invoice to contain a payment hash for\n\u003e the prepayment, or would it be acceptable for the prepayment to use a\n\u003e keysend payment with the onion message payload for the receiver\n\u003e indicating what payment hash to associate with the prepayment (e.g.,\n\u003e Alice wants to receive 1 BTC to hash 0123...cdef with a prepayment of\n\u003e 10k sats, so the 10k sats is sent via keysend with metadata indicating\n\u003e the receiver shouldn't claim it until they receive the 1 BTC HTLC to\n\u003e 0123...cdef).\n\u003e \n\u003e If so, I think then you'd only need BOLT11 invoices to be extended with\n\u003e an extra_fee_via_keysend field. That would be significantly smaller and\n\u003e it also allows encoding the extra_fee_via_keysend field in an existing\n\u003e BOLT11 field like (d) description or the relatively new (m) metadata\n\u003e field, which may allow immediate implementation until an updated version\n\u003e of BOLT11 (or an alternative using offers) becomes widely deployed.\n\u003e \n\u003e Thanks,\n\u003e \n\u003e -Dave\n\n-- \nElectrum Technologies GmbH / Paul-Lincke-Ufer 8d / 10999 Berlin / Germany\nSitz, Registergericht: Berlin, Amtsgericht Charlottenburg, HRB 164636\nGeschäftsführer: Thomas Voegtlin",
"sig": "08a3a9c8e2623dc5d7c8a82ab740c86f092280050bbde630e158962bc95071ba6dcc8e284a56f00a895de81ae405867a455c4ec0580e9ed1c224570217185b64"
}