Brandon Black [ARCHIVE] on Nostr: 📅 Original date posted:2023-08-05 🗒️ Summary of this message: The proposal ...
📅 Original date posted:2023-08-05
🗒️ Summary of this message: The proposal suggests using different byte lengths to encode expiration times in Bitcoin addresses, with varying granularities. The author argues against a fixed granularity and explains the potential degradation over time.
📝 Original message:
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
Published at
2023-08-06 23:37:35Event JSON
{
"id": "f73274ac3cd946c8e071c91bd5c171759539c1335c02ba9bedd4056b8d5ca11d",
"pubkey": "59909c5ada0189425f58f43a87eeb09131d41d33298de94a994852fa43c25afd",
"created_at": 1691365055,
"kind": 1,
"tags": [
[
"e",
"c08d8bfe5e8ab2894e9fbdb020ab2bbb281ca98857e700a8e90822dc365f2c84",
"",
"root"
],
[
"e",
"38ceba829486b64cce86e3444a1b7f999c751727fbf8ef97cbc815483f58f4fe",
"",
"reply"
],
[
"p",
"b76c722722177357360fa4e5ab0df6ac6ecd628aaac0638108ea660eda8355c0"
]
],
"content": "📅 Original date posted:2023-08-05\n🗒️ Summary of this message: The proposal suggests using different byte lengths to encode expiration times in Bitcoin addresses, with varying granularities. The author argues against a fixed granularity and explains the potential degradation over time.\n📝 Original message:\nOn 2023-08-05 (Sat) at 14:06:10 +0000, Peter Todd via bitcoin-dev wrote:\n\u003e \u003e bytes | prefix | usable bits | granularity | max expiration\n\u003e \u003e ------|------------|-------------|-------------|---------------\n\u003e \u003e 1 | 0b0 | 7 | year | 128 years\n\u003e \u003e 2 | 0b10 | 14 | week | 315 years\n\u003e \u003e 3 | 0b110 | 21 | day | 5700 years\n\u003e \u003e 4 | 0b1110 | 28 | block | 5100 years\n\u003e \u003e 5 | 0b11110 | 35 | ??? | ???\n\u003e \u003e 6 | 0b111110 | 42 | ??? | ???\n\u003e \u003e 7 | 0b1111110 | 49 | ??? | ???\n\u003e \u003e 8 | 0b11111110 | 56 | ??? | ???\n\u003e \n\u003e 1) Having the granularity of the limit depend on *when* the limit is to be\n\u003e applied in a UX nightmare. It is far simpler to just pick a useful granularity,\n\u003e and include enough bytes of integer to work until well into the future. 3\n\u003e bytes, 24-bits, of days is 45,000 years. That's plenty.\n\nI must not have explained my proposal clearly. The granularity depends\nnot on when it is applied, but on the encoding. For example, the bits\n0b00000001 encode an expiration 1-year from the epoch of the system. The\nbits 0b10000000 10000000 encode an expiration 128 weeks from the epoch.\n\nWhen decoding, the position of the highest `0` bit in the expiration\nindicates the byte-length, and the granularity. If the expiration's\nhighest bit is `0`, it is 1-byte long, and the bits following the\nhighest `0` encode a number of years. If the first `0` bit is in the\nsecond highest position, then it is 2-bytes long and the bits following\nthe highest 0 encode a number of weeks. \u0026c.\n\n\u003e 2) Your suggestion would result in a protocol that degrades over time, as the\n\u003e granularity of *newly* created addresses goes up. This isn't like CTV/CLTV,\n\u003e where we're creating something now with a limit in the future. 100 years from\n\u003e now - if silent payments still exists - people will still want to create silent\n\u003e payment addresses that expire, say, 30 days in the future. Your suggestion does\n\u003e not allow that.\n\nMy suggestion does degrade over time in one sense: if it is still in use\n128 years in the future, users are required to start using at least 2\nbytes to encode their expiration instead of 1, even if they only need\nyear granularity. After 315 years they have to start using at least 3\nbytes even if they only need week granularity.\n\nI'd rather enable users to encode their expirations in 1 or 2 bytes\ntoday and degrade by requiring more bytes than require 3 bytes now.\n\nBest,\n\n--Brandon",
"sig": "4b0b31d02422131bd1cd24f3a12c15f8e6b3d9946e0df6560b7a1be81a230198d94468c221348d57c2aebaa3d61323945317637e91459fe16a040b526bd9ab34"
}