summaryrefslogtreecommitdiff
path: root/ea/ba471f5dd152f018b3bb9cb9ce151c140d68c5
blob: 26a4ebe696282bfb66bf25d9bbdf0c5870498ea2 (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
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 C60192C
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Fri, 29 Sep 2017 02:06:56 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-vk0-f47.google.com (mail-vk0-f47.google.com
	[209.85.213.47])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 4D513D3
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Fri, 29 Sep 2017 02:06:56 +0000 (UTC)
Received: by mail-vk0-f47.google.com with SMTP id q190so1752581vkd.13
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Thu, 28 Sep 2017 19:06:56 -0700 (PDT)
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:cc;
	bh=TMIED2GOUKBneuU0YfGDYMiZufLR8uccxpfPkcMQqU8=;
	b=nHdmY3VHOSvgqU7/gfpvmPnX/6lXwkAcXT2o2v8rhA1fL7OYfMh+wXo1ostM2uzH5B
	0wpB8Aktqkp57MrcI7+tfNs9k+U91cgvYal3s0OtT4AQuevlD8I0N4TIp/qQagCKlT5w
	eFecP6/TvDACg7S64kobs1V4wMDIe4UeAga4L9Ja9c6R9nM+ITyhA7fNAa3/Ma8kiin6
	1qO6e41/qk12tcAZ4x51YYMFzQXAyM56j2HP9ewXAmfEKYL4HK1GNhMKXuJXVL6g5I1d
	pIDsn/tDkGkOwgFlGIY7j25fmY0pL2A3nqVCfsuCOC4GM8PeIp0vNARFjjdKywHvhbJR
	P9mg==
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:cc;
	bh=TMIED2GOUKBneuU0YfGDYMiZufLR8uccxpfPkcMQqU8=;
	b=r8CUk2b5LZ55Lbx2ROCp4VdoXXjY9hdKJS0hR6GxGCCsjX2AYbu4PysSKMefzj2/3e
	qW2Xm4K0Py4oUga3JKAwfV1cFF8jDY8e8XffER+YuFcgU0n9XuUf8gKvAz/LO/l2j8Sf
	1MuifJoARvFNAnYdyLXXXa2u4GFR7ajZ47qgcvxptCskxpKJgDvIsOwh0Yd6q/FvJPQP
	uOsq7XF4HzFqpyPU4fCN4REbH8BLArbKBNwJMtIZJPzdo+llsLzCymzBVJcaorQXgZeX
	87HzGh5j55AIlChw2Hm9kExt9TpDFh4yJAgcKDJ5FEnPHUapwGIUalvGhfRcNvUzx1WU
	Txvg==
X-Gm-Message-State: AMCzsaXYS34lLohQVtLWlOSNm3GkNDYx5wQYUenCSx9c37k0CJl9GLO/
	GcOmMI1rLCJ+/GYnHFdc3Xik3l05efFrjayQR05xxg==
X-Google-Smtp-Source: AOwi7QCqTshf6qqxKA5N6wKrNnGmVR9jOX8L1JjOSEKCRTPJ9QVT1hN2E96NfR/AudNuLqw14vfzHkBAWreQ/TBz8kE=
X-Received: by 10.31.78.4 with SMTP id c4mr3649999vkb.15.1506650815419; Thu,
	28 Sep 2017 19:06:55 -0700 (PDT)
MIME-Version: 1.0
Sender: gmaxwell@gmail.com
Received: by 10.103.146.67 with HTTP; Thu, 28 Sep 2017 19:06:54 -0700 (PDT)
In-Reply-To: <20170929015048.GC11956@savin.petertodd.org>
References: <20170927160654.GA12492@savin.petertodd.org>
	<CAAS2fgRpMXdqKXeYSOtVBQQ9fmu=nQ9anEO6Wrc_5rms1Y2B2w@mail.gmail.com>
	<20170929015048.GC11956@savin.petertodd.org>
From: Gregory Maxwell <greg@xiph.org>
Date: Fri, 29 Sep 2017 02:06:54 +0000
X-Google-Sender-Auth: 3Htv4eAtUqjGnXte9j3XD3D9Xvs
Message-ID: <CAAS2fgSZnaUvxC1ErfyKADvEocF1pAk=9VU55hQWwNbNyAho4w@mail.gmail.com>
To: Peter Todd <pete@petertodd.org>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Status: No, score=0.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
	FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=disabled
	version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] Address expiration times should be added to
	BIP-173
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: Fri, 29 Sep 2017 02:06:57 -0000

On Fri, Sep 29, 2017 at 1:50 AM, Peter Todd <pete@petertodd.org> wrote:
> What do you mean by "an embedded amount"?

I ask you to pay 1 Bitcoin to bc1blahblah.

...you make a typo, or a poorly placed cosmic ray switches it in your
ram to bc1blohblahbah.   No problem, it'll get rejected. (even if the
cosmic ray happens just before signing... if the software is robust
it'll reencode from the signed transaction and check against the
original input.

But if instead the typo converts it to 2 Bitcoins or the cosmic ray
converts it to 2.34217728... the payment will happily go through,
assuming your wallet had enough, and you're stuck asking me to refund
you the excess.

Sure, you can put amounts in URIs and whatnot, but they're not error
protected... so there will always be unprotected poritons where a
glitch can radically change the amount.

In many cases you know exactly what amount you're asking for when you
generate an address. There isn't any reason the amount couldn't be
covered by the addresses checksum in those cases.

There are a couple ways of doing that... e.g. adding it explicitly,
where the checksum includes it but not the address itself; so it
errors out if you get it wrong. But this is unfortunate because it
can't tell you the expected amount when its wrong.   Another way would
be to embed the amount in the address, and then the software can tell
you the amount the address was expecting and not let you proceed until
they match.