Gun seems great - both useful and usable! However, I'm struggling to understand the difference between a public space put, a user space put and a frozen space put. My attempts at the simplest possible examples are:
Public Space
let gun = Gun()
gun.put('hello') // public space put anyone can edit?
User Space
let user = gun.user()
user.create('Bob','password123',console.log)
user.auth('Bob' ,'password123',console.log)
user.get('test').put("Bob's text")
let user2 = gun.user()
user2.create('Eve','password456',console.log)
user2.auth('Eve' ,'password456',console.log)
user2.get('test').put("Eve's text")
gun.get('test').once(console.log)
// Should this result in separately indexed entries in the db?
// Is the verification built in or up to the app developer?
Frozen Space
// From the example:
var data = "hello world";
var hash = await SEA.work(data, null, null, {name: "SHA-256"});
gun.get('#').get(hash).put(data);
//Would not this hash key's value be replaceable by another user? Is the onus on the app developer to check result of returned result (and remove peers that send bad info)?
Assuming that a user could choose any relay server (including ones that randomly tinker with the data), how much of the authenentication (user space) and content id (frozen) is done in the GUN protocol, and how much is down to the app developer(s)?
Can anyone improve on the examples above?
EDIT
From the docs:
This is useful, because it lets you verify that data has not been changed even if it is in a public place. And using SEA with GUN, it prevent peers from changing the data if some name/key combo of '#'+hash is used.
It seems the content addressing, frozen space, is built in.
gun.get('foo').put({hello: 'world'})
(you cannot put primitive values at the root, they need to be on a node). Tip: You can dogun.user(Bob.pub)
so you don't need to remember symbols. We'll add a similar feature for Frozen space too, but right now you have to do it as you show. – Embryonic