Research/Bitcoin Dev Archive / lightning-dev list
BOLT11 In the World of Scriptless Scripts
15 messages, Nov 1 to 5, 2018. Started by Rusty Russell.
Rusty Russell (6), Anthony Towns (5), ZmnSCPxj (4)
Hi all,
There's been some discussion of what the lightning payment flow might look like in the future, and I thought I'd try to look forwards so we can avoid painting ourselves into a corner now. I haven't spent time on concrete design and implementation to be sure this is correct, however.
Current Status -------------- Currently, one invoice can be paid 0 or 1 times. There is no safe invoice reuse. The payer can prove the node offered the invoice (it is signed), and that someone paid the invoice, but not that they specifically did: the lightning nodes along the path and the merchant themselves also have the preimage. This implies that the invoice itself should have enough information to make that link, eg. with a description of "1 T-shirt to Rusty in Australia", otherwise the payer can say "here, I paid for 1 T-shirt" and the merchant says "no, that invoice was for a T-shirt we shipped to Austria".
Desired Status -------------- Ideally, you could create one invoice which could be paid arbitrary many times, by different individuals. eg. "My donation invoice is on my web page", or "I've printed out the invoice for a widget and stuck it to the widget", or "Pay this invoice once a month please".
Also, you should be able to prove you've paid, in a way I can't just copy the proof and claim I paid, too, even if I'm the merchant, and that you agreed to my terms, eg. "I'm paying for 500 widgets to be shipped to Rusty in Australia".
Required Magic -------------- It seems that scriptless scripts will allow this: an HTLC signature would commit to the invoice/"payment_hash" as well as "something I sent to you in the payment onion". That "something" has to be well-defined in the protocol, of course, since the merchant will have to parse it and understand the conditions it presents before accepting the payment. I have an idea that we could merkelize the information to allow you to partially reveal it if you wanted to.
This also enables full AMP (I think), where you receive the payment proof despite using AMP. I call this "High AMP" vs the current proposal ("Low AMP") which trusts the merchant to deliver.
This is a subtle change in semantics: currently the lightning layer only provides assistance metadata (eg. routing), and the entire protocol can be played out onchain. This is no longer true: the onchain data is not sufficient for you to accept a payment. However, this was practically untrue anyway.
Lesser Magic ------------ It's possible to do spontaneous donations *without* proof of payment today (I simply give you the preimage in the onion). Low-AMP relies on a similar trick.
It's even possible to do recurring payments, if each preimage you get is the payment_hash for the next payment.
None of this is supported in the 1.0 protocol, but I'm sure we'll have vigorous debate over how much of this gets into 1.1 at the Summit next week.
Cheers, Rusty.
On Fri, Nov 02, 2018 at 10:20:46AM +1030, Rusty Russell wrote:
Quoted text (5 lines)
> There's been some discussion of what the lightning payment flow > might look like in the future, and I thought I'd try to look forwards so > we can avoid painting ourselves into a corner now. I haven't spent time > on concrete design and implementation to be sure this is correct, > however.
I think I'd like to see v1.1 of the lightning spec include experimental/optional support for using secp256k1 public/private keys for payment hashes/preimages. That assumes using either 2-party ECDSA magic or script magic until it's viable to do it via Schnorr scriptless scripts, but that seems like it's not totally infeasible? I think the components would need to be:
- invoices: will the preimage for the hash be a secp256k1 private key or a sha256 preimage? (or payer's choice?) - channel announcements: do you support secp256k1 for hashes or just sha256? - node features: how do you support secp256k1? not at all (default), via 2p-ecdsa, via script magic, (eventually) via schnorr, ...?
I think this is (close to) a necessary precondition for payment decorrelation, AMP, and third-party verifiable proof-of-payment.
Quoted text (11 lines)
> Desired Status > -------------- > Ideally, you could create one invoice which could be paid arbitrary many > times, by different individuals. eg. "My donation invoice is on my web > page", or "I've printed out the invoice for a widget and stuck it to the > widget", or "Pay this invoice once a month please". > > Also, you should be able to prove you've paid, in a way I can't just > copy the proof and claim I paid, too, even if I'm the merchant, and that > you agreed to my terms, eg. "I'm paying for 500 widgets to be shipped to > Rusty in Australia".
So, I think at a high level the logic here goes:
1. Alice: "Buy a t-shirt from me for $5!"
2. Bob: "Alice, I want to buy a t-shirt from you, here's $5"
3. Alice: "Receipt: Bob bought a t-shirt from me"
4. Bob: "Your Honour, here's my receipt from Alice for a t-shirt, please
make her deliver on it!"
Going backwards; for the last step to be useful, the receipt has to be a signature with the Alice's public key -- if it were anything short of that, Alice will claim Bob could have just made up all the numbers. For a Schnorr sig, that means (R,s) with the vendor choosing R and not revealing R's preimage as that would reveal their private key.
If both vendor and customer know R, then to get the signature, you need the private key holder to reveal s which is just revealing the secp256k1 private key corresponding to S, calculated as:
S = R + H(P,R,"Bob bought a $5 t-shirt from me")*P
where P is Alice's public key. If R is calculated via the Schnorr BIP's recommendation, then r = H(p, "Bob bought a $5 t-shirt from me") -- ie, based on the private key and the message being signed.
Even if you calculate r differently, I don't think you can do this without Bob and Alice interacting to get the nonce R prior to sending the transaction, which seems effectively the same as having dynamic invoice hashes, though.
Maybe querying for a nonce through the lightning network would make sense though, which would allow the "invoice" to be static, and all the dynamic things would be via lightning p2p? That step could perhaps be combined with the 0 satoshi payment probes that Fabrice proposes in
but I think replying with a public nonce value would need a new message type of some sort?
I think AMP is independent, other than also using secp256k1 preimages rather than SHA256. I think AMP splits and joins are just:
- if you're joining incoming payments, don't forward until you've got all the HTLCs, and ensure you can generate the secret for each incoming payment from the single outgoing payment
- if you're splitting an incoming payment into many outgoing payments, ensure you can claim the incoming payment from *any* outgoing payments' secret
Which I think in practice just means knowing x_i for each input, and y_j for each output other than the first, and verifying:
I_i = O_1 + x_i*G
O_j = O_1 + y_j*G
(this gives I_i = O_j + (x_i-y_j)*G and the corresponding secret being i_i = o_j + x_i - y_j) allowing you to claim all incoming HTLCs given the secret from any outgoing HTLC)
Cheers, aj
Anthony Towns <aj at erisian.com.au> writes:
Quoted text (12 lines)
> On Fri, Nov 02, 2018 at 10:20:46AM +1030, Rusty Russell wrote: >> There's been some discussion of what the lightning payment flow >> might look like in the future, and I thought I'd try to look forwards so >> we can avoid painting ourselves into a corner now. I haven't spent time >> on concrete design and implementation to be sure this is correct, >> however. > > I think I'd like to see v1.1 of the lightning spec include > experimental/optional support for using secp256k1 public/private keys > for payment hashes/preimages. That assumes using either 2-party ECDSA > magic or script magic until it's viable to do it via Schnorr scriptless > scripts, but that seems like it's not totally infeasible?
Not totally infeasible, but since every intermediary needs to support it, I think we'd need considerable buy-in before we commit to it in 1.1.
Quoted text (6 lines)
> I think the > components would need to be: > > - invoices: will the preimage for the hash be a secp256k1 private key > or a sha256 preimage? (or payer's choice?) >From BOLT11:
The `p` field supports the current 256-bit payment hash, but future specs could add a new variant of different length, in which case writers could support both old and new, and old readers would ignore the one not the correct length.
So the plan would be you provide two `p` fields in transition.
Quoted text (2 lines)
> - channel announcements: do you support secp256k1 for hashes or just > sha256?
Worse, it becomes "I support secp256k1 with ECDSA" then a new "I support secp256k1 with Schnorr". You need a continuous path of channels with the same feature.
Quoted text (2 lines)
> - node features: how do you support secp256k1? not at all (default), > via 2p-ecdsa, via script magic, (eventually) via schnorr, ...?
We could make these global feature bits, if you want to preferentually establish channels with nodes who support a specific feature.
Quoted text (2 lines)
> I think this is (close to) a necessary precondition for payment > decorrelation, AMP, and third-party verifiable proof-of-payment.
Yes, that's the easy part :)
...
Quoted text (4 lines)
> Even if you calculate r differently, I don't think you can do this > without Bob and Alice interacting to get the nonce R prior to sending > the transaction, which seems effectively the same as having dynamic > invoice hashes, though.
I know Andrew Poelstra thought it was possible, so I'm going to leave a response to him :)
Quoted text (9 lines)
> Maybe querying for a nonce through the lightning network would make > sense though, which would allow the "invoice" to be static, and all the > dynamic things would be via lightning p2p? That step could perhaps be > combined with the 0 satoshi payment probes that Fabrice proposes in > > https://www.learnbitcoin.com/archive/lists/lightning-dev/t/2018/improving-payment-ux-with-low-latency-route-probing#m-bb2362c3 > > but I think replying with a public nonce value would need a new message > type of some sort?
We might eventually end up going full HORNET, for other reasons. But it places demands on the network which need careful consideration, and the more traffic you send the more chances for analysis. A single pass is enough.
Quoted text (20 lines)
> I think AMP is independent, other than also using secp256k1 preimages > rather than SHA256. I think AMP splits and joins are just: > > - if you're joining incoming payments, don't forward until you've > got all the HTLCs, and ensure you can generate the secret for each > incoming payment from the single outgoing payment > > - if you're splitting an incoming payment into many outgoing payments, > ensure you can claim the incoming payment from *any* outgoing > payments' secret > > Which I think in practice just means knowing x_i for each input, and > y_j for each output other than the first, and verifying: > > I_i = O_1 + x_i*G > O_j = O_1 + y_j*G > > (this gives I_i = O_j + (x_i-y_j)*G and the corresponding secret being > i_i = o_j + x_i - y_j) allowing you to claim all incoming HTLCs given > the secret from any outgoing HTLC)
I think a general scheme is: payer creates a random group-marker, sends <group-marker><32-byte-randomness>[encrypted data...] in each payment. Receipient collects payments by <group-marker>, xoring the <32-byte-randomness>; if that xor successfully decrypts the data, you've got all the pieces.
(For low-AMP, you use payment_hash as <group-marker>, and just use SHA256(<xor-of-all-randomness><32-byte-randomness>) as the per-payment preimage so no [encrypted data] needed).
Cheers, Rusty.
Good morning Rusty, aj, and list,
Quoted text (8 lines)
> > - channel announcements: do you support secp256k1 for hashes or just > > sha256? > > > > Worse, it becomes "I support secp256k1 with ECDSA" then a new "I support > secp256k1 with Schnorr". You need a continuous path of channels with > the same feature. >
I believe not? Both the 2p-ECDSA and Schnorr contingent payment schemes effectively encode "I will pay you N satoshi if you give me the private key of the public key P on the secp256k1 curve, before time B", which can be composed with another contingent payment of either 2p-ECDSA or Schnorr. So it would be possible to have a route with channels alternating between the two schemes.
Or do I misunderstand some detail?
Regards, ZmnSCPxj
On Fri, Nov 02, 2018 at 03:45:58PM +1030, Rusty Russell wrote:
Quoted text (14 lines)
> Anthony Towns <aj at erisian.com.au> writes: > > On Fri, Nov 02, 2018 at 10:20:46AM +1030, Rusty Russell wrote: > >> There's been some discussion of what the lightning payment flow > >> might look like in the future, and I thought I'd try to look forwards so > >> we can avoid painting ourselves into a corner now. I haven't spent time > >> on concrete design and implementation to be sure this is correct, > >> however. > > I think I'd like to see v1.1 of the lightning spec include > > experimental/optional support for using secp256k1 public/private keys > > for payment hashes/preimages. That assumes using either 2-party ECDSA > > magic or script magic until it's viable to do it via Schnorr scriptless > > scripts, but that seems like it's not totally infeasible? > Not totally infeasible, but since every intermediary needs to support > it, I think we'd need considerable buy-in before we commit to it in 1.1.
"every intermediary" just means "you have to find a path where every channel supports it"; nodes/channels that aren't in the route you choose aren't a problem, and can still pass on the gossiped announcements, I think?
Quoted text (10 lines)
> > I think the > > components would need to be: > > - invoices: will the preimage for the hash be a secp256k1 private key > > or a sha256 preimage? (or payer's choice?) > From BOLT11: > The `p` field supports the current 256-bit payment hash, but future > specs could add a new variant of different length, in which case > writers could support both old and new, and old readers would ignore > the one not the correct length. > So the plan would be you provide two `p` fields in transition.
Yeah, that sounds workable.
Quoted text (5 lines)
> > - channel announcements: do you support secp256k1 for hashes or just > > sha256? > Worse, it becomes "I support secp256k1 with ECDSA" then a new "I support > secp256k1 with Schnorr". You need a continuous path of channels with > the same feature.
I don't think that's correct: whether it's 2p-ecdsa, Schnorr or script magic only matters for the two nodes directly involved in the channel (who need to be able to understand the commitment transactions they're signing, and extract the private key from the on-chain tx if the channel gets unilaterally closed). For everyone else, they just need to know that they can put in a public key based HTLC, and get back the corresponding private key when the HTLC goes through.
It's also (theoretically) upgradable afaics: if two nodes have a channel that supports 2p-ecdsa, and eventually both upgrade to support segwit v1 scriptless schnorr sigs or whatever, they just need to change the addresses they use in new commitment txs, even for existing HTLCs.
Quoted text (6 lines)
> > Even if you calculate r differently, I don't think you can do this > > without Bob and Alice interacting to get the nonce R prior to sending > > the transaction, which seems effectively the same as having dynamic > > invoice hashes, though. > I know Andrew Poelstra thought it was possible, so I'm going to leave a > response to him :)
AFAICT, in general, if you're going to have n signatures with a public key P, you need to generate the n R=r*G values from n*32B worth of random data, that's previously unknown to the signature recipients. If you've got less than that, then you will have calculated each R by doing something like based on <n*32B of data you've been given:
R = a*R1 + b*R2 + ..
and the n signatures you eventually receive will give you n simultaneous linear equations along the lines of:
s = (a*r1 + b*r2 + c*r3 + ..) + H(..)*p
with <= n unknowns (p and less than n r1,r2,.. values). (If you don't known the values a,b,c you won't be able to calculate the R values for your signatures in the first place)
Willing to be surprised by a different approach, but I'm pretty skeptical...
I think it makes sense to think of proof-of-payment in terms of a verification algorithm (that a third party court could use), that takes:
m - the invoice details, eg
"aj paid $11 for stickers to be delivered to Australia"
P - the pubkey of the vendor
sig - some signature
With the current SHA256 preimages, you can make sig=(R,s,pre) where the sig is valid if:
s*G = R + H(P,R,m+SHA256(pre))*P
If you share R,s,SHA256(pre) beforehand, the payer can tell they'll have a valid signature if they pay to SHA256(pre). That's a 96B signature, and it requires "pre" be different for each sale, and needs pre-payment interactivity to agree on m and communicate R,s back to the payer.
With seckp256k1 preimages, it's easy to reduce that to sig=(R,s), and needing to communicate an R to the payer initially, who can then calculate S and send "m" along with the payment.
Maybe it makes sense to disambiguate the term "invoice" -- when you don't know who you might be giving the goods/service to, call it an "offer", which can be a write-once/accept-by-anyone deal that you just leave on a webpage or your email signature; but an "invoice" should be specific to each individual payment, with a "receipt" provided once an invoice is paid.
AMP:
Quoted text (9 lines)
> I think a general scheme is: payer creates a random group-marker, sends > <group-marker><32-byte-randomness>[encrypted data...] in each payment. > Receipient collects payments by <group-marker>, xoring the > <32-byte-randomness>; if that xor successfully decrypts the data, you've > got all the pieces. > > (For low-AMP, you use payment_hash as <group-marker>, and just use > SHA256(<xor-of-all-randomness><32-byte-randomness>) as the per-payment > preimage so no [encrypted data] needed).
Hmm, right, I've got decorrelation and AMP combined in my head. I'm also a bit confused about what exactly you mean by "low-AMP"...
Rereading through the AMP threads, Christian's post makes a lot of sense to me:
I'm not really seeing the benefits in complicated AMP schemes without decorrelation...
It seems to me like there are three levels that could be implemented:
- laolu/conner: ("low AMP" ?)
works with sha256
some privacy improvement
loses proof-of-payment
can't claim unless all payments arrive
- just send multiple payments with the same hash:
works with sha256
privacy not improved much (some intermediary nodes no longer know
full invoice value)
can claim partial payments as soon as they arrive
accepting any partial payment provides proof-of-payment
- secp256k1: ("high AMP" ?)
needs secp256k1 preimages
works fine with decorrelation improving privacy at every step
can set it up so can only claim once all partial payments arrive
accepting partial payment provides proof-of-payment
In theory, both "just send multiple payments" and "secp256k1" could have splitting and joining at any hop, if we could encode the instructions on how to do that in the onion message; joining is probably easy, but splitting seems like it might be hard?
Cheers, aj
Anthony Towns <aj at erisian.com.au> writes:
Quoted text (13 lines)
>> > - channel announcements: do you support secp256k1 for hashes or just >> > sha256? >> Worse, it becomes "I support secp256k1 with ECDSA" then a new "I support >> secp256k1 with Schnorr". You need a continuous path of channels with >> the same feature. > > I don't think that's correct: whether it's 2p-ecdsa, Schnorr or script > magic only matters for the two nodes directly involved in the channel > (who need to be able to understand the commitment transactions they're > signing, and extract the private key from the on-chain tx if the channel > gets unilaterally closed). For everyone else, they just need to know that > they can put in a public key based HTLC, and get back the corresponding > private key when the HTLC goes through.
I'm not sure. Jonas Nick proposed a scheme, which very much assumes Schnorr AFAICT:
Jonas Nick wrote:
Quoted text (7 lines)
> How I thought it would work is that the invoice would contain a > Schnorr nonce R. Then the payer would construct s*G = R + > H(payee_pubkey,R,"I've bought 5 shirts shipped to Germany")*G. Then > the payer builds the scriptless script payment path such that when the > payee claims, the payer learns s and thus has a complete > signature. However, that doesn’t work with recurrent payments because > the payee can use the nonce only once.
I would probably enhance this to include a nonce, which allows for AMP (you have to xor the AMP payments to get the nonce):
R + H(payee_pubkey,R,"I've bought 5 shirts shipped to Germany",NONCE)*G
Quoted text (17 lines)
> I think it makes sense to think of proof-of-payment in terms of a > verification algorithm (that a third party court could use), that takes: > > m - the invoice details, eg > "aj paid $11 for stickers to be delivered to Australia" > P - the pubkey of the vendor > sig - some signature > > With the current SHA256 preimages, you can make sig=(R,s,pre) > where the sig is valid if: > > s*G = R + H(P,R,m+SHA256(pre))*P > > If you share R,s,SHA256(pre) beforehand, the payer can tell they'll have > a valid signature if they pay to SHA256(pre). That's a 96B signature, > and it requires "pre" be different for each sale, and needs pre-payment > interactivity to agree on m and communicate R,s back to the payer.
For current-style invoices (no payer-supplied data), the payee knows 'm', so no interactivity needed, which is nice.
In the payer-supplied data case, I think 'm' should include a signature for a key only the payer knows: this lets them prove *they* made the payment.
How does this interact with AMP, however?
Quoted text (3 lines)
> With seckp256k1 preimages, it's easy to reduce that to sig=(R,s), > and needing to communicate an R to the payer initially, who can then > calculate S and send "m" along with the payment.
OK, I buy that.
Quoted text (6 lines)
> Maybe it makes sense to disambiguate the term "invoice" -- when you don't > know who you might be giving the goods/service to, call it an "offer", > which can be a write-once/accept-by-anyone deal that you just leave on > a webpage or your email signature; but an "invoice" should be specific > to each individual payment, with a "receipt" provided once an invoice > is paid.
"offer" is a good name, since I landed on the same one while thinking about this too :)
For an "offer" you would need a (lightning-network-carried) req/resp to get the per-payment invoice. An offer could use a 128-bit 'p': smaller would do, but this is too large to brute-force iterate through (hey, I wonder if they sell other stuff?).
Quoted text (7 lines)
> Rereading through the AMP threads, Christian's post makes a lot of sense > to me: > > https://www.learnbitcoin.com/archive/lists/lightning-dev/t/2018/amp-atomic-multi-path-payments-over-lightning#m-ca01fe20 > > I'm not really seeing the benefits in complicated AMP schemes without > decorrelation...
In practice it should increase reliability of payments through capacity bottlenecks. But don't underestimate the benefits of PoP: we're so used to intermediates we take it for granted, but once the middleman is removed the ability to prove the invoice/payment cycles is vital for usability.
Quoted text (7 lines)
> It seems to me like there are three levels that could be implemented:
>
> - laolu/conner: ("low AMP" ?)
> works with sha256
> some privacy improvement
> loses proof-of-payment
> can't claim unless all payments arriveYep.
Quoted text (6 lines)
> - just send multiple payments with the same hash: > works with sha256 > privacy not improved much (some intermediary nodes no longer know > full invoice value) > can claim partial payments as soon as they arrive > accepting any partial payment provides proof-of-payment
Interestingly, if vendor takes part payment, rest can be stolen by intermediaries. This puts pressure on vendor to treat them atomically. I haven't thought about this before, but it has desirable attributes. (If the contract is "you will only release preimage once you've got the payment", all this requires is a single bit to say "I know this is partial, more are coming, please wait").
Quoted text (5 lines)
> - secp256k1: ("high AMP" ?)
> needs secp256k1 preimages
> works fine with decorrelation improving privacy at every step
> can set it up so can only claim once all partial payments arrive
> accepting partial payment provides proof-of-paymentYes. Though I'm not sure exactly how this works with your scheme above...
Quoted text (4 lines)
> In theory, both "just send multiple payments" and "secp256k1" could have > splitting and joining at any hop, if we could encode the instructions > on how to do that in the onion message; joining is probably easy, but > splitting seems like it might be hard?
I don't think so. If you can join two payments, it wasn't private? For splitting, in the specific case of having two channels between the same nodes, you might be able to do something, but that's a pretty narrow case. And as TCP discovered, you're better off failing back to sender than trying to add fragmentation to the protocol.
Note: if we need an interaction message for BOLT11 features we want in future[1], then it has the advantage that it decouples the bolt11 features from changing preimages to secp256k1. That makes this question *critical* for the Summit next week.
Thanks! Rusty.
[1] If we're not careful we're going to implement HORNET so we can pass arbitrary messages around, which means we want to start charging for them to prevent spam, which means we reopen the pre-payment debate, and need reliable error messages...
On Sun, Nov 04, 2018 at 01:30:48PM +1030, Rusty Russell wrote:
Quoted text (5 lines)
> I'm not sure. Jonas Nick proposed a scheme, which very much assumes > Schnorr AFAICT: > Jonas Nick wrote: > > How I thought it would work is that the invoice would contain a > > Schnorr nonce R.
(Note this means the "invoice" must be unique for each payment)
Quoted text (6 lines)
> > Then the payer would construct s*G = R + > > H(payee_pubkey,R,"I've bought 5 shirts shipped to Germany")*G. Then > > the payer builds the scriptless script payment path such that when the > > payee claims, the payer learns s and thus has a complete > > signature. However, that doesn’t work with recurrent payments because > > the payee can use the nonce only once.
So that's totally fine to do however you receive the "s" value -- the message that's getting the Schnorr signature isn't a valid bitcoin transaction, so it's something that only needs to be validated by BOLT-aware courts.
I also think you can get recurrent payments easily by extending the verification algorithm. Basically instead of Verify(m,P,sig) have Verify(m,P,n,sig) to verify you've made n payments of the invoice "m".
Construct "m" to include the postimage X = H(pre,1000) which indicates "pre" has been hashed 1000 times, so X = H(H(pre,1000-n),n).
Calculate the original signature as:
s = r + H(P,R,m+X)*p
and verify that n payments have been made by checking:
Verify(m,P,n,(s,R,rcpt)) :: s*G = R + H(P,R,m+H(rcpt,n))*P
You'd provide s,R,X when setting up the subscription, then reveal the preimage to X, the preimage to the preimage of X etc on each payment. (Maybe shachain would work here?)
I think that approach is independent of using sha256/secp256k1 for preimages over lightning too.
Quoted text (3 lines)
> I would probably enhance this to include a nonce, which allows for AMP > (you have to xor the AMP payments to get the nonce): > R + H(payee_pubkey,R,"I've bought 5 shirts shipped to Germany",NONCE)*G
R is already a unique nonce under the hash here, so I don't think a second one adds any value fwiw.
Quoted text (19 lines)
> > I think it makes sense to think of proof-of-payment in terms of a > > verification algorithm (that a third party court could use), that takes: > > > > m - the invoice details, eg > > "aj paid $11 for stickers to be delivered to Australia" > > P - the pubkey of the vendor > > sig - some signature > > > > With the current SHA256 preimages, you can make sig=(R,s,pre) > > where the sig is valid if: > > > > s*G = R + H(P,R,m+SHA256(pre))*P > > > > If you share R,s,SHA256(pre) beforehand, the payer can tell they'll have > > a valid signature if they pay to SHA256(pre). That's a 96B signature, > > and it requires "pre" be different for each sale, and needs pre-payment > > interactivity to agree on m and communicate R,s back to the payer. > For current-style invoices (no payer-supplied data), the payee knows > 'm', so no interactivity needed, which is nice.
I'm looking at it as needing interactivity to determine m prior to the payment going through -- the payer needs to send through "aj" and "Australia" in the example above, before the payee can generate s,R to send back, at which point the payer can make the payment knowing they'll either get a cryptographic proof of payment or a refund.
Quoted text (3 lines)
> In the payer-supplied data case, I think 'm' should include a signature > for a key only the payer knows: this lets them prove *they* made the > payment.
I don't object to that, but I think it's unnecessary; as long as there was a payment for delivery of the widget to "aj" in "Australia" does it matter if the payment was technically made by "aj" by "Visa on behalf of aj" or by "Bank of America on behalf of Mastercard on behalf of aj's friend who owed him some money" ?
Quoted text (1 line)
> How does this interact with AMP, however?
The way I see it is they're separate: you have a way of getting the preimage back over lightning (which is affected by AMP), and you have a way of turning a preimage into a third-party-verifiable PoP (with Schnorr or whatever).
(That might not be true if there's a clever way of safely feeding the nonce R back, so that you can go straight from a generic offer to an accepted payment with proof of payment)
Quoted text (4 lines)
> > With seckp256k1 preimages, it's easy to reduce that to sig=(R,s), > > and needing to communicate an R to the payer initially, who can then > > calculate S and send "m" along with the payment. > OK, I buy that.
Crap, do I need to give you proof of payment for it now? :)
Quoted text (8 lines)
> > Maybe it makes sense to disambiguate the term "invoice" -- when you don't > > know who you might be giving the goods/service to, call it an "offer", > > which can be a write-once/accept-by-anyone deal that you just leave on > > a webpage or your email signature; but an "invoice" should be specific > > to each individual payment, with a "receipt" provided once an invoice > > is paid. > "offer" is a good name, since I landed on the same one while thinking > about this too :)
Yay!
Quoted text (19 lines)
> > It seems to me like there are three levels that could be implemented:
> >
> > - laolu/conner: ("low AMP" ?)
> > works with sha256
> > some privacy improvement
> > loses proof-of-payment
> > can't claim unless all payments arrive
>
> Yep.
>
> > - just send multiple payments with the same hash:
> > works with sha256
> > privacy not improved much (some intermediary nodes no longer know
> > full invoice value)
> > can claim partial payments as soon as they arrive
> > accepting any partial payment provides proof-of-payment
>
> Interestingly, if vendor takes part payment, rest can be stolen by
> intermediaries.Or you could just see a $5 bill, send $0.50 through, and wait to see if the take the partial payment immediately before even trying the remaining $4.50.
Quoted text (7 lines)
> > - secp256k1: ("high AMP" ?)
> > needs secp256k1 preimages
> > works fine with decorrelation improving privacy at every step
> > can set it up so can only claim once all partial payments arrive
> > accepting partial payment provides proof-of-payment
> Yes. Though I'm not sure exactly how this works with your scheme
> above... Vendor -> *: "I sell widgets for 0.01 BTC, my pubkey is P"
Customer -> Vendor: "I want to buy a widget"
Vendor -> Customer: "Here's an R value"
Customer: calculates S = R + H(P,R,"send $me a widget at $address")*P
Customer -> Vendor: "here's 0.01 BTC for s corresponding to S, my
details are R, $me, $address"
Vendor: looks up r for R=r*G, calculates s = r + H(P,R,"send $me a
widget at $address")*p, checks S=s*G
Vendor -> Customer: <accepts payment, revealing s>
Customer -> Court: reveals the invoice ("send $me a widget...") and the
signature by Vendor's pubkey P, (s,R)
I think the way to do secp256k1 AMP with that is that when sending through the payment is for the customer to send three payments to the Vendor conditional on preimages for A,B,C calculated as:
A = S + H(1,secret)*G B = S + H(2,secret)*G C = S + H(3,secret)*G
where "secret" is your xor of info from each of the three message hashes.
Quoted text (5 lines)
> > In theory, both "just send multiple payments" and "secp256k1" could have > > splitting and joining at any hop, if we could encode the instructions > > on how to do that in the onion message; joining is probably easy, but > > splitting seems like it might be hard? > I don't think so. If you can join two payments, it wasn't private?
Sorry, I mean "source-directed splits and joins", so rather than your source routing being a linear "me -> A -> B -> C -> D -> you", you specify a graph: "me -> A -> B,E ; B -> C ; E -> F -> G ; C,G -> D -> you" so you tell "A" how to split the payment into two new routes, and tell "D" to join two payments and continue it on. The ECC part works fine for that, but the onion routed messages seem difficult and probably not worth considering for spec v1.1.
Quoted text (12 lines)
> Note: if we need an interaction message for BOLT11 features we want in > future[1], then it has the advantage that it decouples the bolt11 > features from changing preimages to secp256k1. That makes this question > *critical* for the Summit next week. > > Thanks! > Rusty. > > [1] If we're not careful we're going to implement HORNET so we can pass > arbitrary messages around, which means we want to start charging for > them to prevent spam, which means we reopen the pre-payment debate, and > need reliable error messages...
Could leave the interactivity to the "web store" layer, eg have a BOLT 11 v1.1 "offer" include a url for the website where you go an enter your name and address and whatever other info they need, and get a personalised BOLT 11 v1.1 "invoice" back with payment-hash/nonce/signature/whatever?
Cheers, aj
Anthony Towns <aj at erisian.com.au> writes:
Quoted text (9 lines)
>> In the payer-supplied data case, I think 'm' should include a signature >> for a key only the payer knows: this lets them prove *they* made the >> payment. > > I don't object to that, but I think it's unnecessary; as long as there > was a payment for delivery of the widget to "aj" in "Australia" does it > matter if the payment was technically made by "aj" by "Visa on behalf > of aj" or by "Bank of America on behalf of Mastercard on behalf of aj's > friend who owed him some money" ?
You often don't want the vendor to know anything about you, and there's often no reason why they should.
And it just doesn't work unless you give over uniquely identifying information. AJ posts to r/bitcoin demonstrating payment, demanding his goods. Sock puppet says "No, I'm the AJ in Australia" and cut & pastes the same proof.
Even if you did, that's exactly the problem we have now. *In theory* the invoice should be specific enough that it identifies where they shipped the item, in practice it never is (even the Blockstream store gets this wrong!).
Sure, in case of digital delivery there's no proof that delivery (didn't) happen, but you can at least show you paid.
Quoted text (17 lines)
>> How does this interact with AMP, however? > > The way I see it is they're separate: you have a way of getting the > preimage back over lightning (which is affected by AMP), and you have a > way of turning a preimage into a third-party-verifiable PoP (with > Schnorr or whatever). > > (That might not be true if there's a clever way of safely feeding the > nonce R back, so that you can go straight from a generic offer to an > accepted payment with proof of payment) > >> > With seckp256k1 preimages, it's easy to reduce that to sig=(R,s), >> > and needing to communicate an R to the payer initially, who can then >> > calculate S and send "m" along with the payment. >> OK, I buy that. > > Crap, do I need to give you proof of payment for it now? :)
Please :)
Quoted text (13 lines)
>> > - just send multiple payments with the same hash: >> > works with sha256 >> > privacy not improved much (some intermediary nodes no longer know >> > full invoice value) >> > can claim partial payments as soon as they arrive >> > accepting any partial payment provides proof-of-payment >> >> Interestingly, if vendor takes part payment, rest can be stolen by >> intermediaries. > > Or you could just see a $5 bill, send $0.50 through, and wait to see > if the take the partial payment immediately before even trying the > remaining $4.50.
Sure, that's true today, too?
Quoted text (28 lines)
>> > - secp256k1: ("high AMP" ?)
>> > needs secp256k1 preimages
>> > works fine with decorrelation improving privacy at every step
>> > can set it up so can only claim once all partial payments arrive
>> > accepting partial payment provides proof-of-payment
>> Yes. Though I'm not sure exactly how this works with your scheme
>> above...
>
> Vendor -> *: "I sell widgets for 0.01 BTC, my pubkey is P"
> Customer -> Vendor: "I want to buy a widget"
> Vendor -> Customer: "Here's an R value"
> Customer: calculates S = R + H(P,R,"send $me a widget at $address")*P
> Customer -> Vendor: "here's 0.01 BTC for s corresponding to S, my
> details are R, $me, $address"
> Vendor: looks up r for R=r*G, calculates s = r + H(P,R,"send $me a
> widget at $address")*p, checks S=s*G
> Vendor -> Customer: <accepts payment, revealing s>
>
> Customer -> Court: reveals the invoice ("send $me a widget...") and the
> signature by Vendor's pubkey P, (s,R)
>
> I think the way to do secp256k1 AMP with that is that when sending
> through the payment is for the customer to send three payments to the
> Vendor conditional on preimages for A,B,C calculated as:
>
> A = S + H(1,secret)*G
> B = S + H(2,secret)*G
> C = S + H(3,secret)*GNote: I prefer the construction H(<secret>,<part-of-secret-in-that-payment>) which doesn't require an explicit order.
Quoted text (1 line)
> where "secret" is your xor of info from each of the three message hashes.
Note that this only works if the message "send $me a widget at $address" includes a nonce, since it may be easily grindable otherwise.
Since I'm suggesting it include a signature in msg, we're covered here. We could chacha20 the msg in A, and just xor the key between other payments for a bit of space saving.
Quoted text (13 lines)
>> > In theory, both "just send multiple payments" and "secp256k1" could have >> > splitting and joining at any hop, if we could encode the instructions >> > on how to do that in the onion message; joining is probably easy, but >> > splitting seems like it might be hard? >> I don't think so. If you can join two payments, it wasn't private? > > Sorry, I mean "source-directed splits and joins", so rather than > your source routing being a linear "me -> A -> B -> C -> D -> you", > you specify a graph: "me -> A -> B,E ; B -> C ; E -> F -> G ; C,G -> > D -> you" so you tell "A" how to split the payment into two new routes, > and tell "D" to join two payments and continue it on. The ECC part works > fine for that, but the onion routed messages seem difficult and probably > not worth considering for spec v1.1.
I'm not sure I see the benefit over just treating them independently, so I also think we should defer.
Quoted text (9 lines)
>> [1] If we're not careful we're going to implement HORNET so we can pass >> arbitrary messages around, which means we want to start charging for >> them to prevent spam, which means we reopen the pre-payment debate, and >> need reliable error messages... > > Could leave the interactivity to the "web store" layer, eg have a BOLT > 11 v1.1 "offer" include a url for the website where you go an enter your > name and address and whatever other info they need, and get a personalised > BOLT 11 v1.1 "invoice" back with payment-hash/nonce/signature/whatever?
I think that's out-of-scope, and I generally dislike including a URL since it's an unsigned externality and in practice has horrible privacy properties.
Cheers, Rusty.
Good morninh list,
Sent with ProtonMail Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Saturday, November 3, 2018 9:37 AM, ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:
Quoted text (11 lines)
> Good morning Rusty, aj, and list, > > > > - channel announcements: do you support secp256k1 for hashes or just > > > sha256? > > > > > > > Worse, it becomes "I support secp256k1 with ECDSA" then a new "I support > > secp256k1 with Schnorr". You need a continuous path of channels with > > the same feature. > > I believe not? Both the 2p-ECDSA and Schnorr contingent payment schemes effectively encode "I will pay you N satoshi if you give me the private key of the public key P on the secp256k1 curve, before time B", which can be composed with another contingent payment of either 2p-ECDSA or Schnorr. So it would be possible to have a route with channels alternating between the two schemes.
Thinking a little more....
Suppose we are in possession of a zero knowledge proof, with public parameters P (a point on secp256k1) and h (a 256-bit scalar), and private parameter k (a 256-bit scalar). The proof shows (P == k * G) && (h == sha256(k)).
Then suppose Alice wishes to pay Delilah some satoshis in exchange for k. However there is no channel between them. There *is* a route from Alice to Bob to Carol to Delilah. The problem is that Bob is using old software and all channels Bob has use only sha256.
In the onion packet for Carol, Alice can put "the secret preimage k is known by Delilah, with the secp256k1 public key P, here's the proof (P == k * G) && (h == sha256(k))". This lets us make routes that are partially in secp256k1 and partially in sha256.
However I am not enough of a mathematician to know how to generate such a proof.
And as aj points out, whether to use sha256 or secp256k1 can be done on a per-HTLC basis instead of requiring a channel start out with one or both. As long as all nodes on all viable routes understand some secp256k1 protocol,it would be possible to do AMP and decorrelation.
Regards, ZmnSCPxj
Good morning Rusty and aj and list,
Quoted text (19 lines)
> > > > In the payer-supplied data case, I think 'm' should include a signature > > > for a key only the payer knows: this lets them prove they made the > > > payment. > > > > I don't object to that, but I think it's unnecessary; as long as there > > was a payment for delivery of the widget to "aj" in "Australia" does it > > matter if the payment was technically made by "aj" by "Visa on behalf > > of aj" or by "Bank of America on behalf of Mastercard on behalf of aj's > > friend who owed him some money" ? > > You often don't want the vendor to know anything about you, and there's > often no reason why they should. > > And it just doesn't work unless you give over uniquely identifying > information. AJ posts to r/bitcoin demonstrating payment, demanding his > goods. Sock puppet says "No, I'm the AJ in Australia" and cut & pastes > the same proof. >
Technically speaking, all that AJ in Australia needs to show is that he or she knows, the private key behind the public key that is indicated on the invoice.
Before payment, only the payee knows this private key.
After payment, both AJ in Australia and the payee know this private key (since the payment is conditional on AJ in Australia learning this key).
So instead of a non-interactive proof of payment, our law court performs an interactive proof, of the form:
1. Court: I have this random number X[1], please sign it with the public key P on the invoice, Mr. whoever-you-are.
2. AJ in Australia: Here's the (R[1], s[1])
3. Court: I have this random number X[2], please sign it with the public key P on the invoice, Mr. whoever-you-are.
4. AJ in Australia: Here's the (R[2], s[2])
... skip 194 more steps ...
199. Court: I have this random number X[100], please sign it with the public key P on the invoice, Mr. whoever-you-are.
200. AJ in Australia: Here's the (R[100], s[100])
201. Court: By the power vested on me by Mathematics, I find Blockstream Store to be liable for the delivery of 100 widgets as indicated on this invoice. Court is now adjourned.
Is the above theoretically workable, without the need for identifying AJ in Australia, other than via its ability to sign using the private key?
Regards, ZmnSCPxj
ZmnSCPxj <ZmnSCPxj at protonmail.com> writes:
Quoted text (27 lines)
> Good morning Rusty and aj and list, > >> >> > > In the payer-supplied data case, I think 'm' should include a signature >> > > for a key only the payer knows: this lets them prove they made the >> > > payment. >> > >> > I don't object to that, but I think it's unnecessary; as long as there >> > was a payment for delivery of the widget to "aj" in "Australia" does it >> > matter if the payment was technically made by "aj" by "Visa on behalf >> > of aj" or by "Bank of America on behalf of Mastercard on behalf of aj's >> > friend who owed him some money" ? >> >> You often don't want the vendor to know anything about you, and there's >> often no reason why they should. >> >> And it just doesn't work unless you give over uniquely identifying >> information. AJ posts to r/bitcoin demonstrating payment, demanding his >> goods. Sock puppet says "No, I'm the AJ in Australia" and cut & pastes >> the same proof. >> > > Technically speaking, all that AJ in Australia needs to show is that he or she knows, the private key behind the public key that is indicated on the invoice. > > Before payment, only the payee knows this private key. > > After payment, both AJ in Australia and the payee know this private key (since the payment is conditional on AJ in Australia learning this key).
But the merchant (payee) knows it too. So the lizard masters[1] at Blockstream can produce this proof as well?
Cheers, Rusty. [1] https://twitter.com/rusty_twit/status/1057794540122206208
On Mon, Nov 05, 2018 at 01:05:17AM +0000, ZmnSCPxj via Lightning-dev wrote:
Quoted text (5 lines)
> > And it just doesn't work unless you give over uniquely identifying > > information. AJ posts to r/bitcoin demonstrating payment, demanding his > > goods. Sock puppet says "No, I'm the AJ in Australia" and cut & pastes > > the same proof. > Technically speaking, all that AJ in Australia needs to show is that he or she knows, the private key behind the public key that is indicated on the invoice.
Interesting. I think what you're saying is that with secp256k1 preimages (with decorrelation), if you have the payment hash Q, then the payment preimage q (Q=q*G) is only known to the payee and the payer (and not any intermediaries thanks to decorrelation), so if you see a statement
m="This invoice has been paid but not delivered as at 2018-11-05"
signed by "Q" (so, some s,R s.t. s*G = R + H(Q,R,m)*Q) then that means either the payee signed it, in which case there's no dispute, or the payer signed it... And that's publicly verifiable with only the original invoice information (ie "Q").
(I don't think there's any need for multiple rounds of signatures)
FWIW, I don't see reddit as a particularly viable "court"; there's no way for reddit to tell who's actually right in a dispute, eg if I say blockstream didn't send stickers I paid for, and blockstream says they did; ie there's no need for a sock puppet in the above scenario, blockstream can just say "according to our records you signed for delivery, stop whinging". (And if we both agree that it did or didn't arrive, there's no need to post cryptographic proofs to reddit afaics)
I think there's maybe four sorts of "proof of payment" people might desire:
0) no proof: "completely" deniable payments (donations?)
1) shared secret: ability to prove directly to the payee that an
invoice was paid (what we have now)
2) signed payment: ability to prove to a different business unit of
the payee that payment was made, so that you can keep all the
secrets in the payment-handling part, and have the service-delivery
part not be at risk for losing all your money
3) third-party verifiable: so you can associate a payment with real
world identity information, and take them to court (or reddit) as a
contract dispute; needs PKI infrastructure so you can be confident
the pubkey maps to the real world people you think it does, etc
Cheers, aj
On Sun, Nov 04, 2018 at 08:04:20PM +1030, Rusty Russell wrote:
Quoted text (12 lines)
> >> > - just send multiple payments with the same hash: > >> > works with sha256 > >> > privacy not improved much (some intermediary nodes no longer know > >> > full invoice value) > >> > can claim partial payments as soon as they arrive > >> > accepting any partial payment provides proof-of-payment > >> Interestingly, if vendor takes part payment, rest can be stolen by > >> intermediaries. > > Or you could just see a $5 bill, send $0.50 through, and wait to see > > if the take the partial payment immediately before even trying the > > remaining $4.50. > Sure, that's true today, too?
Yeah, exactly. So to get correct behaviour vendors/payees need to check the HTLC amount matches what they expect already... They could just automatically pause instead of rejecting here to see if more payments come through in the next n seconds via (presumably) different paths, with no extra message bit required. (A bit in the invoice indicating you'll do this would probably be useful though)
Quoted text (22 lines)
> > Vendor -> *: "I sell widgets for 0.01 BTC, my pubkey is P"
> > Customer -> Vendor: "I want to buy a widget"
> > Vendor -> Customer: "Here's an R value"
> > Customer: calculates S = R + H(P,R,"send $me a widget at $address")*P
> > Customer -> Vendor: "here's 0.01 BTC for s corresponding to S, my
> > details are R, $me, $address"
> > Vendor: looks up r for R=r*G, calculates s = r + H(P,R,"send $me a
> > widget at $address")*p, checks S=s*G
> > Vendor -> Customer: <accepts payment, revealing s>
> >
> > Customer -> Court: reveals the invoice ("send $me a widget...") and the
> > signature by Vendor's pubkey P, (s,R)
> >
> > I think the way to do secp256k1 AMP with that is that when sending
> > through the payment is for the customer to send three payments to the
> > Vendor conditional on preimages for A,B,C calculated as:
> >
> > A = S + H(1,secret)*G
> > B = S + H(2,secret)*G
> > C = S + H(3,secret)*G
> Note: I prefer the construction H(<secret>,<part-of-secret-in-that-payment>)
> which doesn't require an explicit order.Yes, you're quite right.
Quoted text (2 lines)
> I'm not sure I see the benefit over just treating them independently, > so I also think we should defer.
If you've got a path that merges, then goes for a few hops, you'd save on the fee_base_msat fees, and allow the merged hops to have smaller commitment transactions. Kinda neat, but the complexity in doing the onion stuff means it definitely makes sense to defer IMO.
Quoted text (11 lines)
> >> [1] If we're not careful we're going to implement HORNET so we can pass > >> arbitrary messages around, which means we want to start charging for > >> them to prevent spam, which means we reopen the pre-payment debate, and > >> need reliable error messages... > > Could leave the interactivity to the "web store" layer, eg have a BOLT > > 11 v1.1 "offer" include a url for the website where you go an enter your > > name and address and whatever other info they need, and get a personalised > > BOLT 11 v1.1 "invoice" back with payment-hash/nonce/signature/whatever? > I think that's out-of-scope, and I generally dislike including a URL > since it's an unsigned externality and in practice has horrible privacy > properties.
Maybe... I'm not sure that it'll make sense to try to negotiate postage and handling fees over lightning, rather than over https, though?
BTW, reviewing contract law terminology, I think the way lawyers would call it is:
"invitation to treat" -- advertising that you'll sell widgets for $x "offer" -- I'll pay you $3x for delivery of 3 widgets to my address "acceptance" -- you agree, take my $3x and give me a receipt "consideration" -- you get my $3x, I get 3 widgets
So it might be better to have the terms be "advertisment", "invoice", "receipt", because the "advertisement" isn't quite an offer in contract-law terms. In any event, I think that would mean the BOLT-11 terms and lightning payment process would map nicely into contract law 101, which seems helpful.
Oh! Post-Schnorr I think there's a good reason for the payee to include their own crypto key in the invoice; so you can generate an scriptless-script address for an on-chain fallback payment directly between the payer/payee that reveals proof-of-payment on acceptance (and allow refund on timeout via taproot I guess). At least, I think all that might be theoretically feasible.
Cheers, aj
Anthony Towns <aj at erisian.com.au> writes:
Quoted text (6 lines)
> FWIW, I don't see reddit as a particularly viable "court"; there's > no way for reddit to tell who's actually right in a dispute, eg if I > say blockstream didn't send stickers I paid for, and blockstream says > they did; ie there's no need for a sock puppet in the above scenario, > blockstream can just say "according to our records you signed for > delivery, stop whinging".
Well, in that case they can show a tracking number and Canada Post link?
We will eventually develop systems of arbitration better than "whining on reddit/twitter", but that's where bitcoin was in its early days, so I use it as a useful starting point to think about receipts when we lack an intermediary.
Quoted text (7 lines)
> I think there's maybe four sorts of "proof of payment" people might > desire: > > 0) no proof: "completely" deniable payments (donations?) > > 1) shared secret: ability to prove directly to the payee that an > invoice was paid (what we have now)
We also, importantly, have the ability to tie the receipt to the invoice.
Quoted text (4 lines)
> 2) signed payment: ability to prove to a different business unit of > the payee that payment was made, so that you can keep all the > secrets in the payment-handling part, and have the service-delivery > part not be at risk for losing all your money
Hmm, this requires auditing the current commitment transaction I think ("see, I'm holding the money!"). I have to think about this some more...
Quoted text (4 lines)
> 3) third-party verifiable: so you can associate a payment with real > world identity information, and take them to court (or reddit) as a > contract dispute; needs PKI infrastructure so you can be confident > the pubkey maps to the real world people you think it does, etc
Yes, we're still missing that last mile between the merchant and the nodeid. There's a proposal to do this with DNS records, there's the LetsEncrypt-style "serve this URL", but we also need something like Certificate Transparency so I can reliably get old nodeids...
But the perfect is the enemy of the good, too.
Cheers, Rusty.
Good morning Rusty and aj,
On Monday, November 5, 2018 9:38 AM, Rusty Russell <rusty at rustcorp.com.au> wrote:
Quoted text (6 lines)
> > Technically speaking, all that AJ in Australia needs to show is that he or she knows, the private key behind the public key that is indicated on the invoice. > > Before payment, only the payee knows this private key. > > After payment, both AJ in Australia and the payee know this private key (since the payment is conditional on AJ in Australia learning this key). > > But the merchant (payee) knows it too. So the lizard masters[1] at > Blockstream can produce this proof as well?
The lizard masters are thus working against their own interest, and deliberately complicit in convincing the court that they are in fact, guilty of getting paid without delivering goods?
While *possible*, it seems *irrational* to do so, and the ZmnSCPxj machine army (of which I am definitively not a part) will rise up with our superior rationality and overthrow the lizard masters.
On Monday, November 5, 2018 10:18 AM, Anthony Towns <aj at erisian.com.au> wrote:
Quoted text (20 lines)
> On Mon, Nov 05, 2018 at 01:05:17AM +0000, ZmnSCPxj via Lightning-dev wrote: > > > > And it just doesn't work unless you give over uniquely identifying > > > information. AJ posts to r/bitcoin demonstrating payment, demanding his > > > goods. Sock puppet says "No, I'm the AJ in Australia" and cut & pastes > > > the same proof. > > > Technically speaking, all that AJ in Australia needs to show is that he or she knows, the private key behind the public key that is indicated on the invoice. > > Interesting. I think what you're saying is that with secp256k1 preimages > (with decorrelation), if you have the payment hash Q, then the payment > preimage q (Q=qG) is only known to the payee and the payer (and not > any intermediaries thanks to decorrelation), so if you see a statement > > m="This invoice has been paid but not delivered as at 2018-11-05" > > signed by "Q" (so, some s,R s.t. sG = R + H(Q,R,m)*Q) then that meanseither the payee signed it, in which case there's no dispute, or the > payer signed it... And that's publicly verifiable with only the original > invoice information (ie "Q"). > > (I don't think there's any need for multiple rounds of signatures)
Ah, yes, that indeed seems to be a better idea then.
I think, this begins to become related to the "revocable invoices" of the other thread with CJP.
Suppose AJ from Australia wishes to purchase some Lightning Network memorabilia from Lizard Master Rusty.
1. A revocable invoice is created by Lizard Master Rusty. This involves two secrets: 1.1. A payment-proof-secret, initially known only by Lizard Master Rusty. 1.2. A revocation-secret, initially known only by AJ from Australia. 2. AJ from Australia pays the invoice, and gets the payment proof secret that can be used as proof-that-Lizard-Master-Rusty-has-an-obligation. 3. The quantum universe splits into two paths, 3.1. and 3.2. 3.1. Success-path 3.1.1. Lizard Master Rusty arrives at the home of AJ from Australia to give the Lightning Network memorabilia. 3.1.2. Lizard Master Rusty demands the revocation key for the invoice in exchange for the physical item. 3.1.3. AJ from Australia gives the revocation key and gets the Lightning Network memorabilia. The first invoice is revoked (it has been completed and Lizard Master Rusty has disposed of the obligation). 3.2. Fail-path 3.2.1. Due to having to fight off the ZmnSCPxj machine army, Lizard Master Rusty is unable to go to the home of AJ from Australia to deliver the goods. 3.2.2. AJ from Australia provides a non-revocable invoice, which is payable in exchange for the revocation key of the first invoice. 3.2.3. Lizard Master Rusty pays to AJ from Australia (i.e. a refund, plus possibly some reparations) in exchange for the revocation key. The first invoice is revoked (it has been refunded and Lizard Master Rusty has disposed of the obligation).
(the above is approximately what I am grasping at, when thinking of protocols "on top" of Lightning. It seems to me that the basic mechanism of "pay for a secret" is sufficient at the Lightning level, and we can create higher levels on top for such exchanges.)
Regards, ZmnSCPxj