<div dir="ltr"><p dir="ltr">Den 14 mar 2015 00:59 skrev &quot;Patrick Mccorry (PGR)&quot; &lt;<a href="mailto:patrick.mccorry@newcastle.ac.uk" target="_blank">patrick.mccorry@newcastle.ac.uk</a>&gt;:<br>
&gt;<br>
&gt; That all seems more complicated than it needs to be - the service you are paying knows that it had received a payment from some public key Q (regardless of script type, as all scripts require a public key).</p>
<p dir="ltr">The service knows it had received a payment from Q1, Q2,...,Qn. A tx may have multiple inputs and each input may have several public keys. </p>
<p dir="ltr">&gt;<br>
&gt; So I want to rent a movie, they send me a challenge and I respond with a zero knowledge proof to demonstrate that I am the owner of Q, and as they know that Q made a payment - then there is a proof of payment - as this is provided by the time stamped transaction on the blockchain - in this sense you are bootstrapping trust from the blockchain.<br>
&gt;</p>
<p dir="ltr">Ok. Without knowing much about zero knowledge proof, i guess you&#39;d need a challenge/response for each of the keys Q1,..,Qn. If we settle on only a single key, what key from what input should we use? One input may be a multisig (2 of 3) input. Is it ok to settle on only one of the multisig keys? Probably not. I&#39;d say that we need 2 of 3 signatures (just as in a bitcoin transaction), and not necessarily the same two that made the payment. <br></p><p dir="ltr"></p><p dir="ltr">&gt; For all of your scenarios, a simple challenge-response scheme would work. Adding an op_return makes the payment transaction worse as it is now distinguishable on the blockchain - you want use information that is already available on that transaction. <br></p><p>I&#39;m not sure I follow. Do you mean that it&#39;s a problem that the PoP itself reveals what transaction I&#39;m proving? Well, maybe it is a problem under some circumstances. The least you can do to protect yourself from revealing information to third party is to communicate over secure channels. Could you please elaborate on this?</p><p>Anyway, if both the client and the server knows what transaction to prove (ad-sign example) you are right that the tx info is kind of redundant. But if we don&#39;t send the tx hints from server to client, the client user must manually select the transaction to prove which makes the user experience worse. <br></p><p>Thank you very much for your comments,</p><p>/Kalle<br></p><p dir="ltr">
&gt;<br>
&gt; Sent from my iPhone<br>
&gt;<br>
&gt; On 13 Mar 2015, at 19:58, Kalle Rosenbaum &lt;<a href="mailto:kalle@rosenbaum.se" target="_blank">kalle@rosenbaum.se</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Hi all,<br>
&gt;&gt;<br>
&gt;&gt; I&#39;ve been thinking about how a person can prove that she has made a payment. I came up with an idea I call Proof of Payment (PoP) and I would highly appreciate your comments. Has something like this been discussed somewhere before?<br>
&gt;&gt;<br>
&gt;&gt; Use cases<br>
&gt;&gt;<br>
&gt;&gt; There are several scenarios in which it would be useful to prove that you have paid for something. For example:<br>
&gt;&gt; A pre-paid hotel room where your PoP functions as a key to the door.<br>
&gt;&gt; An online video rental service where you pay for a video and watch it on any device.<br>
&gt;&gt; An ad-sign where you pay in advance for e.g. 2-weeks exclusivity. During this period you can upload new content to the sign whenever you like using PoP.<br>
&gt;&gt; A lottery where all participants pay to the same address, and the winner of the T-shirt is selected among the transactions to that address. You exchange the T-shirt for a PoP for the winning transaction.<br>
&gt;&gt;<br>
&gt;&gt; These use cases can be achieved without any personal information (no accounts, no e-mails, etc) being involved.<br>
&gt;&gt;<br>
&gt;&gt; Desirable properties:<br>
&gt;&gt; A PoP should be generated on demand.<br>
&gt;&gt; It should only be usable once to avoid issues due to theft.<br>
&gt;&gt; It should be able to create a PoP for any payment, regardless of script type (P2SH, P2PKH, etc.).<br>
&gt;&gt; Current methods of proving a payment, as I know of:<br>
&gt;&gt; BIP0070, The PaymentRequest together with the transactions fulfilling the payment makes some sort of proof. However, it does not meet 1 or 2 and it obviously only meets 3 if the payment is made through BIP0070. Also, there&#39;s no standard way to request/provide the proof.<br>
&gt;&gt; Signing messages, chosen by the entity that the proof is provided to, with the private keys used to sign the transaction. This could meet 1 and 2 but probably not 3. This is not standardized either.<br>
&gt;&gt; Proof of Payment, the data structure<br>
&gt;&gt;<br>
&gt;&gt; A proof of payment for a transaction T, PoP(T), is used to prove that one has ownership of the credentials needed to unlock all the inputs of T. It has the exact same structure as a bitcoin transaction with the same inputs as T and with a single OP_RETURN output:<br>
&gt;&gt;<br>
&gt;&gt; OP_RETURN PoP &lt;txid&gt; &lt;nonce&gt;<br>
&gt;&gt;          <br>
&gt;&gt; | Field     | Size [B] | Description                        |<br>
&gt;&gt; |-----------|----------|------------------------------------|<br>
&gt;&gt; | PoP       | 3        | Literal identifying this as a PoP  |<br>
&gt;&gt; | &lt;txid&gt;    | 32       | The transaction to Prove           |<br>
&gt;&gt; | &lt;nonce&gt;   | 5        | Unsigned integer                   |<br>
&gt;&gt;<br>
&gt;&gt; The PoP is signed using the same signing process that is used for bitcoin transactions. The purpose of the nonce is to make it harder to use a stolen PoP. Once the PoP has reached the destination, that PoP is useless since the destination will generate a new nonce for every PoP.<br>
&gt;&gt;<br>
&gt;&gt; Proof of Payment, the process<br>
&gt;&gt; A proof of payment request is sent from the server to the wallet. The request contains:<br>
&gt;&gt; a random nonce<br>
&gt;&gt; a destination where to send the PoP, for example a https URL<br>
&gt;&gt; data hinting the wallet which transaction to create a proof for. For example:<br>
&gt;&gt; txid, if known by the server<br>
&gt;&gt; PaymentRequest.PaymentDetails.merchant_data (in case of a BIP0070 payment)<br>
&gt;&gt; amount<br>
&gt;&gt; label, message or other information from a BIP0021 URL<br>
&gt;&gt; The wallet identifies the transaction T, if possible. Otherwise asks the user to select among the ones that fit the hints in 1.3.<br>
&gt;&gt; The wallet checks that T is on the blockchain, meaning all the inputs are spent.<br>
&gt;&gt; The wallet creates an unsigned PoP (UPoP) for T, and asks the user to sign it.<br>
&gt;&gt; The user confirms<br>
&gt;&gt; The UPoP(T) is signed by the wallet, creating PoP(T).<br>
&gt;&gt; The PoP is sent to the destination in 1.2.<br>
&gt;&gt; The server receiving the PoP validates it and responds with “valid” or “invalid”<br>
&gt;&gt; The wallet displays the response in some way to the user.<br>
&gt;&gt; Remarks: <br>
&gt;&gt; The method of transferring the PoP request at step 1 is not very well thought through, but I think we can extend BIP0021 to cater for this. For example read a URI, representing a PoP request, using QR code or NFC. A more advanced approach would be to extend BIP0070.<br>
&gt;&gt; The nonce must be randomly generated by the server for every new PoP request.<br>
&gt;&gt; Validating a PoP<br>
&gt;&gt;<br>
&gt;&gt; The server needs to validate the PoP and reply with “valid” or “invalid”. That process is outlined below:<br>
&gt;&gt; Check the format of the PoP. It must pass normal transaction checks, except for the inputs being already spent.<br>
&gt;&gt; Check the output script. It must conform to the OP_RETURN output format outlined above.<br>
&gt;&gt; Check that the nonce is the same as the one you requested.<br>
&gt;&gt; Check that the txid in the output is the transaction you actually want proof for. If you don’t know what transaction you want proof for, check that the transaction actually pays for the product/service you deliver (in the video rental case, find the transaction among all payments for that specific video).<br>
&gt;&gt; Check that the inputs of the PoP are exactly the same as in transaction T.<br>
&gt;&gt; Check the signatures of all the inputs, as would be done on a normal transaction.<br>
&gt;&gt; If the signatures are valid, the PoP is valid.<br>
&gt;&gt; Security issues<br>
&gt;&gt; Someone can intercept the PoP-request and change the destination so that the user sends the PoP to the bad actor.<br>
&gt;&gt; Someone can intercept the PoP-request and change for example the txid to trick the user to sign a PoP for another transaction than the intended. This can of course be avoided by actually looking at the UPoP before signing it. The bad actor could also set hints for a transaction that the user didn’t make, resulting in a broken service.<br>
&gt;&gt; Someone can steal a PoP and try to use the service hoping to get a matching nonce. Probability per try: 1/(2^40). The server should have mechanism for detecting a brute force attack of this kind, or at least slow down the process by delaying the PoP request by some 100 ms or so.<br>
&gt;&gt; Even if a wallet has no funds it might still be valuable as a generator for PoPs. This makes it important to keep the security of the wallet after it has been emptied.<br>
&gt;&gt; The first two issues are the same as for traditional bitcoin payments. They could be mitigated by using secure connections and possibly also extending BIP0070 to support PoPs.<br>
&gt;&gt;<br>
&gt;&gt; Further work<br>
&gt;&gt; Figure out how to make use of, and extend, BIP0070 for the purpose of PoPs<br>
&gt;&gt; Define an extension for BIP0021 to support PoP requests (something along the lines of BIP0072)<br>
&gt;&gt; Implement a proof-of-concept<br>
&gt;&gt; Possibly propose BIPs for the different parts.<br>
&gt;&gt; Looking forward to reading your comments<br>
&gt;&gt; Regards,<br>
&gt;&gt; Kalle Rosenbaum<br>
&gt;&gt;<br>
&gt;&gt; ------------------------------------------------------------------------------<br>
&gt;&gt; Dive into the World of Parallel Programming The Go Parallel Website, sponsored<br>
&gt;&gt; by Intel and developed in partnership with Slashdot Media, is your hub for all<br>
&gt;&gt; things parallel software development, from weekly thought leadership blogs to<br>
&gt;&gt; news, videos, case studies, tutorials and more. Take a look and join the <br>
&gt;&gt; conversation now. <a href="http://goparallel.sourceforge.net/" target="_blank">http://goparallel.sourceforge.net/</a><br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Bitcoin-development mailing list<br>
&gt;&gt; <a href="mailto:Bitcoin-development@lists.sourceforge.net" target="_blank">Bitcoin-development@lists.sourceforge.net</a><br>
&gt;&gt; <a href="https://lists.sourceforge.net/lists/listinfo/bitcoin-development" target="_blank">https://lists.sourceforge.net/lists/listinfo/bitcoin-development</a><br>
</p>
</div>