summaryrefslogtreecommitdiff
path: root/35/86094e4b42a15ba5eb80f782a3f6aa18f087ec
blob: 2642bc782eda10dc74f30dfe8162675c7479f30c (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
Return-Path: <gmaxwell@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id EEA9CD3C
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Mon, 11 Dec 2017 21:04:02 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-ua0-f174.google.com (mail-ua0-f174.google.com
	[209.85.217.174])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 84E9650E
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Mon, 11 Dec 2017 21:04:02 +0000 (UTC)
Received: by mail-ua0-f174.google.com with SMTP id p33so12965899uag.9
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Mon, 11 Dec 2017 13:04:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to; bh=ywMSPGSBsgf4QryHMoW7PHTC4mV0EqvduXhE2IR3clU=;
	b=PovK8xerqA1VL9s1bQk1otIylgaNRUZ0XAgl6l8oY+Pgyj1JeCOqSKRSrQXkW7SgRw
	EPjU4v+0Vxt5WwLz25QXUsXpGw2g0aDVxg1d17dcHRrMOUlO3iP8tvf/PB9AJJnrQb2O
	Mi4havZLNn53n+dMMO0vyxEyUpAzY9PU43boKx1LjRTJP/W0iUXR9STm1FNF7PlSaIKc
	DaInwrMpvxoXioeWuJvNpHHVCVuTFY8GutlKYVutKeG43yUCxlFxegvKXL8gSRRQ+RgS
	jvXFC8f7SDDaUoWmwZzEKAxwnEuVZpAbde0blE8YTV1dIi/8oe6yXPe/YXPxkEqOhxgq
	ZTfA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to;
	bh=ywMSPGSBsgf4QryHMoW7PHTC4mV0EqvduXhE2IR3clU=;
	b=YBg2LfwGMBzLACfUJ6JyrkCNL6R6DbCY50Rd349i12oTkSm/PuHAATTDvEFmAMfGIy
	vOkAcFIp7wfP00vKJR2yjqBinoPAPMSl58uJIF40E8RR/+h121NeD5IJPbBmZy8uyQnB
	l3vvZHeBGMFPWfGIbUYdxSuDTYmyvrIdaMMRXFX6MC8nHGtW79m5X2ZpFO67OjGu7ToA
	HLn4x3+am028maCz9zG57V3uBxcyd87c74w+Naf7tUiduPKj0yVK8uoOpYmORBUMIaEi
	TnfkO8Al766Uj0tQnVCkVgIKK+oyn9wM5OYovnjDSTP40OxGfNq/DmedWIK+HSfQvVNG
	CwsA==
X-Gm-Message-State: AKGB3mIeqa4gwAtSFCEnuHiOwBhYv/XnUrPKuqbXttMV3e93RJtbkAAL
	UH+p5i9zlwkF1hGCLiNPtNE0WI1mKd+1nSVZMgQ=
X-Google-Smtp-Source: ACJfBovG4h7mGkqbRjCnM1Tcvj3USMoDFMEE0kfZrQzW/7u876jYhPKC7kzgYN3JMoBHtQ5fe7iu+aycAJVz4M7pPMo=
X-Received: by 10.159.60.84 with SMTP id w20mr1947648uah.18.1513026241675;
	Mon, 11 Dec 2017 13:04:01 -0800 (PST)
MIME-Version: 1.0
Sender: gmaxwell@gmail.com
Received: by 10.103.85.148 with HTTP; Mon, 11 Dec 2017 13:04:01 -0800 (PST)
In-Reply-To: <CADZtCShywq_s9ZK3oBBTUdCgjrTxbyeb-p7QrhJJ3mwRAECCMA@mail.gmail.com>
References: <CADZtCShywq_s9ZK3oBBTUdCgjrTxbyeb-p7QrhJJ3mwRAECCMA@mail.gmail.com>
From: Gregory Maxwell <greg@xiph.org>
Date: Mon, 11 Dec 2017 21:04:01 +0000
X-Google-Sender-Auth: eFGtBZXR0tHUfnnppABS8GcSX-g
Message-ID: <CAAS2fgROykenGH43_FXun+q4u+=94tKqnRW=kQQ2AQFeXKdW=Q@mail.gmail.com>
To: Jim Posen <jim.posen@gmail.com>, 
	Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID, FREEMAIL_FROM,
	RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
Subject: Re: [bitcoin-dev] "Compressed" headers stream
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, 11 Dec 2017 21:04:03 -0000

On Mon, Dec 11, 2017 at 8:40 PM, Jim Posen via bitcoin-dev
<bitcoin-dev@lists.linuxfoundation.org> wrote:
> Firstly, I don't like the idea of making the net header encoding dependent
> on the specific header validation rules that Bitcoin uses (eg. the fact that
> difficulty is only recalculated every 2016 blocks). This would be coupling

In the last proposal I recall writing up, there was a one byte flag on
each header to indicate what was included.

Nbits _never_ needs to be sent even with other consensus rules because
its more or less necessarily a strict function of the prior headers.
This still holds in every clone of Bitcoin I'm aware of; sending it
with the first header in a group probably makes sense so it can be
checked independently.

> with insufficient benefit.

another >18% reduction in size beyond the removal of prev. is not
insubstantial by any means.  I don't think it should lightly be
ignored.

Prev omission itself is not, sadly, magically compatible:  I am quite
confident that if there is a bitcoin hardfork it would recover the
nbits/4-guarenteed always-zero bits of prev to use as extra nonce for
miners. This has been proposed many times, implemented at least once,
and the current requirement for mining infrastructure to reach inside
the coinbase txn to increment a nonce has been a reliable source of
failures.  So I think we'd want to have the encoding able to encode
leading prev bits.

Many altcoins also change the header structures. If the better thing
is altcoin incompatible, we should still do it. Doing otherwise would
competitively hobble Bitcoin especially considering the frequent
recklessly incompetent moves made by various altcoins and the near
total lack of useful novel development we've seen come out of the
clones.

Probably the most important change in a new header message wouldn't be
the encoding, but it would be changing the fetching mechanism so that
header sets could be pulled in parallel, etc.

I would rather not change the serialization of existing messages,
nodes are going to have to support speaking both messages for a long
time, and I think we already want a different protocol flow for
headers fetching in any case.