Midnight Pub

Handcrafted Integers

~tetris

Have you ever wanted your own integer, one that is uniquely yours and can't be taken away?

Oh sure, you could generate a random integer with your device now, but no one will respect that it's yours until you publish it somewhere - somewhere that everyone can agree on.

Brooklyn Integers!

This is surely a joke, right?

According to their FAQ: Yeah kind of, but also not.

Its literally a number server. It gives you an available number from 0 to infinity and you can use that number as global identifier for something/anything.

If someone tries to register that number for something else, the database will say no.

Just one database then?

Initially yes, serving numbers from 0 to Infinity, but people on the West Coast thought that it was a bit mean that the East Coast was dominating the numbers game, so they opened up their own database in San Francisco:

Mission Integers!

Wait a second, two databases?

Do they share keys, so that one knows what nunbers the other doesn't? How can they ensure that the same number isn't registered twice?

Infinity is big, so one server issues only even numbers, and the other issues only odd numbers, ensuring they'll never give the same number out without having to communicate. "Spooooky action at a distance!" (not really)

Okay, just two then? Well...

People on the otherside of the pond thought that the ownership of integers was a bit too US-centric, so someone then invented:

London Integers!

Now hang on a second

How can the London server ensure it never gives out a number that the US servers have? They own the Odd and Even numbers for christsake!

Well, with a bit of aggressive negotiating it was agreed that the US server serving Odd numbers wouldn't give out multiples of 9.

Summary

Three number servers exist to give out unique integers to anyone who asks, all without checking each other:

1. Serves Even Numbers

2. Serves Odd Numbers (not multiples of 9]

3. Serves Multiples of 9


johano

Badly designed from the get-go... each server should only serve multiples of different primes...

reply

tetris

Just in case this is not a joke comment: If X is your prime base, and Y is the multiple, and Y is also prime, then you can't guarantee that one server won't have Y as it's prime base and X as the multiple. Not unless each server implements an `is_prime(N)` function for each new key, which brings us into the realm of quantum computing...

reply

johano

Umm, if X is prime and Y is a multiple of X, then Y is *not* prime, by definition...

Oh wait, I believe I understand you better now!

Example: First server serves multiples of 2, second server serves multiples of 3, they'll both try to serve 6... so really to make this foolproof, each server should only serve powers of distinct primes... that way there won't be collisions...

reply

tetris

Exactly, but how do you test for distinct primes? This would a require an "is_prime" function right

reply

johano

Yeah, there'd need to be some coordination between servers to make sure that they were starting with distinct primes, but they could be picked sequentially off a list or something... since there are around 10^17 known primes, there's no danger of running out anytime soon :)

reply

moonsheep
Have you ever wanted your own integer, one that is uniquely yours and can't be taken away?

Well, there's an easy way to do that! Just generate a random 256-bit number, and derive an ed25519 public key. That public key is your number. Anyone can verify that it's yours (since only you have the secret key with which you can sign messages), but as long as the secret number stays secret no one can take it away!

reply

tetris

Very true, and you'd need to do 2¹³⁰ (~ 10³⁹) operations to even get within a fraction of a fraction of a chance of having a collision[1]!

But the point of this integer server isn't secrecy, it's annotation -- primarily providing a unique integer to a resource that can be uniquely shared over many different projects.... which is something you could also do with a random hash....

Hmm, you've raised a good point and now I feel stupid ;-)

1: https://crypto.stackexchange.com/questions/39641/what-are-the-odds-of-collisions-for-a-hash-function-with-256-bit-output

reply

moonsheep

I mean, if you don't need secrecy you can just use a random 130-bit number and get equivalent collision resistance. That's basically what UUIDs are. Of course doing that misses the point of the number servers entirely (which I suspect is mostly for the fun of it).

That said there are some real world problems that involve getting everyone to agree on a number (most notably addressing). I mean, that's basically all IANA does.

And it's a tough problem!
reply

the_bebop_cowboy

Love this. So nifty.

reply

zampano

This is the kind of weird, niche quasi-silliness that I love finding on the internet.

reply

inquiry

Chanced upon the following, tonight, and suspect burrowing therein just might unearth a bit of such silliness:

https://emreed.net/LowTech_Directory.html

reply

tetris

Me too! It's practical too -- I found one serious project that was actually using it to label their entities, which is how I found out about these integer servers in the first place

reply