CJP [ARCHIVE] on Nostr: 📅 Original date posted:2018-11-04 📝 Original message: Right now, the only ...
📅 Original date posted:2018-11-04
📝 Original message:
Right now, the only defined semantics of the description field in
BOLT11 is that it SHOULD be "a complete description of the purpose of
the payment". I think this is a bit vague; maybe this is deliberate?
Anyway, you may also think of a BOLT11 payment request as an option
contract. If the payment is performed (which can be proven by showing
the preimage), then payee is bound to the terms and conditions in the
description. So, then the meaning of a description "one cup of coffee"
becomes "if payment happens, payee has an obligation to deliver one cup
of coffee".
A known issue is that payer is not identified in the contract, so it is
not clear to who the payee has this obligation. As far as I can see,
the only way to fix this is to have two-way communication, where first
the payer sends some data to payee (e.g. public key), and then payee
makes the payment request, including this data. With this established,
we turn the preimage + payment request from a "proof that someone paid"
into a "proof that I paid", and therefore also a "proof that payee has
this obligation to me".
I'm a bit afraid that such proofs are a bit too inflexible for real-
life applications. I think in real-life there are many cases where you
need to update / revoke agreements, even after payment.
One example is a full refund: if goods/services cannot be delivered
somehow, payer+payee might agree to a full refund instead of delivery
of goods/services. The refund is another payment, with a payment
request made by the original payer; its contract should state that the
original payee is no longer bound by the obligations in the original
contract.
Another example is a partial refund, for instance if only a lower
quantity or a lower quality of goods/services is delivered. This is
another payment, but now the new contract replaces the old contract and
specifies a new, lower set of obligations for the original payee.
Another example is a change of conditions without change of payment,
for instance when a white/gold dress was ordered, but turned out to be
unavailable, and payer finds a black/blue dress acceptable as well, at
equal price. Then you'd just want to replace white/gold in the contract
by black/blue, without any payment.
I think nearly all cases (including ones not mentioned here) are
covered by a "contract update" format which includes:
* the new obligations of the two parties to each other
* a secure hash of the previous contract version that is replaced by
this one
* optionally, a payment hash
* signatures from both parties
The contract update is considered valid if and only if
* the signatures correspond to the pubkeys in the original contract
(the first in the chain)
* the signatures are valid signatures on this contract
* the previous contracts in the chain are all valid (except for being
invalidated by contract updates)
* there is no known valid contract that replaces this one
* if a payment hash is included, a corresponding payment preimage is
provided as well
The original contract is different in that
* It does not have a previous contract version (may be zeroed if you
want to keep the same format)
* A set of pubkeys is provided (one of payer, one of payee)
* Only payee has obligations, so payee never needs to receive a
signature from payer. Payer needs to receive payee's signature, and can
trivially add his own signature whenever needed.
Whenever one payee has obligations to another, the pubkey of the party
with obligations has to be verified through some PKI. I consider this
to be outside the scope of this concept. Especially in the case that
one of the parties never has any obligations, that party may use a new,
non-PKI-verified pubkey for the transaction, as a temporary pseudonym.
There is some conceptual similarity between an updateable proof of
payment and a payment channel.
A potential issue is that, theoretically, the "contract update chain"
can fork. The simple solution is "don't do that": either party can stop
it from happening by not signing the forking update.
CJP
Published at
2023-06-09 12:52:09Event JSON
{
"id": "a585239936f755200e3301dde3b13ee0d94b6fec5022fcdba89e1808440b5994",
"pubkey": "880fa8c3080c3bd98e574cfcd6d6f53fd13e0516c40ea3f46295438b0c07bdf5",
"created_at": 1686315129,
"kind": 1,
"tags": [
[
"e",
"33ea45ce2c2cdcf16bfd94644e319f0aba2537956ed51603763d6552f3b509b8",
"",
"reply"
],
[
"p",
"9456f7acb763eaab2e02bd8e60cf17df74f352c2ae579dce1f1dd25c95dd611c"
]
],
"content": "📅 Original date posted:2018-11-04\n📝 Original message:\nRight now, the only defined semantics of the description field in\nBOLT11 is that it SHOULD be \"a complete description of the purpose of\nthe payment\". I think this is a bit vague; maybe this is deliberate?\n\nAnyway, you may also think of a BOLT11 payment request as an option\ncontract. If the payment is performed (which can be proven by showing\nthe preimage), then payee is bound to the terms and conditions in the\ndescription. So, then the meaning of a description \"one cup of coffee\"\nbecomes \"if payment happens, payee has an obligation to deliver one cup\nof coffee\".\n\nA known issue is that payer is not identified in the contract, so it is\nnot clear to who the payee has this obligation. As far as I can see,\nthe only way to fix this is to have two-way communication, where first\nthe payer sends some data to payee (e.g. public key), and then payee\nmakes the payment request, including this data. With this established,\nwe turn the preimage + payment request from a \"proof that someone paid\"\ninto a \"proof that I paid\", and therefore also a \"proof that payee has\nthis obligation to me\".\n\nI'm a bit afraid that such proofs are a bit too inflexible for real-\nlife applications. I think in real-life there are many cases where you\nneed to update / revoke agreements, even after payment.\n\nOne example is a full refund: if goods/services cannot be delivered\nsomehow, payer+payee might agree to a full refund instead of delivery\nof goods/services. The refund is another payment, with a payment\nrequest made by the original payer; its contract should state that the\noriginal payee is no longer bound by the obligations in the original\ncontract.\n\nAnother example is a partial refund, for instance if only a lower\nquantity or a lower quality of goods/services is delivered. This is\nanother payment, but now the new contract replaces the old contract and\nspecifies a new, lower set of obligations for the original payee.\n\nAnother example is a change of conditions without change of payment,\nfor instance when a white/gold dress was ordered, but turned out to be\nunavailable, and payer finds a black/blue dress acceptable as well, at\nequal price. Then you'd just want to replace white/gold in the contract\nby black/blue, without any payment.\n\nI think nearly all cases (including ones not mentioned here) are\ncovered by a \"contract update\" format which includes:\n* the new obligations of the two parties to each other\n* a secure hash of the previous contract version that is replaced by\nthis one\n* optionally, a payment hash\n* signatures from both parties\n\nThe contract update is considered valid if and only if\n* the signatures correspond to the pubkeys in the original contract\n(the first in the chain)\n* the signatures are valid signatures on this contract\n* the previous contracts in the chain are all valid (except for being\ninvalidated by contract updates)\n* there is no known valid contract that replaces this one\n* if a payment hash is included, a corresponding payment preimage is\nprovided as well\n\nThe original contract is different in that\n* It does not have a previous contract version (may be zeroed if you\nwant to keep the same format)\n* A set of pubkeys is provided (one of payer, one of payee)\n* Only payee has obligations, so payee never needs to receive a\nsignature from payer. Payer needs to receive payee's signature, and can\ntrivially add his own signature whenever needed.\n\nWhenever one payee has obligations to another, the pubkey of the party\nwith obligations has to be verified through some PKI. I consider this\nto be outside the scope of this concept. Especially in the case that\none of the parties never has any obligations, that party may use a new,\nnon-PKI-verified pubkey for the transaction, as a temporary pseudonym.\n\nThere is some conceptual similarity between an updateable proof of\npayment and a payment channel.\n\nA potential issue is that, theoretically, the \"contract update chain\"\ncan fork. The simple solution is \"don't do that\": either party can stop\nit from happening by not signing the forking update.\n\nCJP",
"sig": "3802aa37520a04ffe5e98f42083ddb74e47a3a73062db02202906d7f2eaf03b08fc0ef42efa602f04f76ed20a5f39681c16740468bcd51a358a47f368698b499"
}