Why we built forum and document DApps (and what we learned about smart-contract development)

in #ethereum8 years ago

Full disclosure: otlw-forum, literally the only project we’ve launched to date, is essentially a throwaway side-project. But we hope it’ll at least be a useful throwaway, both for us and the community.

The DApp is build ontop of a document contract, which essentially just defines a document, as an IPFS hash, that has links to other contracts as "Sources". It can then interact with those sources by sending them a portion of any funds sent to it. Its pretty simple, not near as useful or complicated as Steemit, but we thought pretty cool.

Why'd we build it?

We built it, over the course of about 2 weeks, to serve two purposes. Firstly and most importantly, we needed the experience. At the scale we’re trying to build applications you can’t exactly just jump in head first. We needed to try things out in the realm of DApp development and figure out what works and what doesn’t. This is especially true since we’re dealing with two immature technologies here, ethereum and IPFS, and there aren’t very many well developed walkthroughs for building apps with either. (Though by the way, if you’re interested in us writing some tutorials or such, let us know and we’ll try and cook something up).

Anyways, instead of tackling a front-end for our assessment platform right from the get go, we first decided to branch out a bit and build a document management smart contract and forum DApp. We wanted something small, related to our core focus of education, useful, and most importantly modular and extendable.

Which brings us to our second purpose. We want to show the community how powerful simple smart-contracts can be, and that, yes, smart contracts can exist that are both useful and actually usable. Our document contract is barely above 100 LOC and the forum contract that builds on it is just 89. We can’t really take all the credit for that sadly, Ethereum is just damn powerful. Together those contracts enable a full fledged forum experience that allows creators to be rewarded and codes relationships between any kind of files or documents.

Small design

This kind of contract design, small and entity oriented, is where ethereum really shines. You can build little blocks of code which describe entities, and then let them loose to interact with each other. We do the same thing in our major platform with tags, and assessments as our entities. Admittedly there’s a lot more code there, but the approach is still the same, and in our humble opinion, its quite a powerful one.

It’s really a shame that we see so little in terms of development this way. We’ve got a ton of really cool high profile projects (Looking at you Consensys) but very little in terms of small scale, valuable, comprehensible, and actually real and released projects.

So we put all of it together in a little project and released a DApp that allows for document publishing using IPFS, in a neat little forum package. It allows for tags and replies. Which on its own doesn’t sound like much, but builds on a very simple and extendable format.

Replies, for example, are simply an implementation of Sources, as described in the Document contract. It’s a paradigm that can allow for academic publications, blog posts, or even film credits, or editorial work. Its simple but powerful.

We hoped that even if no one really latched onto the Forum as a user base, it would stand as a testament to what small scale ethereum development can do, and perhaps inspire people to extend it.

Extend it how?

It’s fairly straightforward to, for example, modify the frontend to render tags more similarly to a subreddit, or add post ranking based on comments and dates as a metric. This could all be done solely in JS and maybe some modification of the HTML+CSS frontend. It ain’t hard.

If you wanted to get into the meat of things, the smart contracts, you could build a system to manage upvotes and downvotes for documents, even allowing them to trigger actions at certain levels, such as releasing funds if downvoted too far, or perhaps building a locked forum, that only allows individuals to be voted in. Again these would all be fairly straightforward to build in just a few lines of code.

So?

The point here is that smart contract and DApp development on Ethereum doesn’t need to work like it has. We don’t need token sales, fancy press releases, and high-profile partnerships. We need normal people to realize they can interact with this technology. Hell, if two 18 year olds can do it, so can you. All we need in the Ethereum ecosystem, are powerful, useful, and versatile, applications.

We’re working on them, it’d be great if you could join us.