Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id C2DB5AEF for ; Mon, 21 Oct 2019 00:07:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from newmail.dtrt.org (li1228-87.members.linode.com [45.79.129.87]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 49C5F14D for ; Mon, 21 Oct 2019 00:07:32 +0000 (UTC) Received: from harding by newmail.dtrt.org with local (Exim 4.92) (envelope-from ) id 1iMLER-0008Il-4s; Sun, 20 Oct 2019 20:07:31 -0400 Date: Sun, 20 Oct 2019 14:06:08 -1000 From: "David A. Harding" To: SomberNight , Bitcoin Protocol Discussion Message-ID: <20191021000608.ajvzjxh6phtuhydp@ganymede> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: Re: [bitcoin-dev] Draft BIP for SNICKER X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2019 00:07:32 -0000 On Sun, Oct 20, 2019 at 12:29:25AM +0000, SomberNight via bitcoin-dev wrote: > waxwing, ThomasV, and I recently had a discussion about implementing > SNICKER in Electrum; specifically the "Receiver" role. That'd be awesome! > As the referenced section [0] explains, the "Receiver" can restore > from seed, and assuming he knows he needs to do extra scanning steps > (e.g. via a seed version that signals SNICKER support), he can find > and regain access to his SNICKER outputs. However, to calculate `c` he > needs access to his private keys, as it is the ECDH of one of the > Receiver's pubkeys and one of the Proposer's pubkeys. > > This means the proposed scheme is fundamentally incompatible with > watch-only wallets. > > [0] https://gist.github.com/AdamISZ/2c13fb5819bd469ca318156e2cf25d79#Storage_of_Keys Your logic seems correct for the watching half of the wallet, but I think it's ok to consider requiring interaction with the cold wallet. Let's look at the recovery procedure from the SNICKER documentation that you kindly cited: 1. Derive all regular addresses normally (doable watch-only for wallets using public BIP32 derivation) 2. Find all transactions spending an output for each of those addresses. Determine whether the spend looks like a SNICKER coinjoin (e.g. "two equal-[value] outputs"). (doable watch-only) 3. "For each of those transactions, check, for each of the two equal sized outputs, whether one destination address can be regenerated from by taking c found in the method described above" (not doable watch only; requires private keys) I'd expect the set of candidate transactions produced in step #2 to be pretty small and probably with no false positives for users not participating in SNICKER coinjoins or doing lots of payment batching. That means, if any SNICKER candidates were found by a watch-only wallet, they could be compactly bundled up and the user could be encouraged to copy them to the corresponding cold wallet using the same means used for PSBTs (e.g. USB drive, QR codes, etc). You wouldn't even need the whole transactions, just the BIP32 index of the user's key, the pubkey of the suspected proposer, and a checksum of the resultant address. The cold wallet could then perform step #3 using its private keys and return a file/QRcode/whatever to the hot wallet telling it any shared secrets it found. This process may need to be repeated several times if an output created by one SNICKER round is spent in a subsequent SNICKER round. This can be addressed by simply refusing to participate in chains of SNICKER transactions or by refusing to participant in chains of SNICKERs more than n long (requring a maximum n rounds of recovery). It could also be addressed by the watching-only wallet looking ahead at the block chain a bit in order to grab SNICKER-like child and grandchild transactions of our SNICKER candidates and sending them also to the cold wallet for attempted shared secret recovery. The SNICKER recovery process is, of course, only required for wallet recovery and not normal wallet use, so I don't think a small amount of round-trip communication between the hot wallet and the cold wallet is too much to ask---especially since anyone using SNICKER with a watching-only wallet must be regularly interacting with their cold wallet anyway to sign the coinjoins. -Dave