Crates.io | world_id |
lib.rs | world_id |
version | 0.1.0 |
source | src |
created_at | 2018-04-03 17:49:12.32891 |
updated_at | 2018-04-03 17:49:12.32891 |
description | An experiment in creating a distributed PKI. |
homepage | |
repository | https://github.com/icefoxen/world_id |
max_upload_size | |
id | 58827 |
size | 35,585 |
An experimental project for a distributed PKI. The goal is similar to OpenID and tne idea is similar to GPG but the hope is to make something that is a) far simpler and easier to use, b) makes authentication trivial for other programs (can be used very easily by libraries, web pages, etc)
Basically, the idea is to put a public key in a DHT -- For the moment this uses IPFS. Then, a user can fetch other public keys, verify them, and so on, just by getting the object from the DHT. The public key's unique identifier is its DHT hash. A user may publish updates to their data just by inserting a new record into the DHT and signing it with the private key.
PGP/GPG focuses on email. And doesn't even do it well. Dude. We are in a world where we want to sign and verify specific API requests (like, say, login) both in a web browser and on a web server.
Anyone can retrieve any public key, verify it, etc; you don't need any centralized authority.
An identifier is just a unique hash
You can have as many keys as you want that may or may not be interlinked with each other
Old keys can't point at new keys and say "you want to look at this instead"
Old keys might get forgotten by the network and thus break the chain of trust
If you lose the private key you're hosed (natch)
You can sign someone else's key by publishing a new record, but you can't start with a key and see who has signed it unless they update their record to advertise those signatures -- and then you have a new key.
Basically, most of these are problems with content-addressed merkle-DAG-like structures such as IPFS in the first place. Content-addressing is great until the content changes and people have to be notified of this. Thus we need a human-name-to-content-id mapping. As far as I know, such a thing currently does not exist as a distributed system; the closest we have is DNS, which is administered by central authorities in a vaguely-sane manner.
One way around this might be something like IPLD, which basically uses DNS TXT or SRV records to provide the human-name-to-content-id mapping. This probably isn't suitable for things that update rapidly such as interactive webpages, fora, chats, etc, but would probably be fine for something like this where an individual probably isn't updating their key every few seconds and doesn't need real-time updates.
It uses IPFS and requires an IPFS node to be running locally; it talks to the node over its local HTTP API.
Honestly, I love what IPFS does but I dislike how it does it. It seems very re-invent-the-world-y, and I'm not convinced that's necessary. The daemon is also very heavyweight and can be very slow with no terribly good tools . It needs a dedicated server process per machine, that server is resource intensive, and administering it is a pain. It's far from a plug-and-play solution. :-/
What's the alternative?
Currently it uses CBOR but its details are strictly undefined. They'll need to become defined at some point so that other programs/implementations can interoperate, but for now this is an experiment.
CBOR isn't great but it might be the best available. We can't use JSON or XML or such because, since keys are identified by their hashes, whitespace is significant. Protobuf might be okay, capnp might be better, but CBOR is simple and has no actual problems I'm aware of so it's fine so far. This is a yak I love shaving way too much, so suggestions welcome! Possible alternatives: bincode, msgpack, maybe bencode,
Data fields:
Public key algorithm: Ed25519
Oh, it would be useful to be able to enesure that these ident block thingies have a strictly limited upper size, to make it easy to reason about them and such.