Bitcoin-com / Wallet

MIT License
331 stars 233 forks source link

Support for OP_RETURN parameter in bitcoincash: style URIs #427

Open jimtendo opened 5 years ago

jimtendo commented 5 years ago

Hi,

We're looking at submitting a patch to Electron Cash to add support for an "op_return" parameter in bitcoincash: URI's. There are a fair few use-cases that this would allow for (e.g. allowing a service to identify a particular transaction in an address without having to act as a mediator of funds by receiving and then forwarding to that address). I've given a more detailed description below:

https://www.reddit.com/r/btc/comments/9w0n59/walleturi_support_for_op_return/

The PR for Electron Cash is here:

https://github.com/Electron-Cash/Electron-Cash/pull/952

I do not have enough familiarity with Angular to submit a PR for the Bitcoin.com wallet, but would this be something that the Bitcoin.com Wallet might consider adding?

jimtendo commented 5 years ago

I'm willing to pay $100USD to whomever can implement this: https://bounty.cash/#/categories/1/apps-features/bounty/1/support-for-op-return-query-parameter

monsterbitar commented 5 years ago

I too would like to have this feature.

ghost commented 3 years ago

@jimtendo I'm working on it. I'm adding op_return support on the electron-cash ios mobile wallet. It's about 30% done.

https://github.com/Electron-Cash/Electron-Cash/pull/2307

jimtendo commented 3 years ago

Thanks much for this @libreloya, appreciate it. I'm hoping we can get cross-wallet support for this param as I think it's potentially quite powerful.

The other alternative for attaching OP_RETURN (which I've tested working with Electron Desktop and Bitcoin.com Wallet) is to use the BIP70 protocol and add it as an output.

Here's a demo of this using CashPayServer: https://codepen.io/jimtendo/pen/BaRoYeo

ghost commented 3 years ago

This was insanely helpful @jimtendo Thank you so much🙏

I managed to send a op_return transaction to my proof-of-concept site http://bchpages.com/ using your bip70 demo. From my mobile phone (Bitcoin.com Wallet) !

jimtendo commented 3 years ago

I checked out your page - I like the concept.

BIP70 is great in the flexibility it offers. However, for use-cases like your one here, it might not be ideal as it depends upon a central server to: a) Receive the invoice (transaction) details b) Broadcast the payment (generally with BIP70, your wallet sends the signed transaction to the server and the server then broadcasts the tx to the network) This means that the anonymity is hit slightly as that central server could keep a log of IP addresses:transactions. Spec for BIP70 is here: https://en.bitcoin.it/wiki/BIP_0070

I'd love to eventually see a CHIP for a new URI-based Protocol that allows more versatility in defining transactions. Something that allows:

  1. Specifying multiple outputs
  2. Defining more complex outputs (not based on address - eg. OP_RETURN and other custom out scripts) For now though, even getting the op_return URL param support across wallets would be very helpful.

If you need help with anything, feel free to reach out on Telegram: https://t.me/jimtendo