Swap service is an orderbook for performing submarine swaps over nostr and a way for bitcoin users to earn yield on their bitcoin
Submarine swaps are an important feature of the lightning network. They allow lightning users to swap funds on lightning for funds on the base layer, or vice versa, without needing to open and close channels, and without needing to give custody of their money to other people. They also allow easier channel rebalancing and they are also the basis for important wallets and services like muun, lightning loop, and boltz exchange.
However, there are not very many submarine swap providers. Sometimes I wonder if the ones who exist are overcharging, and I also just think it would be cool if anyone could profit by offering submarine swaps easily from their own lightning node. With lots of participants, costs may be driven down close to zero.
Swap service tries to be an easy tool for anyone to do that.
reply
Yep. Projects of this kind could also become sort of giant mixers, allowing anons to swap coins or to directly pay in a really private way if the liquidity is enough and not to concentrated.
Do you plan to make it more pleb friendly one day ? Like kind of an Umbrel app for anyone to be able to easily connect to their own LN node and quickly add liquidity ?
And other question, does it work both ways reverse submarine swaps and submarine swaps as well, or just LN-->on-chain ? I think their may be a trust issue for on-chain -->LN swaps but I'm not sure.
Thanks !
reply
Yep. Projects of this kind could also become sort of giant mixers
Yes I'd love to see a privacy focused version someday. If you use musig-based submarine swaps instead of segwit-based htlcs then the cooperative case looks like a regular bitcoin transaction, except the two parties swap their utxos. Which is awesome for privacy.
Do you plan to make it more pleb friendly one day ? Like kind of an Umbrel app for anyone to be able to easily connect to their own LN node and quickly add liquidity ?
I don't personally plan to submit it as an umbrel app but it's public domain software. If it grows in popularity I expect that someone will make an umbrel app for it, which I would love to see.
other question, does it work both ways reverse submarine swaps and submarine swaps as well, or just LN-->on-chain ?
This is an interesting question. Technically it works both ways because every submarine swap from Alice's perspective is a reverse submarine swap from Bob's perspective. In other words, if you want to buy sats on the base layer, use the website, and if you want to sell sats on the base layer, run the software. Technically that means it supports both.
But I definitely want to update it so that people who run the software can also post offers to buy sats on the base layer and pay a lightning invoice in return. Then I can make a clone of muun wallet but based on a distributed network of coordinators (i.e. everyone running this software) rather than relying on a single company to do all the swaps.
reply
this is amazing and something I was imagining would be cool to build. You went and did it. LL just shit their pants because this is basically a better and end-to-end open-source and decentralized Loop!
reply
every post you make is a banger lol you earned 6119 sats on average per post
reply
Cool idea. I'm trying to accept an offer. After setting amount and bitcoin adress, nothing :/
reply
Yeah a zero day exploit was discovered by Boltz Exchange so I borked the code til I fix it, which will hopefully be a matter of minutes (it's a very small bug, I neglected to validate the size of the lightning preimage, which means you can submit an invalid one and the service provider will treat it as valid -- but checking the size should be a very simple code change)
reply
Ok I fixed it, please let me know if you experience any lingering issues
reply
Great demo! Cool project. Cant wait to check it out
reply
My maker is up!
Minimum amount: 5,700 sats Maximum amount: 256,000 sats Fee: 5%
reply
Great concept, I am sure it will see a lot of use!
What I find most tricky is managing the onchain fee. Using the minimal fee is good for the Maker, but not suitable for the Taker. As required by the submarine swap model there are two transactions:
  • first the Maker deposits to the swap address - this can be a minimal fee transaction, but needs to be CPFP-d by the next.
  • then the Taker sweeps - using the minimal fee here as well results in transactions stuck for days in the mempool in the current environment. Even if there would be choice (which should be!) the sweep transaction needs to account for the deposit as well so even trying the next block fee might not be enough. For example a deposit could be a large, consolidating transaction which would have a much larger weight than the 1in-1out sweep txn. Prediction is difficult since all the fees need to be agreed beforehand.
For now there should be a warning to only swap to an own address and not use the platform to pay directly to a third party as the sweep transaction might need CPFP itself.
(also a bug report for the testnet page - querying the testnet mempool api returns a CORS error)
reply
Proposing to use the mempool.space hourFee aka Low Priority instead of the minimumFee which results in funds in swaps being stuck for days: https://github.com/supertestnet/swap-service/pull/1
reply
bug report for the testnet page - querying the testnet mempool api returns a CORS error
Check if you have something like ublock origin running. For me, it did that til I turned off ublock origin.
Using the minimal fee is good for the Maker, but not suitable for the Taker
I reviewed and merged your pull request. Thank you for contributing!
reply
I reviewed and merged your pull request. Thank you for contributing!
back at you, thank you for building this and iterating fast!
Check if you have something like ublock origin running. For me, it did that til I turned off ublock origin.
I definitely have adblockers running. Will try again once bootstrapped a testnet node. On that note testnet channels would be welcome to: 0340a5fc39195696d42e4f43cc01f8c6726a0ef2c4b25e836352437e32d121b97c@rcl5jtbxbqqo5ttygooi53dyk7h33r4j5somy7xulkgosoytgjwa7kad.onion:9735
reply
It's an awewsome project. I'll definitely try it.
I bet @darthcoin will like it?
reply
Can anyone really say @darthcoin really likes anything?
reply
Bitcoin and freedom. Is not that so clear? Anything else is wasting time.
reply
This is fucking awesome.
reply
Looks impressive and is much needed going forward, looks hassle free, looking forward to learning more
reply