Avatar
jimbocoin 🃏
6140478c9ae12f1d0b540e7c57806649327a91b040b07f7ba3dedc357cab0da5
The SUPERCYCLE guy.

They also changed the definition of “savings” accounts and lifted penalties on frequent savings withdrawals.

Never Split the Difference by Chris Voss

Best book on persuasion out there and it’s not even close.

S

U

P

E

R

C

Y

C

L

E nostr:note13k6u827ctezeq8rpctuhtptggqv5as4rtp9lr3z83nxvtf0sxrnsc6lxhd

Replying to 21823843...

Hehe in fact my original attempt at sync in strfry was a protocol called "yesstr" using my Quadrable library: https://github.com/hoytech/quadrable

It used binary flatbuffers over websockets. It caused a lot of problems since binary websocket messages require a distinct message type from text ones. Since nothing else in nostr uses these, of client libraries were having trouble integrating with it. Using a structured binary format like CBOR or flatbuffers also means clients would have to pull in a (probably heavy) serialisation library.

The nice thing about the current approach is that any existing nostr client already must support websocket text messages containing JSON containing hex data.

What’s the rate of support for compression on the wire? I’m guessing most clients must support gzip, since it predates wss://.

Thanks! Is there a chart of this over time? Would be interesting to see the flow.

Instead of talking about budget deficits in absolute terms, it would be instructive to frame them in relative terms.

That’s, how much, as a percentage, did/does the debt increase/decrease monthly/yearly etc. That way, we can compare apples to apples.

Today’s $380B and next decade’s $380B are worlds apart. But 10% is 10% year after year after year.

Replying to 21823843...

> If you’re sending binary, base64 only inflates by 33% compared to hex strings’ 100%.

On purely random data, after compression hex is usually only ~10% bigger than base64. For example:

$ head -c 1000000 /dev/urandom > rand

$ alias hex='od -A n -t x1 | sed "s/ *//g"'

$ cat rand |hex|zstd -c|wc -c

1086970

$ cat rand |base64|zstd -c|wc -c

1018226

$ wcalc 1086970/1018226

= 1.06751

So only ~7% bigger in this case. When data is not purely random, hex often compresses *better* than base64. This is because hex preserves patterns on byte boundaries but base64 does not. For example, look at these two strings post-base64:

$ echo 'hello world' | base64

aGVsbG8gd29ybGQK

$ echo ' hello world' | base64

IGhlbGxvIHdvcmxkCg==

They have nothing in common. Compare to the hex encoded versions:

$ echo 'hello world' | hex

68656c6c6f20776f726c640a

$ echo ' hello world' | hex

2068656c6c6f20776f726c640a

The pattern is preserved, it is just shifted by 2 characters. This means that if "hello world" appears multiple times in the input, there may be two different patterns for it in Base64, but only one in hex (meaning hex effectively has a 2x larger compression dictionary).

Since negentropy is mostly (but not entirely) random data like hashes and fingerprints, it's probably a wash. However, hex is typically faster to encode/decode and furthermore is used for almost all other fields in the nostr protocol, so on the whole seems like the best choice.

> Personally, I’d prefer to see the message format specified explicitly as debuggable JSON, if feasible.

This is theoretically possible, but it would be very difficult to interpret/debug it anyway, and it would add a lot of bandwidth/CPU overhead.

If we’re gonna go binary, then I’d prefer to just go full binary. WebSockets support binary mode. We could encode these messages using CBOR and suffer minimal loss on the wire. This would still be compatible with stream compression, AFAIK.

Encoding binary data as a string can be completely avoided for this new message type, since both ends of the connection are expected to handle binary payloads anyway. The usual argument of avoiding a human-unreadable format is moot here, IMO.

Replying to Avatar jamw

Coinbase custody IIRC.

Then, it’s not surprising. Each caters to a different audience probably.

This is a sustainable eating paradigm. 23 hrs fasting, 1 hr eating meat. 🫶

Every seventh day, eat whatever you want (cheat day)