Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Monero support ready for assessment #1638

Open
rbrunner7 opened this issue Jun 14, 2019 · 3 comments

Comments

@rbrunner7
Copy link

commented Jun 14, 2019

Over the last 3 months or so I added basic support for Monero to the OpenBazaar server and client. Basic means only direct payments from buyer to vendor - no offline payments, and no support for moderation. In this form it's fully working now as far as I can tell; I documented it with a few screenshots here where I sucessfully sold something using XMR. For some background info about the technical reasons for those limitations see my earlier analysis.

Following a recommendation of OB1 dev "mg" (@placer14) , before "going public" and make my work available e.g. for beta tests, I hereby submit it for review and assessment whether and how it can made suitable for inclusion in one of the next official OB1 OpenBazaar releases, and for deciding what the next steps on that way would be.

To see how it works, what it can do and what not, and how to set everything up using Monero software you can check this user documentation draft. I wrote it with some future public beta test in mind, and it does not assume prior knowledge about Monero.

The code is contained in branch Monero of a fork of the OpenBazaar server repository here on GitHub. So far everything is in a single commit titled Monero work-in-progress.

There is also a branch Monero in a fork of the OpenBazaar desktop client repository here on GitHub, also with a single commit, likewise titled Monero work-in-progress. The client only needs some quite punctual modifications to support XMR as new currency.

The core of the implementation is a new file within Multiwallet that can be found here. It implements OpenBazaar's Wallet interface for the new coin XMR / TXMR.

With only 800 lines it's quite short, and not very complex either. The reason: It's itself merely an interface to Monero's wallet software where the real functionality lies. It calls a monero-wallet-rpc server over RPC.

The Go bindings for that RPC are a separate package written by a third party that can be found here. It's part of the Monero Ecosystem project collection and probably on their way to become something like the "official" Go bindings for Monero RPC (although other implementations exist).

The base of those Monero commits for the OpenBazaar server and desktop client is the code exactly at release 0.13.2. Of course quite some rebasing is needed to make it compatible with current master code which you can easily see e.g. from the number of the config file migration with a number of 21, to add a wallet config section for XMR.

@placer14

This comment has been minimized.

Copy link
Member

commented Jun 26, 2019

@rbrunner7 This is good progress. I know it's been a bit since posting, but I wanted to share some thoughts before too much longer.

A few thoughts as a scan through the code changes:

  • I see an eventual XMR-specific wallet configuration option which allows the mainnet and testnet RCP IP:port to be defined.
  • We can make XMR wallet opt-in by setting the Type in the config to "OFF" which will prevent the wallet from being enabled unless manually changed.
  • Wallet interface needs better way to handle unsupported wallet calls to avoid the exposed panics.
  • On running XMR wallet via an external node/wallet: Given past experience with ZEC and seeing very few users who were willing to setup and run a zcash node to use the wallet, I expect this setup to have a similar outcome unless the setup were made to be simpler.
  • This is pretty straightforward and I appreciate the simple solution-based PR to start the conversation.

I think next steps on this are to:

  • use this on testnet with TXMR for a bit to validate that everything properly handles XMR-enabled listings and contracts.
  • ensure the changes don't negatively impact other nodes.
  • our team needs to do a more thorough review of the code and impact of what a "direct payments only" wallet does to the UX. (This will take some time for us to give the proper attention as we are focused on other tasks, ATM.)
  • find the least-friction path to XMR testing on mainnet. A part of this will also involve seeing usage and interest from the XMR community so getting something usable will need to be sorted.

Next steps also depend on how we thing we'll handle the following:

  • if it is possible to solve multisig transactions (generally, and then specifically for the cases OB already supports, to enumerate later)
  • if it is possible to solve offline transactions

Hope this offers some points to get the discussion rolling. (And thank you for contributing!)

@rbrunner7

This comment has been minimized.

Copy link
Author

commented Jun 28, 2019

Thanks for looking at my work and writing down these comments!

A few comments and some additional info:

On running XMR wallet via an external node/wallet: Given past experience with ZEC and seeing very few users who were willing to setup and run a zcash node to use the wallet, I expect this setup to have a similar outcome unless the setup were made to be simpler.

Before we look at this, let's avoid a possible misunderstanding: My solution does not require you run your own Monero node. You can use one of the many available so-called remote nodes. (This is quite symmetric to the support of the other coins in OpenBazaar.) It merely asks you to run the Monero wallet RPC server, which is a rather simple program with a few command-line switches and modest resource requirements.

So, I am well aware about the friction that running an external, separate XMR wallet introduces into the system. I would love to propose a fully integrated wallet solution, but I really found nothing viable to propose, even after evaluating the situation quite carefully.

As I already wrote in my analysis transacting with XMR is about a magnitude more complex than with Bitcoin and its offsprings: We are probably talking about something of the order of a few thousands of lines of code. There is no implementation yet in Go that offers itself as a starting point, and programming one could take months of effort.

And that would not be the end of it. An OpenBazaar server with thousands of highly specialized Monero code lines in it begs the question who will "babysit" that code: Monero relentlessly marches forward with half-yearly hardforks like clockwork that bring regular changes in transaction details with them (maybe in the meantime Monero is the coin with the most hardforks - at all). Who will guarantee that the OpenBazaar XMR support code will stay current?

Now, with that "interface to RPC wallet server" solution the code is so simple that somebody from OB1 would be able to take over if I stopped to support the Monero integration and nobody from the Monero community took over from me. I think that's a very important point.

@rodkeys

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2019

Even just an RPC wallet server implementation available could also provide an easy path for third party services to allow Monero payments. Zokos could support monero payments with an RPC wallet + I know there are a few separate teams building out services like web buying rn that could implement monero functionality on behalf of their users as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.