summaryrefslogtreecommitdiff
path: root/32/e000eec9e8b4b56becb33dbb061defde22a8dc
blob: 908bcf6df7db76e38e0e7c565ddd36bce3068151 (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
Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191]
	helo=mx.sourceforge.net)
	by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <laanwj@gmail.com>) id 1YHs1O-0000Ej-Ue
	for bitcoin-development@lists.sourceforge.net;
	Sun, 01 Feb 2015 10:44:54 +0000
Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com
	designates 74.125.82.43 as permitted sender)
	client-ip=74.125.82.43; envelope-from=laanwj@gmail.com;
	helo=mail-wg0-f43.google.com; 
Received: from mail-wg0-f43.google.com ([74.125.82.43])
	by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
	(Exim 4.76) id 1YHs1O-0001zD-3S
	for bitcoin-development@lists.sourceforge.net;
	Sun, 01 Feb 2015 10:44:54 +0000
Received: by mail-wg0-f43.google.com with SMTP id y19so33970393wgg.2
	for <bitcoin-development@lists.sourceforge.net>;
	Sun, 01 Feb 2015 02:44:48 -0800 (PST)
X-Received: by 10.180.82.137 with SMTP id i9mr13574470wiy.38.1422787488067;
	Sun, 01 Feb 2015 02:44:48 -0800 (PST)
Received: from amethyst.lan (e107003.upc-e.chello.nl. [213.93.107.3])
	by mx.google.com with ESMTPSA id vq9sm22829544wjc.6.2015.02.01.02.44.46
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sun, 01 Feb 2015 02:44:47 -0800 (PST)
Date: Sun, 1 Feb 2015 11:44:46 +0100 (CET)
From: Wladimir <laanwj@gmail.com>
To: Tamas Blummer <tamas@bitsofproof.com>
In-Reply-To: <D89EBAA3-ED78-4D9C-B693-FBBF27501938@bitsofproof.com>
Message-ID: <alpine.DEB.2.10.1502011133510.21504@nzrgulfg.ivfhpber.pbz>
References: <D89EBAA3-ED78-4D9C-B693-FBBF27501938@bitsofproof.com>
User-Agent: Alpine 2.10 (DEB 1266 2009-07-14)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	-1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for
	sender-domain
	0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
	(laanwj[at]gmail.com)
	-0.0 SPF_PASS               SPF: sender matches SPF record
	-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
	author's domain
	0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
	not necessarily valid
	-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
	2.8 MALFORMED_FREEMAIL Bad headers on message from free email service
	0.0 AWL AWL: Adjusted score from AWL reputation of From: address
X-Headers-End: 1YHs1O-0001zD-3S
Cc: Bitcoin Dev <bitcoin-development@lists.sourceforge.net>
Subject: Re: [Bitcoin-development] var_int ambiguous serialization
 consequences
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Sun, 01 Feb 2015 10:44:55 -0000


On Sun, 1 Feb 2015, Tamas Blummer wrote:

> I wonder of consequences if var_int is used in its longer than necessary forms (e.g encoding 1 as 0xfd0100 instead of 0x01)

In serialize.h lingo you are talking about CompactSize, not VarInt.

CompactSizes indeed have redundancy in their representation, i.e. the same 
number can be represented as up to four different byte sequences.

VARINTs have a different format that (AFAIK) isn't used anywhere in 
the block chain. See WriteVarInt / ReadVarInt. These were designed to 
not have any redundancy in their representation.

> This is already of interest if applying size limit to a block, since transaction count is var_int but is not part of the hashed header or the
> merkle tree.

Are you sure that this is a current concern? Non-canonical CompactSizes 
are forbidden - in serialize.h this is flagged in ReadCompactSize.

Wladimir