summaryrefslogtreecommitdiff
path: root/5e/6c5346fd90798f00a48f29b09875ed84a2847a
blob: a23cc388c2ab238e96ad17ea83684aa64ccbe395 (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
Return-Path: <freedom@reardencode.com>
Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 40D73C0032
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sat,  5 Aug 2023 14:47:30 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp1.osuosl.org (Postfix) with ESMTP id 0825C81E9C
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sat,  5 Aug 2023 14:47:30 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0825C81E9C
Authentication-Results: smtp1.osuosl.org;
 dkim=pass (1024-bit key) header.d=reardencode.com header.i=@reardencode.com
 header.a=rsa-sha256 header.s=mail header.b=pFeo2WV7
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -1.307
X-Spam-Level: 
X-Spam-Status: No, score=-1.307 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RDNS_NONE=0.793,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Received: from smtp1.osuosl.org ([127.0.0.1])
 by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id wU4Wx2j3wXdE
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sat,  5 Aug 2023 14:47:28 +0000 (UTC)
X-Greylist: delayed 58451 seconds by postgrey-1.37 at util1.osuosl.org;
 Sat, 05 Aug 2023 14:47:28 UTC
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 8193580EBB
Received: from mail.reardencode.com (unknown [IPv6:2607:f2f8:ad40:ea11::1])
 by smtp1.osuosl.org (Postfix) with ESMTPS id 8193580EBB
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sat,  5 Aug 2023 14:47:28 +0000 (UTC)
Date: Sat, 5 Aug 2023 07:46:52 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=reardencode.com;
 s=mail; t=1691246845;
 bh=m240OCW2NR1ql6ibe7rL71QAlym5JWlDwAmrSrWk7Qo=;
 h=Date:From:To:Subject:References:In-Reply-To;
 b=pFeo2WV75p8f0LqXfS7FuVBK8dX+b218IUmi5IV1TDCMIjoKpd5hLAT41cnrJhcLO
 mI/HJnl4EpRQksBSmZ7JZYFyKqGPevLOW8S66I8QnMB3eZIIBq/KagTb/QsHmsyipb
 jVzeUCBcdhkyok1nrOic8QpLkrjXsrP9LHnA1OrQ=
From: Brandon Black <freedom@reardencode.com>
To: Peter Todd <pete@petertodd.org>,
 Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Message-ID: <ZM5g3Fi_vErCeEx0@console>
Mail-Followup-To: Peter Todd <pete@petertodd.org>,
 Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
References: <ZM03twumu88V2NFH@petertodd.org> <ZM17RTXV7M5tVt6N@console>
 <ZM5XUlqymce3xsFy@petertodd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ZM5XUlqymce3xsFy@petertodd.org>
X-Operating-System: Linux 5.15.110 x86_64
X-Mailman-Approved-At: Sun, 06 Aug 2023 14:28:42 +0000
Subject: Re: [bitcoin-dev] BIP-352 Silent Payments addresses should have an
 expiration time
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: Sat, 05 Aug 2023 14:47:30 -0000

On 2023-08-05 (Sat) at 14:06:10 +0000, Peter Todd via bitcoin-dev wrote:
> > bytes | prefix     | usable bits | granularity | max expiration
> > ------|------------|-------------|-------------|---------------
> > 1     | 0b0        |   7         | year        | 128 years
> > 2     | 0b10       |  14         | week        | 315 years
> > 3     | 0b110      |  21         | day         | 5700 years
> > 4     | 0b1110     |  28         | block       | 5100 years
> > 5     | 0b11110    |  35         | ???         | ???
> > 6     | 0b111110   |  42         | ???         | ???
> > 7     | 0b1111110  |  49         | ???         | ???
> > 8     | 0b11111110 |  56         | ???         | ???
> 
> 1) Having the granularity of the limit depend on *when* the limit is to be
> applied in a UX nightmare. It is far simpler to just pick a useful granularity,
> and include enough bytes of integer to work until well into the future. 3
> bytes, 24-bits, of days is 45,000 years. That's plenty.

I must not have explained my proposal clearly. The granularity depends
not on when it is applied, but on the encoding. For example, the bits
0b00000001 encode an expiration 1-year from the epoch of the system. The
bits 0b10000000 10000000 encode an expiration 128 weeks from the epoch.

When decoding, the position of the highest `0` bit in the expiration
indicates the byte-length, and the granularity. If the expiration's
highest bit is `0`, it is 1-byte long, and the bits following the
highest `0` encode a number of years. If the first `0` bit is in the
second highest position, then it is 2-bytes long and the bits following
the highest 0 encode a number of weeks. &c.

> 2) Your suggestion would result in a protocol that degrades over time, as the
> granularity of *newly* created addresses goes up. This isn't like CTV/CLTV,
> where we're creating something now with a limit in the future. 100 years from
> now - if silent payments still exists - people will still want to create silent
> payment addresses that expire, say, 30 days in the future. Your suggestion does
> not allow that.

My suggestion does degrade over time in one sense: if it is still in use
128 years in the future, users are required to start using at least 2
bytes to encode their expiration instead of 1, even if they only need
year granularity. After 315 years they have to start using at least 3
bytes even if they only need week granularity.

I'd rather enable users to encode their expirations in 1 or 2 bytes
today and degrade by requiring more bytes than require 3 bytes now.

Best,

--Brandon