<div dir="ltr"><span style="font-size:12.8px">The wording is a little strange and I think it *should* work as you state, but Bitcoin Core will actually reject any output that has zero value (even a single OP_RETURN output -- I just tested again to make sure).</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Here&#39;s the blocking code:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><a href="https://github.com/bitcoin/bitcoin/blob/master/src/qt/paymentserver.cpp#L584" target="_blank">https://github.com/bitcoin/bitcoin/blob/master/src/qt/paymentserver.cpp#L584</a><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I agree that this should be made more clear in my BIP though, I&#39;ll clean up the language.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 26, 2016 at 6:37 AM, Andreas Schildbach via bitcoin-dev <span dir="ltr">&lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Discussion about reasoning of OP_RETURN aside, I think your<br>
specification needs to be more precise/less ambiguous.<br>
<br>
Here is what BIP70 currently says about PaymentDetails.outputs:<br>
<br>
&quot;one or more outputs where Bitcoins are to be sent. If the sum of<br>
outputs.amount is zero, the customer will be asked how much to pay, and<br>
the bitcoin client may choose any or all of the Outputs (if there are<br>
more than one) for payment. If the sum of outputs.amount is non-zero,<br>
then the customer will be asked to pay the sum, and the payment shall be<br>
split among the Outputs with non-zero amounts (if there are more than<br>
one; Outputs with zero amounts shall be ignored).&quot;<br>
<br>
As you can see, zero outputs are not ignored at all. They are used as an<br>
indication to allow the user to set an amount. So if you&#39;d come up with<br>
one zero-amount OP_RETURN output, it would pop up an amount dialog.<br>
Certainly not what you want, right?<br>
<span class=""><br>
<br>
On 01/26/2016 03:54 AM, Toby Padilla via bitcoin-dev wrote:<br>
&gt; It looks like my draft hasn&#39;t been approved by the mailing list so if<br>
&gt; anyone would like to read it it&#39;s also on Gist:<br>
&gt;<br>
&gt; <a href="https://gist.github.com/toby/9e71811d387923a71a53" rel="noreferrer" target="_blank">https://gist.github.com/toby/9e71811d387923a71a53</a><br>
&gt;<br>
&gt; Luke - As stated in the Github thread, I totally understand where you&#39;re<br>
&gt; coming from but the fact is people *will* encode data on the blockchain<br>
&gt; using worse methods. For all of the reasons that OP_RETURN was a good<br>
&gt; idea in the first place, it&#39;s a good idea to support it in PaymentRequests.<br>
&gt;<br>
&gt; As for keyless - there&#39;s no way (that I know of) to construct a<br>
&gt; transaction with a zero value OP_RETURN in an environment without keys<br>
&gt; since the Payment Protocol is what defines the method for getting a<br>
&gt; transaction from a server to a wallet. You can make a custom transaction<br>
&gt; and execute it in the same application but without Payments there&#39;s no<br>
&gt; way to move transactions between two applications. You need to build the<br>
&gt; transaction where you execute it and thus need a key.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Jan 25, 2016 at 6:24 PM, Luke Dashjr &lt;<a href="mailto:luke@dashjr.org">luke@dashjr.org</a><br>
</span><div><div class="h5">&gt; &lt;mailto:<a href="mailto:luke@dashjr.org">luke@dashjr.org</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     This is a bad idea. OP_RETURN attachments are tolerated (not<br>
&gt;     encouraged!) for<br>
&gt;     the sake of the network, since the spam cannot be outright stopped.<br>
&gt;     If it<br>
&gt;     could be outright stopped, it would not be reasonable to allow<br>
&gt;     OP_RETURN. When<br>
&gt;     it comes to the payment protocol, however, changing the current<br>
&gt;     behaviour has<br>
&gt;     literally no benefit to the network at all, and the changes proposed<br>
&gt;     herein<br>
&gt;     are clearly detrimental since it would both encourage spam, and<br>
&gt;     potentially<br>
&gt;     make users unwilling (maybe even unaware) participants in it. For these<br>
&gt;     reasons, *I highly advise against publishing or implementing this<br>
&gt;     BIP, even if<br>
&gt;     the later mentioned issues are fixed.*<br>
&gt;<br>
&gt;     On Tuesday, January 26, 2016 1:02:44 AM Toby Padilla wrote:<br>
&gt;     &gt; An example might be a merchant that adds the hash of a plain text invoice<br>
&gt;     &gt; to the checkout transaction. The merchant could construct the<br>
&gt;     &gt; PaymentRequest with the invoice hash in an OP_RETURN and pass it to the<br>
&gt;     &gt; customer&#39;s wallet. The wallet could then submit the transaction, including<br>
&gt;     &gt; the invoice hash from the PaymentRequest. The wallet will have encoded a<br>
&gt;     &gt; proof of purchase to the blockchain without the wallet developer having to<br>
&gt;     &gt; coordinate with the merchant software or add features beyond this BIP.<br>
&gt;<br>
&gt;     Such a &quot;proof&quot; is useless without wallet support. Even if you argue<br>
&gt;     it could<br>
&gt;     be implemented later on, it stands to reason that a scammer will<br>
&gt;     simply encode<br>
&gt;     garbage if the wallet is not checking the proof-of-purchase upfront.<br>
&gt;     To check<br>
&gt;     it, you would also need further protocol extensions which are not<br>
&gt;     included in<br>
&gt;     this draft.<br>
&gt;<br>
&gt;     &gt; Merchants and Bitcoin application developers benefit from this BIP because<br>
&gt;     &gt; they can now construct transactions that include OP_RETURN data in a<br>
&gt;     &gt; keyless environment. Again, prior to this BIP, transactions that used<br>
&gt;     &gt; OP_RETURN (with zero value) needed to be constructed and executed in the<br>
&gt;     &gt; same software. By separating the two concerns, this BIP allows merchant<br>
&gt;     &gt; software to create transactions with OP_RETURN metadata on a server without<br>
&gt;     &gt; storing public or private Bitcoin keys. This greatly enhances security<br>
&gt;     &gt; where OP_RETURN applications currently need access to a private key to sign<br>
&gt;     &gt; transactions.<br>
&gt;<br>
&gt;     I don&#39;t see how this has any relevance to keys at all...<br>
&gt;<br>
&gt;     &gt; ## Specification<br>
&gt;     &gt;<br>
&gt;     &gt; The specification for this BIP is straightforward. BIP70 should be fully<br>
&gt;     &gt; implemented with two changes:<br>
&gt;     &gt;<br>
&gt;     &gt; 1. Outputs where the script is an OP_RETURN and the value is zero should be<br>
&gt;     &gt; accepted by the wallet.<br>
&gt;     &gt; 2. Outputs where the script is an OP_RETURN and the value is greater than<br>
&gt;     &gt; zero should be rejected.<br>
&gt;     &gt;<br>
&gt;     &gt; This is a change from the BIP70 requirement that all zero value outputs be<br>
&gt;     &gt; ignored.<br>
&gt;<br>
&gt;     This does not appear to be backward nor even forward compatible. Old<br>
&gt;     clients<br>
&gt;     will continue to use the previous behaviour and transparently omit any<br>
&gt;     commitments. New clients on the other hand will fail to include<br>
&gt;     commitments<br>
&gt;     produced by old servers. In other words, it is impossible to produce<br>
&gt;     software<br>
&gt;     compatible with both BIP 70 and this draft, and implementing either<br>
&gt;     would<br>
&gt;     result in severe consequences.<br>
&gt;<br>
&gt;     &gt; As it exists today, BIP70 allows for OP_RETURN data storage at the expense<br>
&gt;     &gt; of permanently destroyed Bitcoin.<br>
&gt;<br>
&gt;     It is better for the spammers to lose burned bitcoins, than have a<br>
&gt;     way to<br>
&gt;     avoid them.<br>
&gt;<br>
&gt;     Luke<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; bitcoin-dev mailing list<br>
&gt; <a href="mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.linuxfoundation.org</a><br>
&gt; <a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
&gt;<br>
<br>
<br>
_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href="mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
</blockquote></div><br></div>