summaryrefslogtreecommitdiff
path: root/9f/6c20582e64215f6f64dd2dbf3aafce18679dff
blob: eaf631131a0d07ff0e4361ddf21ab084952ebfa3 (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
Return-Path: <alp.bitcoin@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 8F564B4A
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Mon,  8 May 2017 23:47:34 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-pf0-f178.google.com (mail-pf0-f178.google.com
	[209.85.192.178])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B5CA5E5
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Mon,  8 May 2017 23:47:33 +0000 (UTC)
Received: by mail-pf0-f178.google.com with SMTP id v14so40284256pfd.2
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Mon, 08 May 2017 16:47:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; 
	bh=q4Bd+gQOc8XOJFl83TCYNYsAMH4T0Egp+q/HhZTgTDE=;
	b=p4JQFprS/4tXhZRGbrcwvLSYOt2Ym7GkweVlmQrf2fjWKQSg99EbTqSRLWBDNeyPtp
	exIyKV2GZhMFXbq3sCVOnqCzmiq8v32l9sAg7M4Zig44L3jNXPu9CDCEvKrsFf/oNcla
	ioxo1rciWprHniZjmIoAAYVall1nNY1Sam9kBH0SN7H6L6nBcU/r9G5MOkv3FgFhv/1V
	xEp5+kKFKVOn8wGvJwNs5a6VsGVh0nHvC7tSba46Y0cSTFFkA9M6JuD3m8CpbpsyynjO
	IbqtF5n5GORTHdYqnncd3PHWBtlP503Fuz6V6Ds5+j6JgloZuYpGHfv6M3FYjo0DI13d
	zCnQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:cc;
	bh=q4Bd+gQOc8XOJFl83TCYNYsAMH4T0Egp+q/HhZTgTDE=;
	b=Lu7EEIxsZQU/2V/OxMkTF2/hIX5syH/O1ABECF1z5v0Rj9rQKjyOUmiwQoeYyvnUc6
	bzZGbvTuSDe6DmFD/AkyfiCDeuJOZciUkxAXtM2HtE5whcQxeP4Lmu15qx+Gws57W1aZ
	gyR44LpcklLkaE+n1U1pVcgQvM7oAmAGTLIDDeJt9Zwup9bSsM6tJCaUqxMDatIoCEQ9
	EriBZZQS7ThWdEAbKKoe+zLsFL8FQGQWPkqgO37X5oV3ioOge87pu36UikXytn+Ec7Rk
	/8lFD+PTCWEwLK/MWXHVPoirVoLb36QO6wjm2yJ4WOXipj+y0KDmC6Y6aqRFEH4BIzQJ
	DBVw==
X-Gm-Message-State: AN3rC/6L0EuAZ9ZIaY1ywEIjUs+e52xym+pvzhoWx+88Rl67vg7rs2OD
	yxaID1HIrAB8KiNrMZGSP/svgX1KfIe0
X-Received: by 10.99.149.8 with SMTP id p8mr21452626pgd.154.1494287253169;
	Mon, 08 May 2017 16:47:33 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.100.138.143 with HTTP; Mon, 8 May 2017 16:47:32 -0700 (PDT)
In-Reply-To: <CAKzdR-qojNn8OtUTPbxa0JauK9nmo2ZGm4ihKuyzsz_FAgokDw@mail.gmail.com>
References: <CAKzdR-qojNn8OtUTPbxa0JauK9nmo2ZGm4ihKuyzsz_FAgokDw@mail.gmail.com>
From: Alphonse Pace <alp.bitcoin@gmail.com>
Date: Mon, 8 May 2017 18:47:32 -0500
Message-ID: <CAMBsKS_j7Lso6fHoMPkrQ7UFwKfxOERAAqL=aUF83O4CqL+iFg@mail.gmail.com>
Cc: bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary=94eb2c1b49b6eae949054f0bdcbe
X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MISSING_HEADERS,
	RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
X-Mailman-Approved-At: Tue, 09 May 2017 01:26:16 +0000
Subject: Re: [bitcoin-dev] Some real-world results about the current Segwit
	Discount
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
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, 08 May 2017 23:47:34 -0000

--94eb2c1b49b6eae949054f0bdcbe
Content-Type: text/plain; charset=UTF-8

Sergio,

I'm not sure what the data you present has to do with the discount.  A 75%
discount prevents witness spam precisely because it is 75%, nothing more.
The current usage simply gives a guideline on how much capacity is gained
through a particular discount.  With the data you show, it would imply that
those blocks, with SegWit used where possible, would result in blocks of
~1.8MB.



On Mon, May 8, 2017 at 5:42 PM, Sergio Demian Lerner via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:

> I have processed 1000 blocks starting from Block #461653.
>
> I computed several metrics, including the supposed size of witness data
> and non-witness data (onchain), assuming all P2SH inputs/outputs are
> converted to P2PWSH and all P2PKH inputs/outputs are converted to P2WPKH.
>
> This takes into account that other types of transactions will not be
> modified by Segwit (e.g. OP_RETURN outputs, or P2PK). This analysis doesn't
> take into account that LN transactions may affect the current state,
>  increasing the segwit/nosegwit ratio.
>
> Among a lot of information, I've got the following real world results...
>
> acMainChainSpace =352608924
> acSegwitSpace =599400403
> Ratio segwit/nosegwit=1.6999
>
> This implies that the 75% that discount is not the best option to prevent
> witness spam in a block of 4 MB, as stated in https://segwit.org/why-a-
> discount-factor-of-4-why-not-2-or-8-bbcebe91721e.
>
> The non-witness data weight factor should not be 4 but 2.35. The closest
> integer value is 2, which leads to a 50% witness discount.
>
> The Bitcoinj source code is available for anyone to review. I encourage
> anyone to re-compute this with another utility to cross-check. Maybe
> Antoine Le Calvez (p2sh.info) would like to double-check.
>
>
>
>
>
>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
>

--94eb2c1b49b6eae949054f0bdcbe
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Sergio,<div><br></div><div>I&#39;m not sure what the data =
you present has to do with the discount.=C2=A0 A 75% discount prevents witn=
ess spam precisely because it is 75%, nothing more.=C2=A0 The current usage=
 simply gives a guideline on how much capacity is gained through a particul=
ar discount.=C2=A0 With the data you show, it would imply that those blocks=
, with SegWit used where possible, would result in blocks of ~1.8MB.</div><=
div><br></div><div><br></div></div><div class=3D"gmail_extra"><br><div clas=
s=3D"gmail_quote">On Mon, May 8, 2017 at 5:42 PM, Sergio Demian Lerner via =
bitcoin-dev <span dir=3D"ltr">&lt;<a href=3D"mailto:bitcoin-dev@lists.linux=
foundation.org" target=3D"_blank">bitcoin-dev@lists.linuxfoundation.org</a>=
&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0=
 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">I hav=
e processed 1000 blocks starting from=C2=A0Block #461653.<div><br></div><di=
v>I computed several metrics, including the supposed size of witness data a=
nd non-witness data (onchain), assuming all P2SH inputs/outputs are convert=
ed to P2PWSH and all P2PKH inputs/outputs=C2=A0are converted to P2WPKH.</di=
v><div><br></div><div>This takes into account that other types of transacti=
ons will not be modified by Segwit (e.g. OP_RETURN outputs, or P2PK). This =
analysis doesn&#39;t take into account that LN transactions may affect the =
current state, =C2=A0increasing the segwit/nosegwit ratio.</div><div><br></=
div><div>Among a lot of information, I&#39;ve got the following real world =
results...</div><div><br></div><div><div>acMainChainSpace =3D352608924</div=
><div>acSegwitSpace =3D599400403</div><div>Ratio segwit/nosegwit=3D1.6999</=
div></div><div><br></div><div>This implies that the 75% that discount is no=
t the best option to prevent witness spam in a block of 4 MB, as stated in =
<a href=3D"https://segwit.org/why-a-discount-factor-of-4-why-not-2-or-8-bbc=
ebe91721e" target=3D"_blank">https://segwit.org/why-a-<wbr>discount-factor-=
of-4-why-not-<wbr>2-or-8-bbcebe91721e</a>.</div><div><br></div><div>The non=
-witness data weight factor should not be 4 but 2.35. The closest integer v=
alue is 2, which leads to a 50% witness discount.<br></div><div><br></div><=
div>The Bitcoinj source code is available for anyone to review. I encourage=
 anyone to re-compute this with another utility to cross-check. Maybe Antoi=
ne Le Calvez (<a href=3D"http://p2sh.info" target=3D"_blank">p2sh.info</a>)=
 would like to double-check.</div><div><div><br></div><div><br></div><div><=
br></div><div><br></div><div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
bitcoin-dev mailing list<br>
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.=
<wbr>linuxfoundation.org</a><br>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundation.<wbr>org=
/mailman/listinfo/bitcoin-<wbr>dev</a><br>
<br></blockquote></div><br></div>

--94eb2c1b49b6eae949054f0bdcbe--