XMR BTC Atomic Swaps Desktop GUI - Continued development
layout: fr
title: "XMR BTC Atomic Swaps Desktop GUI - Continued development for 4 months"
author: binarybaron
date: 26 May, 2022
amount: 232
milestones:
- name: June
funds: 58
done:
status: unfinished
- name: July
funds: 58
done:
status: unfinished
- name: August
funds: 58
done:
status: unfinished
- name: September
funds: 58
done:
status: unfinished
payouts:
- date:
amount:
- date:
amount:
- date:
amount:
- date:
amount:
We've successfully completed all of the goals we set for ourselves in our first CCS proposal. The prototype of the GUI we wanted to develop is fully functional (on testnet) and it will soon replace the now obsolete web interface (UnstoppableSwap.net). Based on the community response to both of our status updates (reddit post 1, reddit post 2), we felt that there is a strong desire in the community for us to continue development.
Over the course of 7 months we have:
- Made over 175 commits to the UnstoppableSwap GUI repository and developed an initial working prototype.
- I’ve become one of the three unpaid volunteers maintaining the xmr-btc-swap repository after the comit guys (original developers who developed the first MVP) have moved on to other projects. I’ve submitted and merged 12 Pull Requests over the last months and reviewed some more.
Proposal:
We are excited to keep working on Atomic Swaps. There are still loads of things needed to make it accessible and easy to use for everyone. Therefore we'd like to continue spending our time working on the FOSS GUI for BTC<>XMR Atomic Swaps. It is being built around the swap-cli and will empower even non-technical people to swap their BTC for XMR in a safe, decentralized and trustless manner. We are asking for 232 XMR for continued development for 4 months. At the end of each month 37 XMR will be paid out. We will work approximately 25 hours per week for 4 months straight which amounts to 400 hours of labour. Our hourly rate is 66 USD which amounts to 232 XMR at a current price of 112 XMR/USD
Who:
I am binarybaron, the creator of UnstoppableSwap.net and Monero enthusiast. I was excited about Atomic Swaps from the very beginning, tested the first versions (MVP developed by COMIT guys) and contributed to the project early on. When the first testnet swap provider came online, I realized that we would need a better user interface and a platform to compare different swap providers. I decided to start building UnstoppableSwap.net. To my surprise, the interest was much greater than I could have ever predicted. In the first week alone, the website was visited more than 150,000 times. Once I realized that a website was not enough due to the technical requirements, I started working on a desktop app. Soon after, I submitted my first CCS, which was quickly funded, and developed the first working prototype of the desktop user interface.
What:
- Development of the graphical user interface (GUI)
- Auto Update. For this to work we’ll need to code sign the releases on Mac OS using a paid certificate. The GUI will download and install the new version on startup if a new release is available.
-
Educate users on the rules of the swap protocol. There are some simple but important rules all users need to follow to avoid loosing funds. Most importantly the functionality of the cancel and refund timelocks must be understood. If users are not fully aware on how to act in certain scenarios, they risk loosing funds. We’re not yet sure how to proceed on this. Some ideas are outlined below:
- Quiz at first start-up to make sure the user understands what rules he needs to follow
- Refer to official documentation of the swap-cli and the GUI
- Refer to blog posts, videos and other online resources by the community
- Allow manual cancel & refund of swaps. Although the swap-cli should refund swaps automatically in most cases, there are some edge cases where the user is required to cancel & refund manually. This is currently not possible in the GUI. Enabling the user to easily do this in the GUI is a must.
- Unit and Integration tests. Although the GUI is relatively stable, it has pretty low test coverage. We need to create a lot more unit and possibly integration tests to cover all edge cases. Especially critical code like the internal finite state machine needs extensive test coverage.
- New Icon. The current icon was only meant to be a placeholder and wasn’t intended to be final. We’ll either commision someone to make a new one or ask the community for input.
-
Performance improvements. We need to investigate what the performance bottlenecks of the GUI are. The most obvious ones at the moment are:
- Inefficient SQL queries being used for querying the swap database
- Overly-cautious file reads of the swap database
- Unnecessary re-renders of React components
- Blocking code being run in the main thread leading to freezing of the whole application
- General improvement of the GUI. Fixing bugs, responding to issues, writing documentation and implementing new features as they come to mind.
- Switch the GUI from Testnet to Mainnet. The GUI is currently Testnet only. Once we feel it is stable enough overall we’ll switch it over to Mainnet.
- Development and maintenance of the API that enables clients to easily discover swap providers. A swap provider is a peer you can connect with to exchange your BTC for XMR. ****Our API indexes them and provides additional data such as their uptime and their age. This API is publicly accessible and can be used by other services (e.g orangefren.com). We provide an HTTP(s) and a WebSocket (socket.io) endpoint which will be documented on UnstoppableSwap.net.
- Development and maintenance of the UnstoppableSwap.net site. It was the first initial prototype for a user interface for Atomic Swaps. It used to be a very stripped down version of the GUI and allowed users to more easily initiate a swap using the swap-cli by displaying them with a command they could copy and paste. This was not ideal, as it gave the impression of being user-friendly, but could be quite confusing and risky to use. The site will be converted into a simple download page for the GUI (similar to bisq.network)
-
Maintenance of rendezvous point. There are currently three major ways for users to discover swap providers (peers they can swap their Bitcoin for Monero with). This proposal also includes the maintenance of the rendezvous point we run.
- Word-of-mouth: The community can share the address of swap providers online (e.g on Reddit, IRC, Matrix..)
- Centralized peer discovery via UnstoppableSwap API: We actively maintain a database of swap providers which can be used by anyone to retrieve a list of swap providers
- Rendezvous point: The rendezvous protocol is a lightweight mechanism for generalized peer discovery. It allows for the discovery of peers in a decentralized fashion. We operate a community rendezvous point through which swap providers can make themselves known to users, and through which users can find swap providers with whom they want to swap.(
/dns4/discover.unstoppableswap.net/tcp/8888/p2p/12D3KooWA6cnqJpVnreBVnoro8midDL9Lpzmg8oJPoAGi7YYaamE
)
-
Reviewing, merging and possibly submitting Pull Requests to the xmr-btc-swap repository.
- This proposal is mainly for continued development of the GUI and not for maintenance of the xmr-btc-swap project. Time spent on the repository will at most be 5% of the total time spent on this proposal.
- Most of the Pull Requests we’ll submit will be related to making the swap-cli compatible with the GUI
If funded we'll provide monthly updates in the CCS comment section.
Merge request reports
Activity
I doubt there is even a discussion on whether this should get moved to funding or not.
Im 100% for this proposal, we absolutely need a userfriendly atomic swap gui and @binarybaron2 has put in great work so far.
To address some of the comments on Matrix:
-
I don't think it's a big problem that the COMIT folks aren't actively maintaining the xmr-btc-swap repository at this time. The project is pretty stable and fully functional overall, plus myself and two other people have write access to the repository and regularly fix bugs that require immediate action. We are also in close contact with the guys at COMIT who help us maintain the project. I don't currently plan to move the backend to farcaster, as they are far from being done and there is a working implementation that can be used right now. However, if it turns out in the future that their implementation is superior, I will be happy to switch the GUI to it.
-
We will work approximately 25 hours per week for 4 months straight which amounts to 400 hours of labour. Our hourly rate is 66 USD which amounts to 148 XMR at an moving average over the last 20 days of 178 USD/XMR (https://www.barchart.com/crypto/quotes/%5EXMRUSD/technical-analysis)
-
Perhaps it's obvious to you, perhaps not, depending on how much experience in OOD you've got, but since you're already almost sure, that switching the backend is in the cards, I'd ask to prepare a thin wrapping layer across these two backends, so that in case there's either:
- 3rd or nth backend available, the Userbase would have it easier to switch to the preferred backend after just a few modifications, ideally via json or XML config file
- a switch back to the previous backend is required (for whatever reason)
I have a lot of experience in deployments like the one I propose. If you feel like you need to book me for consultancy or even coding on this one, feel free to express it here. I still have a month worth of unused budget from my running CCS Proposal. "No, thanks" is also a valid answer.
Edited by mjThanks for the suggestion, but I don't think it's as simple as it may seem from the outside. There is really no standardized protocol used by all implementations. They are not compatible at all. Neither at the cryptography level nor at the network level.
The GUI also does much more than just connect to an API and display its information. It reads the internal database and the logs of the "swap-cli" (JSON) and does a lot of parsing to extract all the necessary information. Developing a wrapping layer without knowing what the final architecture/data structure of farcaster will look like seems very complicated and a bit needless at this stage.
If farcaster turns out to be far superior, I will switch to them. But for now it's out of scope for this proposal.
added 1 commit
- 774b7b72 - Update unstoppableswap-gui-2.md to reflect XMR/USD exchange rate changes
Thanks for the suggestion, but I don't think it's as simple as it may seem from the outside. There is really no standardized protocol used by all implementations. They are not compatible at all. Neither at the cryptography level nor at the network level.
I understand that everything looks simpler from the outside. I also know that my design request is actually a request for an additional investment up-front, that you might not have included in your budget, and it would yield only later, after the current proposal is even finalized.
So in that case, I'd simply ask to separate as much additional logic as possible from anything that has to do with a given backend as well as the current GUI. And it's not even a suggestion, but merely a request.
@binarybaron2 can you update the description with the new amount and also give more details regarding proposed hours?
Done
Edited by binarybaron
added 1 commit
- 59d8fbc8 - Update unstoppableswap-gui-2.md to include correct amounts and clarify hour to be worked
mentioned in commit ef4f02bb
Milestone 1 (1 month development time).
Despite the "July" label of the first milestone, it was to be paid after one month after the proposal was fully funded. Responding to comments on the initial proposal and submitting the proposal took a little longer than expected.
During the last month, I have been working on the following tasks:
-
Development of the GUI: I have focused mainly on the detection of the expiration of timelocks and the manual cancellation and refund mechanism. The user is now able to attempt a manual cancel and refund within the GUI if the swap is not automatically refunded by
swap-cli
.- All work related to manual cancellation and refund was done on the manual-cancel-refund branch. It has not been merged yet because I plan to fix the 1020 and 683 issues first.
- The user is now presented with a QR code for the deposit address. Corresponding transfer
- A warning has been added to the debug page to alert the user that the private keys displayed there may result in a loss of funds if given to a third party. Corresponding Handover
- Updated the version of the bundled Tor binary to
11.5.1
. Corresponding commit
-
Maintaining the
xmr-btc-swap
repository: Theswap-cli
, which serves as the backend for the GUI and handles almost all networking and cryptography tasks required to perform a swap.- Coordinated with the other maintainers on how to proceed. What things to focus on and when to release the next version.
- Have a bounty out for the first person to submit a PR that adds the functionality to
swap-cli
to show network charges before the swap is actually started (Issue 761). I later checked the corresponding PR and it was merged - I started working on Issue 683, whose goal is to make the cancellation and refund mechanism more stable. It analyzes the error of the Electrum server when it is not able to publish the cancellation or refund transaction and gives feedback to the user.
-
Maintenance of the API: The official API, which indexes swap providers and provides additional data such as their uptime and age, had an uptime of 100% last month. We had no downtime. Status page
-
Rendezvous Point Maintenance: We operate a community rendezvous point through which swap providers can make themselves known to users, and through which users can find swap providers with whom they want to swap. The rendezvouzs point had an uptime of
100%
last month. Status page -
Maintenance of the front end: This was a very stripped down version of the GUI that allowed users to initiate a swap with the swap-cli by displaying a command that they could copy and paste. This was not ideal, as it gave the impression of being user-friendly, but could be quite confusing and risky to use. Therefore, the website can currently only be used as an alternate way to discover swap providers. There has been no downtime in the past month. Status page
-
Frontend development: I have started to turn the unstoppableswap.net website from a dynamic interface to a download page for the desktop GUI. Related branch. Click here for a demo in progress.
-