bitcoin-dev

Design for a CoinSwap implementation for massively improving Bitcoin privacy and fungibility

Design for a CoinSwap implementation for massively improving Bitcoin privacy and fungibility

Original Postby ZmnSCPxj

Posted on: June 6, 2020 04:25 UTC

In a message to Chris, ZmnSCPxj discusses the importance of timeliness for CoinSwap transactions.

They suggest using swap-on-pay, where users swap funds before sending them to payees, to prevent sends from being correlated with receives into user wallets. However, ZmnSCPxj proposes an alternative approach called swap-on-receive+swap-on-change. This method involves maintaining two internal wallets - a pre-mix wallet and a post-mix wallet - as suggested by ZeroLink. With swap-on-receive, when a user requests a receive address, the wallet gets it from the pre-mix wallet address. Any unspent funds on pre-mix wallet addresses are automatically swapped into post-mix wallets. When sending funds, the wallet selects coins from post-mix wallets and spends them directly into the payee address. Change outputs do not go to pre-mix or post-mix wallet addresses, but instead go to a 2-of-2 funding outpoint for a new swap immediately. This allows the payee to receive funds quickly without waiting for CoinSwap to complete. However, users must be online to fully receive funds and cannot spend them until they are in the post-mix wallet.