How to Build Online Blockchain Marketplace Like OpenBazaar?

Build online marketplace on blockchain

Interested in knowing how to build an online blockchain marketplace? 

This is an important market that needs to be explored.

Build an online blockchain marketplace using the Origami platform:

The Origami Network is built on the Ethereum blockchain, and this protocol gives you readymade tools to build a blockchain marketplace. Their tools include:

  1. Origami Marketplace: It‘s a platform with four modules, and these are:
    1. Core API;
    2. Front-office;
    3. Admin portal for sellers;
    4. Admin portal for operators.
  2. Origami payment: Following are its‘ features:
    1. Secure escrow payments, suitable for both eCommerce and online marketplaces;
    2. An easy-to-use app and APIs that are secure and can be integrated easily;
    3. It accepts Bitcoin, Ethereum, and Origami Tokens (ORI).
  3. Origami review: Customers that have completed orders can post a review. They need to sign with their private and certified key. Approved reviews are awarded ORI tokens. Sellers can carry their positive reviews on all marketplaces in which they sell.

Companies have already built online marketplaces using this platform. Check out their code on GitHub and get started building your own Blockchain-Based Marketplace like OpenBazaar.

Blockchain marketplace development from scratch:

Developing from scratch is far more complicated.

To simplify your development, I recommend the approach of developing the marketplace as an Ethereum Distributed App (DApp). You can use the popular Ethereum blockchain platform to create this.

You will need to get an Ethereum account and wallet. Then you need to code digital smart contracts. Subsequently, you can then code a DApp that will use smart contracts you have just created.

You will be able to use Ethereum’s native cryptocurrency, i.e. Ether (ETH) for this DApp. If you need to see some examples of Ethereum DApps, visit the “State of the DApps” website.

The reason I recommend this approach is that you can develop your ’minimum viable product’ (MVP) quickly. You don’t need to create a new network, blockchain, cryptocurrency, or wallet.

What is a DApp?

DApps are applications that fulfill all the following criteria:

  1. The backend code must run on a decentralized blockchain.
  2. The code is open-source.
  3. The app operates autonomously.
  4. While you can code the frontend in any language, the backend code must be smart contracts.
  5. It must use a crypto token.
  6. No one entity can control the majority of tokens.
  7. A consensus among users decides the future changes to the app.
  8. A standard cryptographic algorithm like the ’proof of work‘ (POW) must be used to create the crypto token.
  9. You must store the data in a blockchain adhering to cryptographic standards.

Read more about it in “What is a Decentralized Application?”.

A team to develop a decentralized marketplace on a blockchain?

You need a development team with the following skills:

  1. UI/UX, to design the interfaces that buyers and sellers will use.
  2. Blockchain distributed apps (DApps) and smart contract development, to build the marketplace using blockchain;
  3. Testing;
  4. Project management with experience in blockchain development projects.

Note: Some of these are niche skills. If you can’t build such a team, consider engaging development companies with relevant expertise.

I recommend the following learning resources for your team:

  1. Ethereum Development Tutorial”;
  2. “Basic Solidity Course” for learning Solidity, i.e. the proprietary language to code smart contracts in Ethereum;
  3. DAPPS FOR BEGINNERS” website, which has valuable resources for developers building DApps.

Create your Ethereum account:

A graphic representation of an online marketplace and its elements

Since you are building your blockchain-based marketplace on peer-to-peer networks, for example, on Ethereum, you need to first create an Ethereum account. Ethereum has two types of accounts, as follows:

  1. EOA: people joining their network open these;
  2. Contract accounts: These have smart contracts;

You need to open an EOA. I recommend that you use ’eth-lightwallet‘ by ConsenSys since you can easily generate the private key-public key pair with it. Read the “eth-lightwallet” documentation on GitHub for more instructions.

A word of caution here: never share your private key with anyone, and don‘t upload it to any website or the cloud storage providers. Malicious actors can steal your Ethers if they get hold of it. Once they are gone they are next to impossible to get back.

Install tools to build Ethereum DApp:

To make your own marketplace on the blockchain you need to first install tools to build DApp.

  1. Install ’testrpc‘, i.e. the blockchain client we will use in this guide for Ethereum DApp development.
    1. It’s easy to use and has a command-line interface (CLI). The default setting is not to mine blocks, but you can set block intervals using the CLI for development purposes.
    2. It’s part of the Truffle toolset. Follow their GitHub instructions to install and use it.
  2. Install ’web3js‘, i.e. the tool to communicate with the blockchain network.
    1. This is an easy tool to use, there are specific instructions to configure files such as ’aconfig.js‘.
    2. You can also configure web APIs for communicating with blockchain easily by following instructions.
    3. Read their GitHub instructions to install and configure it.
  3. Install ’Truffle‘, i.e. the tool we will use to test and deploy smart contracts.
    1. It provides you with folders to maintain your smart contracts.
    2. You can easily combine this with your testing framework. It has scripts that will deploy smart contracts in the test environment, and run ’Truffle‘ tests. Of course, you can run regular tests too.
    3. You can deploy your smart contracts easily with this tool.
    4. Read their GitHub instructions to install and configure it.

You need to update your ’config.js‘ file before you proceed further. Open ’testrpc‘ and run an instance. Update your ’config.js‘ file with the public and private key information from your ’eth-lightwallet‘ wallet.

You can now communicate with the blockchain network. Read more about updating ’config.js‘ and communicating with blockchain networks in “Getting Started as an Ethereum Web Developer”.

Code smart contracts:

I assume that you have already created the UI/UX in your journey to create an online marketplace based on decentralized Blockchain technology. You now need to code your smart contracts.

A smart contract is a piece of code running on a decentralized blockchain, which enables functions like taking control of an entity based on conditions. It uses “If-Then-Else” conditions and automates the transfer of assets, for e.g. cryptocurrencies. Read more about them in “What Is A Smart Contract?”.

A smart contract must fulfill all of these criteria:

  1. Automatic execution of code without any intervention.
  2. The execution and outcome are verifiable on a blockchain.
  3. You can‘t alter the code.
  4. You can‘t reverse the execution results.

You need to code them using Solidity language. Keep the code simple. The more processing logic it has, the higher will be the computing power requirement. Also, since the code is immutable and the outcome is irreversible, you need to avoid bugs, which is another reason to keep the code simple.

I recommend that you check out the smart contract templates that CyberMiles have developed. These are suitable for eCommerce, and you might find them useful for your Peer-To-Peer marketplace powered by blockchain.

Test, deploy and run smart contracts:

A stylized illustration of a handshake

Use ’Truffle‘ to test and deploy your smart contracts. You need to invoke smart contracts using hexadecimal strings. Get help in Ethereum contract ’application binary interface‘ (ABI) libraries on this.

Buy some Ether and store it in your account. Execute any of the following types of transactions with your smart contracts:

  1. Transfer Ether to another address;
  2. Call a contract function that updates the network state;
  3. Call a function that updates the network state and accepts payment.

You will need to pay some miner fees, so budget Ether for that. Read more about testing, deploying, and executing smart contracts in “Getting Started as an Ethereum Web Developer”.

You have built your blockchain-based marketplace MVP!

Following are a few optional enhancement projects:

  1. Accept digital currencies like bitcoin payment integration;
  2. Build your own cryptocurrency and wallet for use in this marketplace;
  3. Add a decentralized cryptocurrency exchange to your marketplace.

The cost to build the Blockchain-Based marketplaces:

The cost to build a marketplace on blockchain MVP will vary depending on your geography and associated manpower costs. Also, note that Ethereum DApp development is a niche skill and it’s hard to find experienced developers because they are in high demand. The manpower cost may go up because of this.

I recommend that you budget 5-7 resources for a duration of 2 months while factoring in that the project initiation and deployment phases will require fewer resources. I also reiterate that you should take professional help if you don‘t have the relevant skills in your organization.

Examples of online decentralized marketplaces:

Check out the following decentralized online marketplaces to get an idea of what features your audience is currently using in online markets based on the blockchain as compared to the traditional marketplaces:

  1. OpenBazaar: It‘s the most famous and frequently discussed platform for a blockchain-based marketplace. A group of developers built it in April 2014 during a Bitcoin Hackathon in Toronto. Later other developers took it up and received venture capital (VC) funding.
  • All users on this platform have a personal keypair.
  • They use it to digitally sign transactions and to anonymize data.
  • It‘s an anonymous marketplace.
  • They use escrow contracts that require multi-signature from both buyer and seller. Funds are released only if both of them sign. Read the Bitcoin Stack Exchange thread “How do I use Multisig transactions to handle escrow needs?” to know more about this technology.
  • Read their open-source code on GitHub to study the project in detail.
  1. ModulTrade: A marketplace that helps small businesses to grow their global trade, they solve a crucial problem that these businesses face.
  • There is often a letter-of-credit requirement for global trade, and banks or third-party financial services charge high fees to act as an escrow. Small businesses often find their trade financial proposals being rejected. ModulTrade uses smart contracts that will do the job of escrow and let small businesses trade globally.
  • Check their open-source code on GitHub to understand the platform better.
  1. Ink Protocol: This network allows sellers to bring their reputation from other marketplaces so that they can sell easily.
  • It’s typically hard to sell in online marketplaces unless you have a good reputation. In the centralized world, it isn’t possible to use a reputation built on one marketplace in another. Ink Protocol makes it easy.
  • Their reputation system uses proof of payment. The buyer can leave feedback for the seller including a rating and comment after every transaction.
  • The feedback with the transaction ID is open for all to see in the public Ethereum blockchain.
  • See their open-source code on GitHub to know more about the project.

That’s about it. With these tools, you can create your very own blockchain-based eCommerce marketplace.

Planning to Build a Blockchain Marketplace?

This guide gives a comprehensive overview of building a decentralized online marketplace app. However, blockchain technology is relatively new. Implementing blockchain technology and carrying out DApps development successfully requires a special skill set. 

If you are lacking expert DApp development skills in your team, take a look at the experienced blockchain developers community at DevTeam.Space. You can partner with these skilled software developers by filling out this quick form with your initial blockchain development requirements and one of our technical managers will get back to you for further assistance.

Frequently Asked Questions

What is a Blockchain marketplace?

It is an online shopping marketplace that is run from a blockchain with decentralized hosting rather than a single central authority. Data is held on a set of decentralized computers or nodes and is stored in blocks that are linked in sequence to form a chain. Blockchains applications are in various sectors including supply chains, business processes automation, etc.

How do you create a Blockchain website?

You will need to write the code for your website and do a code audit to ensure it is without bugs or errors. Once you have completed it, you can publish it on a blockchain platform such as Ethereum.

Which Blockchain platform is the best?

• IBM blockchain
• Hyperledger Fabric
• Ethereum

Tell us about your challenge & get a free strategy session

Hire Expert Developers
clients
banner-img

DevTeam.Space is a vetted community of expert dev teams supported by an AI-powered agile process.

Companies like Samsung, Airbus, NEC, and startups rely on us to build great online products. We can help you too, by enabling you to hire and effortlessly manage expert developers.

LinkedIn LinkedIn Facebook Facebook Twitter Twitter Facebook Messenger Facebook Messenger Whatsapp Whatsapp Skype Skype Telegram Telegram