From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 419CFC016E for ; Sat, 6 Jun 2020 04:25:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 279F688420 for ; Sat, 6 Jun 2020 04:25:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pvVE2H1eqKvE for ; Sat, 6 Jun 2020 04:25:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-40140.protonmail.ch (mail-40140.protonmail.ch [185.70.40.140]) by whitealder.osuosl.org (Postfix) with ESMTPS id 34F9788418 for ; Sat, 6 Jun 2020 04:25:22 +0000 (UTC) Date: Sat, 06 Jun 2020 04:25:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1591417519; bh=fTbQCbXBVa+i9FuSXmZyiy5oEOoksJGHW7sHF0netfg=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=UdtoAqaqckTrwOsei8DYQVSrYp0O/XgaECE6ZIvHB7P7aSyxlFIyzko87YXuV5cfh VWsGhpapMbAH2SOVBJNtr2ouGj1J+JJgNVyrkhMVHVDt3omyYIeUck0A+eFyxeHkel tqmIGS4e5/nSzd5SoFk5GX9/LEP6lXk6pXz/biOU= To: ZmnSCPxj , Bitcoin Protocol Discussion From: ZmnSCPxj Reply-To: ZmnSCPxj Message-ID: In-Reply-To: References: <82d90d57-ad07-fc7d-4aca-2b227ac2068d@riseup.net> <5LiZqpFxklAAbGFiiAE3ijRbIteODXKcHrXvGJ-qabgQj5hG8beFtHNbVZ-XUxETVwduJYz94UYuJGAPxBrbGeZpSClUtXYsPJBABfr03KM=@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [bitcoin-dev] Design for a CoinSwap implementation for massively improving Bitcoin privacy and fungibility X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2020 04:25:24 -0000 Good morning a third time Chris, Now unrelated to the funding order, but one of the reasons why timeliness i= s desirable for CoinSwap is that if possible, we want to ensure that sends = from a user wallet are not correlatable with receives into that wallet. Thus, there is the strong suggestion that before sending to a payee, the us= er wallet should swap, then use the swapped funds to pay the payee, i.e. sw= ap-on-pay. JoinMarket does this in `sendpayment.py`, for example, and this is the reco= mmended way to perform payments out of the JoinMarket wallet. Let me propose an alternative: swap-on-receive+swap-on-change. ZeroLink already suggests that wallets maintain two internal wallets: a pre= -mix wallet and a post-mix wallet. With swap-on-receive, when the user wants a receive address, the wallet get= s it from the pre-mix wallet address. Then, when wallet notices any unspent funds on any pre-mix wallet address, = the wallet automatically swaps it into the post-mix wallet. This is swap-on-receive. Long-term HODLing goes into post-mix wallet addresses. Then, when sending, the wallet selects from the post-mix wallet coins, and = spends those coins directly into the payee address. If there is no exact amount, it has to have change. The change output does *not* go to the pre-mix or post-mix wallet address. Instead, it goes to a 2-of-2 funding outpoint for a new swap immediately. This lets the payee receive its funds quickly, as soon as the transaction c= onfirms, without waiting for the CoinSwap to complete. Of course, the user now has to be online to *fully* receive funds (the user= cannot spend the funds until it is in the post-mix wallet). Regards, ZmnSCPxj