From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 262C4C3F for ; Thu, 9 May 2019 17:07:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.ruggedbytes.com (mail.ruggedbytes.com [88.99.30.248]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 91C09709 for ; Thu, 9 May 2019 17:07:58 +0000 (UTC) Received: from mail.ruggedbytes.com (localhost [127.0.0.1]) by mail.ruggedbytes.com (Postfix) with ESMTPS id AEE1A26003D2; Thu, 9 May 2019 17:07:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simplexum.com; s=mail; t=1557421676; bh=ev7NbdqFP7ZsbmqGgEaFqBk7ZZCMl6noQgJmqndcQZo=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=KH49amDGVPDPRDNKlidb4Qg4muaO3LxA5DgEYme6yqcToTID87ONHwRXX6KIoszu0 VzWkCMvbXSKKXufhwcnD6BKkTG3NHOMZOdQ9NqDxM16qSYu+kIRwg0iymBDFw99DBy s2xJxku8g2LOoOeLjTyuso7s0w5wAGh1Cv5Ikmto= Date: Thu, 9 May 2019 22:08:47 +0500 From: Dmitry Petukhov To: jan matejek via bitcoin-dev Message-ID: <20190509220847.11ff9c33@simplexum.com> In-Reply-To: <9e85b47c-6ba9-ab85-03f1-eb0ddf3022de@satoshilabs.com> References: <20190503132945.GR810@coinkite.com> <20190507184034.0a72a9c7@simplexum.com> <9e85b47c-6ba9-ab85-03f1-eb0ddf3022de@satoshilabs.com> Organization: simplexum.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Thu, 09 May 2019 17:31:21 +0000 Subject: Re: [bitcoin-dev] Adding xpub field to PSBT to make multisig more secure 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: Thu, 09 May 2019 17:07:59 -0000 > Therefore, the input==output check is sufficient: if I use the same > set of signers for an input and an output, I can be sure that the > change goes to the same multisig wallet. This is sufficient, in a simple case. I consider cases where spending from different wallets ('wallet compartments') can be aggregated into one transaction, for efficiency and convenience in certain circumstances. (ex: legacy addresses that cannot be abandoned due to users still sending to them, but managing them separately is inconvenient; wallet 'compartments' that each have different multisig policies and spending priorities, and change would go to most secure compartment used, etc.) This is most likely a 'borader problem', as you said, but this is just what my code already does, although with stateful signers that store trusted xpubs. I had an idea how to apply this to stateless hw wallets, and shared it. > > This would allow to distinguish the trusted output even if the > > inputs are not all derived from the same set of xpubs, that could > > happen in more complex scenarios (batching, key rotation, etc.), > > and can possibly be used to have several different types of > > 'trusted' outputs. > > This seems to be an attempt at a different, much broader problem. And > it won't help if the attacker can replay a different trusted-xpub > package (e.g., one that contains a revoked previously compromised > key). The auxiliary text can be constructed to include some code word that would mark 'epoch' of the package, and will be displayed prominently. Upon compromise, new trusted-xpub packages would use different 'epoch' code word. This is one method to make it stateless (stateful way would be to just have a counter inside hw wallet and check package version against it).