Project Decorum: DECentralised fORUM (and protocol)

I think there are pros and cons, and some of the pros for Javascript on SAFE (as opposed to the Wild Wild Web :smile: ) make it worth considering.

One of the pros I see for building SAFE Apps as web apps (Javascript/HTML/CSS in browser) rather than as native apps (something running directly on your device: PC/phone etc) as with Rust, C++ etc, is that since the browser provides a sandboxed environment, plus easy access to the source code (Ctrl-U), it will be far easier to spot malicious code, and to verify that an App does what it says.

Also, since you can verify you are loading the code you think you are - loading a web app from SAFE from immutable storage - it’s not like on the old web where you can’t tell in advance what a given URL is going to serve up. This benefit applies to all Apps, not just in browser Javascript, but removes one of the major security issues with web apps on the old www.

These are I think really valuable security benefits - I didn’t realise this when I decided to go this way with SAFEpress, so a bit of a bonus :smile:

@Seneca I’m really pleased to see this project, and particularly from you. I will definitely support you, and claim my badge! :smile: Best of luck!

9 Likes

For a moment I read this as dirvine intervention. :smiley:

13 Likes

…-> pan dorum → pandorum

Religion in 2250

“And now class let us return to the exploits of Saint DIrvine, as he began the long war against the Elder God Google”

9 Likes

Awesome idea and really looking forward to seeing your work! It will be a great showcase for what can be done with safe net too!

4 Likes

The thread your thinking of is here: Proposal: Relationship and Group Scoped Identities.

2 Likes

Current NFS and DNS APIs use callbacks, so there is a high probability that SD API will do the same. In the unlikely event that it doesn’t, you can transform a synchronous code to an asynchronous one with a function like this:

function async(your_function, callback) {
    setTimeout(function() {
        var res = your_function();
        if (callback) {callback(res);}
    }, 0);
}

Then you call call async function with your synchronous function and a callback function as parameters.

1 Like

You can make any blocking events occur asynchronously in Javascript using promises. This is probably one of the best tutorials on it.

I had started working on a forum myself a few months back, but my life situation has made my time quite limited, so I reverted to working on a smaller project in my spare time. I did make a pretty comprehensive outline and plan for the forum, and I’ll be happy to post that online for anyone to use, you included. I’ll try to upload it to github soon.

I spent some time making my current project designed such that the core can be easily used and reused in any project, but I’m not quite ready to deliver that yet. I’ll try and finish it up as soon as possible, though.

Good luck with the project!

4 Likes

lol i was just about to say that…

but way to go @Seneca !! Extremely impressive!! Great strides forward for the project, and for humanity!!

Look out for a new writeup of this in Potential Appsite Ver 2! Decorum! (i really like that name, by the way, its very elegant, reminds me of decor and is a nice subconscious tribute to D is cour se from D e cor um)

3 Likes

Can’t wait to see this in action!

3 Likes

Have the payment method authentication on a blockchain supported by the users, that also is used for a feature that the users want so that it’s not all stick and no carrot, and have your app coded so that clients ignore user’s posts that don’t jive with said blockchain somehow. There’d be workarounds inevitably, but the effort involved would stop alot of the cut and pasters, especially if you’re app can become the forum app. Just something that popped into my head.

1 Like

Yes I have raised a RFC for the same. My proposal was to expose APIs that would allow to create own SD types and also to store related raw data as Immutable data in the network.

Am expecting some inputs from you on the RFC, just to make sure that we cater all that would be needed to create your own data structures in the network to start with.

You are right, it would be handled via callbacks :smile: I completed my POC last week on exposing the api from the addon,

The api exposed could be something like this,

safeNetwork.api(jsonPayload, callback);

This week I am working on an RFC to put forward a plan to integrate the same and also on how to manage authentication from addon.

6 Likes

That’s excellent news @Krishna_Kumar and looking forward to that RFC; I’m sure many people will be eager to use this

2 Likes

This is great @Krishna_Kumar :smile:

Any chance of a Structured Data for dummies post? I understand the RFC, but it’s how you would do clever stuff with it - things like enumeration. If that’s just links/refs in the SD objects themselves, simply knowing that is what I need, but if there are none obvious/clever ways to use them I want to know!

Or @Seneca and @dallyshalla, if you have figured this out please can you share what you know in a post on Ways to use Structured Data?

6 Likes

I can’t find a thread with that name?

What’s the actual use case? I have a bit of a hard time understanding what you want to do. An enumeration of constants (enum) could be done in immutable data as well. If you want a mutable list/array, you could let a client store that in an SD object, yes. But it’s also possible to create “decentralised” data structures of multiple SD’s, like how this project lets the users build up a tree data structure together, where every branch of SD’s in the tree is a conversational “thread”.

2 Likes

The thread doesn’t exist, sorry to confuse. It was a suggested title to avoid cluttering this topic.

I got the impression from David’s early comments about Structured Data that there were clever ways of almost querying the network to discover SD objects of a given type, or to iterate the child objects of a given SD without having kept track of what had been created. In his brief talk about implementing blog posts and comments using SD - do you recall?

As I said, if this is all self managed by maintaining references, lists, indexes etc within SD, that’s all I need to know. I just want to be sure I’m not missing some clever features.

If it’s still not clear don’t worry.

2 Likes

@seneca, can I use this project as a disqus replacement? I have several websites with a comment section, and I normally use facebook or disqus to implement the comments. Can I use your project just as the “Facebook Comments Plugin” or the “Disqus Comment System”?

2 Likes

This is exactly what I do with Decorum, yes. This sort of thing can be done because the programmer can decide from which values the address of an SD object will be derived. The address of an SD object is SHA-512(tag_type + identifier), and we pick the tag_type and the identifier ourselves. By establishing rules (a protocol) how these are chosen, the addresses become predictable.

For example, the decentralised forum of Decorum will allow anyone to create a new forum category (think subreddit). I establish the rule (this is an example, it’s not accurate) in the protocol that every category SD object shall have tag_type “12345”, and as identifier it shall have the SHA-512 of the name of the category. Let’s say someone wants to add a category “Music”, then the address of that SD object = SHA512(“12345” + SHA512(“Music”)).

Now I add a search field to my website to search for forum categories, and the JavaScript code takes the user input and uses the same formula as described above to figure out what the address should be. By GETting the resulting address the user’s client retrieves the category SD object, if it exists. Then the protocol also describes in a similar way how a user can create and PUT new, linked SD’s to that category SD.

Yes, that’s the core feature really! :smiley:

On SAFE we won’t integrate third party plugins like “Facebook Comments”. Everything is already integrated with the SAFE Network itself by definition, so everything can be embedded/linked/shared between websites. Websites/apps become merely user interfaces and protocol implementations to interact with the data stored on this huge global unified filesystem, the SAFE Network.

13 Likes

I think getting this is the most vital thing if one wants to build an app/website for SAFE. We should explain this to every dev new to SAFE.

12 Likes

Thanks for explaining @Seneca. This is like saying SD objects will be created with sequential addresses (ie calculable possible IDs) and then retrieving them from 0, 1, 2… until we get an error - yes? I had understood this from David’s explanation but it seemed like he might be alluding to more than this.

I’m still not certain but will take that as it until I hear otherwise! :smile: Thanks again.

3 Likes