Monero Integration into Bisq


I (rbrunner7, currently active as a Monero dev) became interested in Bisq and possible ways of integrating Monero into Bisq. I went on to investigate what such an integration would mean, how it would have to work technically, and how much work that would entail. Here I write down the results of my investigation plus a lot of links to info about Bisq in general, to further the understanding of the challenge at hand, and possibly to help anybody who ever intends to actually start working on this.

I don't claim that I understood every detail about Bisq and everything about possible ways and difficulties of integrating Monero there, but I think I know enough about all the involved technologies to be not completely wrong in my analysis.

Disclaimer: Many things I write here are clearly my personal opinions; yours may certainly differ.

What is Bisq

According to the statement on the project homepage: "Bisq is an open-source, peer-to-peer application that allows you to buy and sell cryptocurrencies in exchange for national currencies. No registration required."

Currently Bitcoin is always one part of the exchanged currencies. One cannot trade alternative cryptocurrencies for national currencies, only Bitcoins for alternative cryptocurrencies like Monero, or Bitcoins for fiat currencies.

It seems that currently buying and selling XMR with/for BTC dwarfs all other kinds of trades; see e.g. this Reddit thread from September 2018 where 98% percent of Bisq volume was XMR/BTC. Check here on CoinMarketCap for actual numbers.

There is a Monero Talk video on YouTube with Bisq's founder and lead dev Manfred Karrer showing how to trade XMR on Bisq and giving quite good background info about Bisq in general.

Technically it's a program that you run locally on your OS (versions are available for Windows, Linux and macOS) that will connect to other instances running at the same time on other computers, building a decentralized peer-to-peer network without servers.

From their Whitepaper, section "Technology": "The Bisq application is built in Java 8 with JavaFX for the GUI. For interaction with the Bitcoin network the bitcoinj library is used. For decentralized messaging and data storage a custom flooding (gossiping) network over Tor is used."

In short: It's Java all the way down.

Use of Tor and Bitcoin

Bisq communicates over the Tor network and does so seamlessly: Install Bisq, Tor communication components are automatically installed as well, start Bisq, use Tor. It seems that since version from November 2016 (see roadmap) all traffic goes over the Tor network, nothing over clearnet.

Bisq uses BTC as the currency for the trade (BTC currently is always on one side of the trade, see above), for paying security deposits (securing trades: cheaters will probably loose the deposit) and for paying fees. For handling those payments Bisq configures internal Bitcoin wallets for traders and makes Bitcoin transactions on their behalf. Like with Tor, this is all fully automatic and seamless, what may be a very big part of Bisq's user friendliness and popularity: Install Bisq, everything necessary to use BTC is automatically installed as well, start Bisq, use BTC.

Default is reaching out to .onion Bitcoin nodes over Tor, but you can also use the public Bitcoin network or your own local node. You can also use Bitcoin testnet.

Use of Multisig

Bisq works with 2/3 multisig bitcoin wallets and transactions: The buyer holds one key (or better their Bisq instance holds the key internally for them), the seller holds one key, and a third key is made available to an arbitrator registered with Bisq in the case of a dispute. Normal case is of course that the seller and the buyer use their two keys to transfer the BTC to trade to whomever shall receiving them to successfully conclude the trade.

Bisq users don't have to know or learn anything special to use that 2/3 multisig, they just need to be aware about what that means, i.e. that any two people out of the group (buyer, seller, arbitrator) can transfer BTC out of the 2/3 multisig wallet that Bisq configured for them behind the scenes in a fully automatic way, but of course not a single person alone.

The non-BTC side of the trade, i.e. the side that involves sending an amount of fiat currency or an amount of an "altcoin" from buyer to seller or vice-versa happens completely outside of Bisq. The seller and the buyer have to arrange that transfer themselves outside of Bisq and are more or less free how they actually transfer.

For example if I buy XMR for you for BTC through Bisq you will need access to a working Monero wallet under your control with the necessary amount of XMR to send them to, and of course I myself need a working Monero wallet to receive them.

Bitcoin Wallet

Fully apart from all the functions to trade BTC Bisq contains a simple but complete Bitcoin wallet. You can use it to manage Bitcoins that you own, just like with any other conventional Bitcoin wallet, whether you want to trade them or not. This wallet does not support multisig. Use of it is completely optional, but of course it's quite comfortable to fund your trades directly out of this wallet instead out of a separate one. You hold the keys to this wallet; Bisq itself never holds any funds.

Base Currencies

Bisq used to support other base currencies beside BTC. Base currency in this context means a cryptocurrency other than BTC taking on the role that BTC now has for trading, i.e. to trade that currency for other cryptocurrencies or for fiat currency, plus pay security deposits and fees in thas currency.

This of course included use of 2/3 multisig for the alternative base currency to secure trades and make arbitration possible. Any coin without support for multisig would not have been possible as Bisq base currency.

Beside BTC Bisq used to support Bitcoin Cash, Litecoin, DASH and Dogecoin as base currencies. It seems there was a dialog box at startup to choose the base currency to use for the current run.

This all is no more, primarely because liquidity for those in the role of base currencies was simply not there at the end. Read e.g. this GitHub issue from May 2018 when LTC removal was suggested, and check the roadmap for info which alternative base currency was dropped at which time.

So in any case, don't confuse base currencies with traded currencies: Of course you can still buy and sell all those mentioned currencies like Litecoin or DASH on Bisq, but you will have to buy them with BTC or sell them for BTC (where before as base currencies you could buy and sell them using any of the many supported currencies, given that someone was willing to trade.)

XMR as Base Currency

Given how strongly XMR dominates trading on Bisq (see chapter What is Bisq above) it's not suprising that there is considerable interest from the side of Bisq users for the fullest possible integration of Monero into Bisq, which would mean Monero as a base currency. See e.g. the reactions on this Reddit thread to this proposal on GitHub.

However, Manfred Karrer, Bisq founder and lead dev, says the following about this subject: "Adding XMR as base currency is a huge effort. I would estimate 3-6 months for a dev experienced with Bisq and Monero."

After having looked into this myself a bit, I am not suprised about this estimate in the least.

Take multisig: As already mentioned I see it as essential for Bisq that support for 2/3 multisig while trading is completely seamless and trivial to use for the traders. Monero multisig is considerably more complex than Bitcoin multisig, and it would take quite some effort to arrive there. (My own Multisig Messaging System would probably be of not much help, as the environment is quite different, and the UX approach as well.)

Take transacting in general: Now with Bitcoin you don't need to run any other program beside Bisq to transact because Bisq itself contains already everything necessary. That seems impossible with Monero; there are Java bindings to connect to a Monero wallet over RPC (check the "monero-java-rpc" project here), but no full Monero wallet implementation in Java that could become a part of Bisq (licensing issues aside).

So an instance of the monero-wallet-rpc binary running beside Bisq would be needed, and all you could do is making that as simple and painless as possible (which, of course, takes effort if done well). It's not clear to me whether it would be possible to keep another quality feature of Bisq, that all traffic runs over Tor, with this constellation.

And another little problem: As far as I know there are currently exactly zero "devs experienced with Bisq and Monero" on the level that is necessary for this demanding job. This alone could add one or even two months of learning and getting acquainted with everything on top of that "3-6 months" estimate.

Monero Wallet in Bisq

If you go one level down from base currency support you arrive at being able to manage your XMR right there in Bisq, without the need for another wallet, like it is now the case with Bitcoin (see chapter Bitcoin wallet).

Interestingly, the already-mentioned proposal on the Bisq GitHub that was so well received on Reddit talks "only" about that, as a (more attainable) first step: "Add Monero wallet features to Bisq".

Personally, I see this still as a quite substantial work, plus a job best suited for an experienced Java dev of course (which I, for one, am not). And I doubt somehow the "return on investment": For the traders it could be more comfortable alright, but maybe that big development effort would be better spent elsewhere, for more essential and less "nice to have" things.

Finally somehow I am quite unsure whether this would really be the breakthrough or at least advancement that people are hoping for.

The Future of Bisq

It seems that Bisq, or better the community of Bisq core devs, have decided to take Bisq into a new direction that leads away from Bitcoin as base currency mid-term or long-term, and also away from any other base currencies like XMR.

The final goal seems to be to re-build Bisq around the Bisq Token (symbol BSQ), Bisq's very own cryptocurrency if you like. It has (or will learn) features that make it especially suitable to orchestrate trading and arbitration on Bisq.

You find much more about this in the "Phase Zero" document and in more specific ways in this GitHub issue titled "Off chain trade protocol".

Read also lead dev Manfred Karrer's first sentence here (emphasis mine): "Adding Monero wallet support to Bisq would be a feasible first step and will be still a valuable feature if we move one day to the off-chain trade protocol ("

I confess that I did not read fully through all this and much less understand it all, and things may be still in flux anyway, but I got the impression that the general direction where Bisq is headed does indeed lead away from base currencies like Bitcoin, or Monero at that.

If this analysis is correct this makes a huge "Monero as Bisq base currency" project even more problematic. As I see it, you really don't want to work against the long-term evolution strategy of a project, at least not while spending so much effort.