Key.run: BIP-70 Payments and OP_RETURN

Key.run: BIP-70 Payments and OP_RETURN
From: Toby Padilla @ 2015-12-08  2:10 UTC ( / )
  To: bitcoin-dev



Hi all. I've been working on a new publication platform based on Bitcoin
called key.run: http://key.run

The high level overview is that key.run stores BitTorrent info hashes
(magnet links) in the blockchain by sending transactions to a "namespace"
Bitcoin address. Using SPV, I reconstitute the key.run db from the
blockchain. This is meant to be an open source and distributed system so
anyone can run the key.run server (and change namespace keys). More info
here: https://git.playgrub.com/toby/keyrun

Now to my issue...

One of the main use cases I wanted to support was people using their
*existing* Bitcoin wallet to encode the key.run transactions on the
blockchain. Practically speaking this meant building the transactions with
the proper OP_RETURN value server-side then passing them to the end user's
wallet via BIP-70. I have this working with Bitcoin Core (there are issues
with other wallets I've tested with BIP-70).

The problem I'm having is that Bitcoin Core will not allow BIP-70
PaymentDetails to contain outputs with zero value. As stated in
https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki:

"if there are more than one; Outputs with zero amounts shall be ignored"

Bitcoin Core doesn't seem to ignore the output though, it rejects the
transaction and doesn't allow the user to submit it. The key.run
transactions currently work by giving the OP_RETURN outputs a non-zero >
dust value. This value is presumably lost forever.

I think ideally OP_RETURN outputs with zero value WOULD be allowed since
they are valid transactions. Allowing OP_RETURN outputs to be constructed
with BIP-70 Payments is also the only way I can think of to extend the
functionality of existing wallets.

I would love to get feedback on if there is an alternative way to do what I
propose or ideally if BIP-70 could be tweaked to allow OP_RETURN outputs
with zero value.

I'd also love feedback on key.run but this probably isn't the best venue
for that. I've setup #keyrun on Freenode if anyone is interested in
discussing the project.

Regards,
Toby

--
http://twitter.com/toby