gun icon indicating copy to clipboard operation
gun copied to clipboard

Proposal: GUN URIs to universally reference data

Open simonausten opened this issue 1 year ago • 3 comments

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!")

simonausten avatar Feb 26 '24 13:02 simonausten

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.

crunchysteve avatar Feb 26 '24 22:02 crunchysteve

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.

amark avatar Mar 25 '24 03:03 amark

scoping URIs to gun:// would be a problem. because of multiple apps trying to support the incoming URI requests.. what app would win? my app or your app?

it would still be best to handle your own URI request like myapp://gun/{path}

bmatusiak avatar Aug 17 '24 15:08 bmatusiak