amark / gun

An open source cybersecurity protocol for syncing decentralized graph data.
https://gun.eco/docs
Other
17.93k stars 1.16k forks source link

Proposal: GUN URIs to universally reference data #1367

Open simonausten opened 4 months ago

simonausten commented 4 months ago

Very simply, what do we think to formalising a GUN-specific URI scheme to reference nodes in the db? For example:

  1. The pastebin at https://gun.eco/docs/Hello-World is accessed by calling gun.get('test').get('paste'). This could be represented gun://test/paste
  2. In the case of public space, say you have gun.get('~'+Bob.pub).get('test').get('TestProperty'). This could be represented gun://~bR+eukWF7mYgxibHHRc6tJ+G6PIMEB91O1WVEbAYuWU=/test/TestProperty, using the tilde convention
  3. There's a bit of an issue in frozen space, in that # indicates the start of a fragment in a URI, but perhaps an alternative character could be chosen. Thinking of characters which are valid, easy to type, and don't need to be percent encoded, an exclamation point would serve well, e.g. gun://!ZGhJ7M8vJh9ZaQe3z7XlL6Rv4Gf5T9zj7H8Kl9Mn4BvZ= (I kinda like the way this implies "this is the value, period!")
crunchysteve commented 4 months ago

I like this idea! Definitely a step in the right direction. I've been trying to get interest in a similar idea over here https://github.com/crunchysteve/peer-to-peer-dns-overlay only more generalised for all the hashtable systems, much like the standard DNS works with http ftp webrtc, etc. I only have the knowledge to conceive the model, not to code it, though.

I call it Personal Name Service (PNS) and not requiring any actual registration, just a check for conflict, and reissue at setup.

amark commented 3 months ago

Others can do this if they want, but GUN's architecture specifically chooses using UTF8 as its keyspace so it can support any URIs as a subspace, as in you could have gun.get('http://archive.org') or any other URI/protocol, so then prefixing GUN with gun:// would be problematic.