DevTeam.Space Product Development Blog

Explore our in-depth product development tutorials and new technology announcements published by our software development experts

All articles

How to a Build a Blockchain Social Media Platform for Bloggers?

When you signed up for that Facebook ID, you thought it’s free, and believed when Facebook said it will remain free. I don’t think you knew that one day, Cambridge Analytica would steal 87 million Facebook users’ data for psychographic targeting of these users, which could include you. Read about the probes Facebook faces over it in “Facebook Cambridge Analytica Scandal: 10 Questions Answered”.

For that matter, you also didn’t know that Facebook would censor contents. Many didn’t know this, and when the extent of censorship became clear the market expressed their concerns. Read how the market reacted to Facebooks’ censorship practices in “Facebook stock tanking over censorship: Diamond and Silk”.

Would you log in to Facebook if an empty feed greets you, i.e. no one creates any content? You will likely not. Facebook doesn’t create any content, their users do, and that’s why you sign in to Facebook. Note that Facebook doesn’t pay their users for creating content.

You can change this lop-sided equation using blockchain. I will show how to build a blockchain social media platform for bloggers, in this article.

Contents

What is a Blockchain-Based Rewards Platform
Blockchain-based rewards platform features
Examples of decentralized social media platforms
Different approaches to developing a social-media platform on blockchain
Blockchain-based rewards platform development using the Sola platform
Create a blockchain-based rewards platform using the “Steem.io” APIs
Blockchain-based rewards platform development using Loom Network SDK

What is a Blockchain-Based Rewards Platform

You can create content that engages your viewers and attracts them to the platform and you get paid for it! It’s possible, but the Facebooks and Twitters of the world never told you so. You can also run a social media platform without those annoying ads. And, by the way, your content remains yours, and someone else can’t plagiarize!

Sounds too good to be true? But it’s already shaping up as the next social-platform reality! Blockchain allows decentralization, hence a Facebook or Google can’t hold the control over what you post. The technology enables immutable records, so when you have established your ownership over content, none can change that.

Blockchain also allows building new business models with smart contracts and DApps, so you can get paid if your content engages users. Since the user engagement drives the economic activity, the ads aren‘t needed!

So, in summary, a blockchain-based rewards platform is where you create content engage viewers without censorship, and you are paid for your content. Read more about it in “6 Ways the Blockchain is Revitalizing Social Networking”.

Blockchain-based rewards platform features

As you can well imagine, disrupting a Facebook isn‘t easy! A blockchain social network must have the following features to become a viable alternative:

  1. Content creators producing engaging content must get rewards, and it should be proportional to the engagement their content creates. Currently, if you publish a great article on LinkedIn, you get no reward. LinkedIn earns from ads though.
  2. Developers that bring improvement to the platform must receive rewards for their efforts.
  3. Censorship-resistant: Repressive regimes routinely deny their citizens the right to access content that the regime considers sensitive. A blockchain-powered social media must resist such censorship.
  4. Decentralized vetting of content to ensure authenticity: The platform must enable users with subject matter expertise to certify if a piece of content is genuine. Fake news is a problem in the centralized social media, and decentralized ones must empower their community to prevent this.
  5. Users must be in control of their data to prevent Cambridge Analytica-like scandals. Blockchain social media privacy will pave the way to the emergence of new, much more ethical and user-friendly social media networks which put the protection of sensitive personal information first.
  6. Digital rights management: Content creators should be able to protect their rights over their content.

Read more about the desired features in a blockchain-based social media platform in “How The Blockchain Can Solve Social Media’s Biggest Problems”.

Examples of decentralized social media platforms

Blockchain start-ups have already set the ball rolling. Following are a few examples of decentralized social media platforms. It‘s not an exhaustive list.

Sapien

Sapien is an Ethereum blockchain-based decentralized social media platform focusing on news. They meet the criteria I described above, and provide the following features:

  • Public or private browsing;
  • Subscription to branches according to interest;
  • Users can add friends, create groups, post content, and comment on content that the others post;
  • Chat facility;
  • Data encryption including that of chat;
  • Users can customize their settings.

They use the SPN crypto token.

Steemit

What is Steem blockchain?

It’s basically a social blockchain which powers Steemit, an incentive-based, peer-to-peer social media network.

We could say that it’s your regular platform, like Reddit, while the main difference lies in the fact that Steemit operates on a decentralized social network blockchain basis. Their specialty is that they enable content publishers to monetize their content so that the publishers can get rewards.

It‘s a points-based system, however, the points here are crypto tokens tradable in crypto markets. Users get their tokens in any of the following ways:

  • Posting content;
  • Voting and curating others‘ content;
  • Purchase STEEM tokens by simply exchanging their Bitcoin or Ether in several crypto exchanges;
  • Vesting their STEEM tokens for powering up the network and earning fees from that.

Users spend significant effort to create engaging content and building community can earn a significant number of tokens. The blockchain-based social platform implements a user verification process before allowing users to open accounts.

Sola Platform

Unlike many social media platforms, “Sola Platform” doesn‘t use a ’Follow‘ concept. Instead, they will use a combination of blockchain and Artificial Intelligence (AI) to make your content viral to a wide user-base. The AI component will be released in Q3 2018.

This blockchain social media platform gets its revenue from ads, user payments, and partnership, which they share with their users. They use their SOL crypto token. The decentralized blockchain rules out censoring and security risks.

Sola has Android and iOS mobile apps, besides their web app. They have released their APIs earlier this year, hence developers can build their own apps around Sola.

Indorse

Indorse is like LinkedIn, however, it‘s blockchain-based social media and therefore, it’s decentralized. Users would need to submit proof of their skills when they make a claim.

The proof can be their GitHub repository or similar artifacts. Indorse uses a decentralized verification process to endorse skills.

It‘s built on the Ethereum platform and uses the IND token to reward users for their activities on the network. Indorse also uses modern protocols like InterPlanetary File System (IPFS), BigchainDB etc.

Different approaches to developing a social-media platform on blockchain

I will describe three approaches to help you build a blockchain social media platform, as follows:

  1. Develop using the Sola platform and their APIs.
  2. Use Steem.io APIs to develop a decentralized social media platform. Please note that some of their APIs are still under development, and you need to hand-code those functions.
  3. Use Loom Network SDK to build a decentralized social media.

In the 1st and 2nd approaches, you need to design and develop the UI/UX for your app from scratch.

Blockchain-based rewards platform development using the Sola platform

In this approach, you need to get SOL tokens and set up your user credentials in the Sola platform. You need to start in Sola developer portal.

You need to register your app, for which the Sola portal will provide you an OAuth App ID and a secret key for each of your apps. Please read their platform usage policies in detail, and pay special attention to their policies related to plagiarism, harassment, user data protection etc.

Sola platform allows you to write apps that read user data or write objects. They call these ’read‘ and ’write‘ scopes, respectively. However, apps can‘t access user chats or money-related requests.

The methods you use in your apps all require an authorization, and you need to pass session tokens for this. You can pass request parameters as JSON or as GET parameters in URL. Read more about it in their API general concepts page.

Sola APIs will always return responses in JSON format, and they use the industry-standard HTTP response codes. Their API documentation lists the error codes and you can get a list of these in their API “error codes” page.

Now, I will describe a few API categories in detail, with the objective of explaining to you how they have categorized their APIs. Once you study a few of them, you will see the pattern and then take a deep dive into their entire API library.

Media upload

Sola APIs don’t support external media links, and you need to upload all your media content up front in their CDN repository. Check out the required commands in their API page for media upload. Sola also uses Websockets for managing real-time events and notifications.

Authentication

You can achieve OAuth authentication using any of the following options:

  1. By supplying the client credentials, where you need to pass app ID, app secret key, and app scope (for e.g. ’read‘, or ’write‘).
  2. By providing access token, where you need to provide app ID and app scope.

Consult the API page for authentication for command formats.

User functions

As a next step, you need to enable the user-related aspects of your app, for e.g. user settings, user profile update, etc. Sola provides the following APIs for this:

  • GET option for user settings, user metadata, user profile, and user profile-by-slug;
  • Update user profile and user settings, using the PUT option;

Read their API page for user functions, for code, parameters, and response code details.

Channels and their prioritization by users

Your decentralized social media app needs to show channels that users consider popular and have prioritized. The Sola platform provides the following APIs for this purpose:

  • GET:
    • Users who prioritized a channel;
    • List of prioritized channels;
    • Prioritized user list;
    • All priorities list;
    • Users that have prioritized a particular user.
  • PUT:
    • Prioritize channels;
    • Prioritize users.
  • DELETE:
    • User priorities;
    • Channel priorities.

Read their API page for priorities for a description of the APIs they have here.

By now, you have seen how the Sola project team has categorized their APIs for various social media app functions. I recommend that you study in detail the other APIs they have, which are as follows:

  • Blocks;
  • Mutes;
  • Alerts;
  • Feed;
  • Posts and drafts;
  • Topics;
  • Endorses and skips;
  • Subscriptions;
  • Comments;
  • Polls;
  • Channels;
  • Activities;
  • Popups;

They have created comprehensive API documentation. I recommend you go through it, to understand how you will make the API calls for services your app will consume.

Create a blockchain-based rewards platform using the “Steem.io” APIs

This approach could be harder than the first one because a few “Steem.io” APIs are still under development. In this approach, you will develop your decentralized social media network on the Steem blockchain.

Select your development library

An advantage with “Steem.io” APIs is that they give you the choice of popular programming languages. You may have JavaScript or Python developers in your team, considering these are programming languages of choice for many. With Steem, you can develop using these languages.

Additionally, you have “Steemit.com” endpoints to get common data, for e.g. user profile and post JSON data. They also have a tool called “SBDS” to query the data in the Steem blockchain. Read more about this in their Quick start library page.

Choose blockchain node

If your application intends to interface directly with the Steem blockchain, then it needs to connect to a “Steemd” node. You can choose from a list of public API nodes they provide or run your own node.

You will need to synchronize with the blockchain. Check out their Quick start library page for more details.

Using Steem testnet

Using “Steem.io” APIs to build your social network is harder because you need to set up their Steem testnet. To do this, you need at least some system administration skills, besides you need to understand the concept of containers like Docker. However, if you follow their GitHub build procedure for testnet, it should help!

Consult “Steem.io” tutorials

Assuming you have JavaScript, Python, or Ruby developers on your team, you should go through the appropriate tutorial the “Steem.io” project offers.

For each language, they have categorized their tutorials by different social media platform functions, for e.g. blog feed, get post comments, submit comment reply, etc.

Following are their tutorials, consider exploring them in detail:

“Steem.io” services

“Steem.io” project offers various services, as follows:

  1. SteemConnect”: Enables secure connection to the Steem blockchain via 3rd party app.
  2. ImageHoster”: This is an image hosting service that Steem provides. If you have used an image from a 3rd party service, and if it goes down, thanks to “ImageHoster” you will still have the image.

“Steem.io” APPBASE APIs

Note that many “Steem.io” APIs are currently under development. When complete, the APPBASE APIs will include the following:

  • Account-by-Key;
  • Broadcast-Ops-Comments;
  • Account history;
  • Database;
  • “Follow”;
  • “JSONrpc”;
  • Market-History;
  • Network Broadcast;
  • Tags;
  • Witness;
  • Block;
  • Broadcast-ops.

However, to enable the developers to still with the “Steem.io” APIs, the project team has created a “Condenser API”. While they develop their remaining APPBASE APIs, you can continue to code your app with changing the API calls to refer to the “Condenser API”. Read more about it in their “Condenser API” page.

blockchain-based rewards platform development using Loom Network SDK

Loom Network, a blockchain start-up has developed ’Software Development Kits‘ (SDKs) for several use-cases, e.g.:

  1. You can build your Ethereum DApps on sidechains that are attached to the Ethereum blockchain network. These are called DAppChains, and you can customize it to set your own rules. For e.g., if you DApp requires lower security features, you can use the ’Proof of Stake‘ (PoS) consensus algorithm. This can help in scaling your DApp. Read more about it in “How to Scale an Ethereum Dapp”.
  2. You can develop a blockchain-based game using their ’Unity SDK‘.

They also have created a sample social media app, which is for a demonstration purpose and has limited features.

You need to take the following steps to implement this app and run it:

  1. Set up and run your own DappChain.
  2. Run ElasticSearch and Redis. You need a fast database service; hence you need this.
  3. You now need to run a service called “Indexer”. It gets all events from smart contracts and builds a message queue. This will feed ElasticSearch and Redis.
  4. For your frontend, you need a web server, and now you need to start it.
  5. Now you can run this app. The smart contract for the sample app is in the Loom Network Solidity Social Network sample GitHub repository. You can build your own by taking ideas from it.

Check the Loom Network Simple Social Network Example page for code snippets and commands that you need to use.

To summarize, I have described 3 approaches to building a blockchain-based social network, as follows:

  • The approach using the Sola platform is the most workable.
  • You will need to build some amount of system administration and Docker container skills in your team, to use the “Steem.io” API approach. Hence, it is harder.
  • The approach using the Loom Network SDK has a simple app already built-in. Depending on the complexity you need in your app, you will likely need to code several more contracts. You will likely have to code more front-end UI/UX components.

Your cost of building a blockchain-based social media platform will vary depending on the complexity you are planning. It will also depend on the development approach you take.

For example, to access some of the platforms, you will need to buy their tokens. The “Steem.io” approach is likely to be costliest, because of the additional skills you need to have in your team. Your cost will also depend on the manpower cost in your geography. Take professional help if you need to.