Skip to content

ETH-XMR Atomic Swap continued development for 4 months

noot requested to merge noot/ccs-proposals:noot/add-proposal into master

ETH-XMR Atomic Swap continued development for 4 months

Summary

This proposal is for the continued development of ETH-XMR atomic swaps. The scope of this proposal includes usability and privacy enhancements, as well as codebase maintenance and bugfixes.

Team

noot (github.com/noot) will be completing this proposal.

Motivation

Atomic swaps are a method for trustlessly exchanging funds across blockchains. An ETH-XMR atomic swap will allow for users to, in a trustless and completely decentralized manner, exchange Ether for Monero. This connects the leading smart contract blockchain (and the home of DeFi) with the leading privacy-preserving blockchain. Along with the BTC-XMR atomic swaps, this will allow for completely decentralized cross-chain exchanges to be built that allow for XMR swaps.

Previous work

In my previous CCS, I completed an implemenetation of the ETH-XMR atomic swap, deployed it to stagenet on 9 different servers, and extensively tested it. There is now an alpha release of ETH-XMR atomic swaps with the following functionality:

  • swapd program which executes atomic swaps; includes:
    • network layer which allows for peers to make offers and discover and take offers
    • RPC server which allows users to interact with the daemon (eg. make/take offers, get current swaps, cancel swaps)
    • protocol implementation of the atomic swap including all refund paths
  • swapcli program which implements a CLI for users to interact with the daemon and easily make/take offers
  • swaprecover program which allows for funds to be recovered in case of a crash
  • ui: a self-hosted UI for the swap that displays current offers on the network and allows users to take offers using their MetaMask wallet.

Proposed work

I would like to continue work on the ETH-XMR atomic swap implementation by adding improvements for usability and privacy, as well as general codebase maintainence.

This proposal includes the following development work:

1. Relayer support

The current implementation of the protocol requires the ETH-recipient to have some ETH in their claiming account to pay for the transaction fees to claim the swap ETH. However, this is bad for UX and privacy, as users cannot withdraw to fresh ETH accounts.

To allow for users to claim ETH into a fresh account, integration with a relayer service can be implemented. This will allow users to withdraw to a fresh account by paying a small fee to a relayer to submit the transaction on their behalf.

2. Tornado cash integration

On the ETH side of the swap, there is no privacy, and which accounts and amounts participating in the swap are visible. To improve privacy, the swap contract can have its funds stored in a shielded pool such as Tornado Cash Nova, which allows shielded transfers. However, this is dependent on whether it's possible to build applications on top of Tornado Cash Nova.

3. ERC20 support

To support swaps for ERC20s without hurting liquidity, the swap contract can be integrated with a DEX such as Uniswap to automatically swap received ETH for the desired ERC20 token.

4. Disk permanence

The current implementation of the swap does not store anything to disk apart from information needed for recovery of swap funds in case of failure. However, there are other components that should be stored to disk and restored upon reload, such as current swap offers made, historic swap information, and peer information. This will require a simple key-value database implementation.

5. General maintainence and bugfixes

See here for open issues on the repo. Issues not covered by the above work are part of this section. This includes RPC calls and documentation, codebase maintainence, testing, and fixes of any bugs found during testing.

Pricing

The previous CCS was milestone-based, which I priced at a hourly rate of around $60 USD assuming I would work around 15 hours a week on average, for around 4 months. However, I ended up working more than that (took around 6 months). For this proposal, I would prefer to do a monthly payout instead of milestone-based and I will provide at minimum monthly updates in terms of CCS comments and Reddit posts. I also slightly raised the hourly rate to match my personal rate as well as address crypto price volatility.

Development costs: $70 USD per hour x 20 hours per week x 16 weeks = $22400 Server costs (10 DigitalOcean nodes): $267 USD per month x 4 months = $1068

At $145 USD / XMR = 162 XMR total

Expiration

This proposal expires on September 18 2022.

Merge request reports

Loading