Using Drupal to enable Semi-Decentralistaion of Ethereum Dapps

Drupal and Ethereum

Full web app decentralisation is hard, it has limitations. I would like to explore semi-decentralisation of Ethereum dapps (decentralised apps) using Drupal.

EthTweet - „a decentralized Twitter“ was a project by Yep that I created a front-end for last year (ethTweetUi). It's a very simple decentralised app, which enables users to create uncensorable and undeletable tweets.

In the current state It has a simple registry for EthTweet usernames and their list of tweets. It might not be the smartest architecture, but it is very simple to understand and implemented in as a standalone „onepage app“Angular2 using Angular2 using the Ethereum Web3.js library. It potentially could be implemented as a native App with a cross device library like phonegap.

Limit's of decentralisation

In its current form, EthTweet is read-only and tweeting is done via geth command line. It does not support two essential features of Twitter, which are not possible to implement in a fully decentralised way: Referencing Users (e.g: @digitaldonkey2009) and referencing Hashtags (e.g: #devcon2).

You could implement these features by pulling all users and tweets into a local database. But this would not scale, taking into consideration that there are millions of Twitter users creating billions of tweets every day. Implementing this functionality within a decentralised app would be limited by local storage or local databases in web browsers or phone apps if the service became popular.

To solve this all EthTweet user info and tweets from the blockchain could be put into an external database to enable search indexing. For example you'd want to be able to see all tweets containing the hash tag #devcon2 or list all tweets referencing a certain user. This requires to be implemented in a non-decentralized way using any web technology working with databases.

Building a semi-decentralized Search server

Using a open source/GPL implementation of an „EthTweet-search server“ we could call this a „semi-decentralised“ application: Every one with limited web programming skills could set up their own instance of this search server. It would run on any webserver or even on a desktop computer, if the legal regulations of a country does not allow „uncensorable“ public tweeting.

Here is where Drupal could come in handy. Drupal is the „big brother“ of Wordpress. It has a very large community of highly professional web developers implementing large and high-traffic publishing websites like weather.com or whithouse.gov and an avid GPL sharing culture. Drupal conferences are attended by 10,000 professionals every year. The founder of Drupal, Dries Buytaert, tweeted „What could the Blockchain mean for a CMS like Drupal?“ some months ago.

Technically

With a connection to any Ethereum node a Drupal module could easily mirror any tweet published on the Ethereum blockchain and make it searchable with existing Drupal extensions. This can provide a reference to tweet-strings on the blockchain so that users can verify the integrity of their content. With JSON Data-Services implemented in Drupal 8 core you could fuel any EthTweet app or webpage with an instance of Drupal providing the mirrored data from any domain easily.

This would enable users worldwide to access EthTweets either by accessing an existing web domain as a datasource or just implementing their own instance of the service by setting up a Drupal instance and enabling this proposed open source GPL module which would provide the data service. In the EthTweet dapp a swappable dataprovider url could be changed according to local availibility of indexing-servers.

Conclusion

The described problem may reappear in other dapp's requiring to process large amounts of data from the Blockchain and it would be great to improve the Drupal Ethereum module to cover this kind of use cases.

Beside the search use case I can see more applications why I vote for connecting Drupal with Ethereum. Which I will cover in future posts.

 

Feedback is welcome at groups.drupal.org/ethereum