summaryrefslogtreecommitdiff
path: root/c5/8af60db62097978a3de00e8565966b312f39ba
blob: 20732af81ae02e91ba22bdf04e58c7429dd1e995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
Return-Path: <bitcoin-dev@wuille.net>
Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 393CBC016F
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 11 May 2020 22:12:44 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by whitealder.osuosl.org (Postfix) with ESMTP id 2EBB288392
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 11 May 2020 22:12:44 +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 8DmdtgD0dyPp
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 11 May 2020 22:12:42 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from mail1.protonmail.ch (mail1.protonmail.ch [185.70.40.18])
 by whitealder.osuosl.org (Postfix) with ESMTPS id C2FE088337
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 11 May 2020 22:12:42 +0000 (UTC)
Date: Mon, 11 May 2020 22:12:33 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wuille.net;
 s=protonmail; t=1589235160;
 bh=bzyaghEMjwQRMDQ+x7faJaPuKeJHxWIyEmPupmnhVBQ=;
 h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From;
 b=oMcMZ58rWaZyFC7Mxf68nw851OSM9ZC3kFahu80BNAP/wbWJr68EydSvMHiB0Noze
 aIQjtwE29HOJeERG6ku/ii4sdNM4dqkhttsp4BSlHO/G6GrX+px1/OkWR66Q4pbTxT
 WBXpY6rE/eGvMTShqHBDgCTatT8jWDRIXk/Fw9fg=
To: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
From: Pieter Wuille <bitcoin-dev@wuille.net>
Reply-To: Pieter Wuille <bitcoin-dev@wuille.net>
Message-ID: <nBFUYhh-NT7PgBCGMWz2S41WT_NJqs7KTapXjwTCqXf8HrPAIEDm_zrpU_02RwO-eTEp5ocyWgkEtuYe7kvY2C7OTZi4ruL9xCXpga-a3BU=@wuille.net>
In-Reply-To: <1a8f1b92-e965-c1b3-b554-600541c8bac9@gmail.com>
References: <CACvH2e=3s2kZWnytMySTv8U4pny3i0rEWas7NxzLxf5J7BewTg@mail.gmail.com>
 <1a8f1b92-e965-c1b3-b554-600541c8bac9@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Mailman-Approved-At: Mon, 11 May 2020 22:51:22 +0000
Subject: Re: [bitcoin-dev] BIP-341: Committing to all scriptPubKeys in the
	signature message
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Mon, 11 May 2020 22:12:44 -0000

Hi all,

On Tuesday, May 5, 2020 3:20 AM, Jonas Nick via bitcoin-dev <bitcoin-dev@li=
sts.linuxfoundation.org> wrote:

> This is a reasonable suggestion. Committing to every spent scriptPubKey a=
nd
> therefore every element of the TxOut instead of just the amount makes sen=
se
> conceptually. And it would be a small diff (~4 lines + rationale) compare=
d to
> the current bip-taproot version.

I agree.

There have been several steps so far towards making it possible for signers=
 to determine whether they can safely sign with just O(1) information per i=
nput. This was initially attempted in BIP141 (by committing to spent input,=
 to thwart the ability to lie about fees to ofline signers), and is improve=
d in the current BIP341.

I think the CoinJoin + offline signer model indeed shows that is still inco=
mplete, as it is yet another example where a signer may need to be provided=
 with the entire creating transaction, which would be very unfortunate.

It's also counter to the model proposed by BIP147 (PSBT) workflows: the ass=
umption is effectively already that it is sufficient to provide signers wit=
h just amount + scriptPubKey of the spent outputs. It feels very natural th=
at signatures then indeed also need to commit to all that data; otherwise t=
here should be ways that this information can be undetectably wrong.

AJ's approach seems great. It means not increasing the per-signature hashin=
g, while retaining the ability to cache information across BIP141/BIP341.

As for coinbaseness and height: these are indeed also things currently kept=
 track of in the UTXO set, but I don't think any signer is using this infor=
mation to determine whether to sign or not (which I think is the minimum re=
quirement for it to be included in a signature hash, see above). Signing he=
ight would cripple the ability to spend unconfirmed outputs, or force signe=
rs to reveal they're doing so (if done through a separate sighash flag) - b=
oth of which would be undesirable. That leaves coinbaseness, but I think th=
e utility is very low.

The only downside is that this potentially slows down review, but I agree w=
ith earlier comments that it's hard to see how this would hurt. I also thin=
k it's important to get these things right from the start. Many things insi=
de BIP341/BIP342 are extensible with future softforks, but signature hashes=
 for key-path spends is not one of them (the set of potential signature has=
h semantics must be committed to directly by the output, so changing them r=
equires a new output type - which would be highly unfortunate for fungibili=
ty reasons).

Thus, unless there are objections, I'd like to go through with this and mak=
e the suggested changes.

Thoughts?

--
Pieter