gun
gun copied to clipboard
Proposal: GUN URIs to universally reference data
Very simply, what do we think to formalising a GUN-specific URI scheme to reference nodes in the db? For example:
- The pastebin at https://gun.eco/docs/Hello-World is accessed by calling
gun.get('test').get('paste')
. This could be representedgun://test/paste
- In the case of public space, say you have
gun.get('~'+Bob.pub).get('test').get('TestProperty')
. This could be representedgun://~bR+eukWF7mYgxibHHRc6tJ+G6PIMEB91O1WVEbAYuWU=/test/TestProperty
, using the tilde convention - 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!")
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.
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.
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}