From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 40D73C0032 for ; 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 ; 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 ; 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 ; 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 To: Peter Todd , Bitcoin Protocol Discussion Message-ID: Mail-Followup-To: Peter Todd , Bitcoin Protocol Discussion References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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