How to Build Online Blockchain Marketplace Like OpenBazaar?
Latest posts by Aran Davies (see all)
- How Many People Does It Take to Form An iOS App Development Team? - 1 Aug, 2022
- How Many People Does It Take to form An Android Development Team? - 29 Jul, 2022
- How to Make a Machine Learning Game? - 26 Jul, 2022
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:
- Origami Marketplace: It‘s a platform with four modules, and these are:
- Core API;
- Admin portal for sellers;
- Admin portal for operators.
- Origami payment: Following are its‘ features:
- Secure escrow payments, suitable for both eCommerce and online marketplaces;
- An easy-to-use app and APIs that are secure and can be integrated easily;
- It accepts Bitcoin, Ethereum, and Origami Tokens (ORI).
- 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:
- The backend code must run on a decentralized blockchain.
- The code is open-source.
- The app operates autonomously.
- While you can code the frontend in any language, the backend code must be smart contracts.
- It must use a crypto token.
- No one entity can control the majority of tokens.
- A consensus among users decides the future changes to the app.
- A standard cryptographic algorithm like the ’proof of work‘ (POW) must be used to create the crypto token.
- 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:
- UI/UX, to design the interfaces that buyers and sellers will use.
- Blockchain distributed apps (DApps) and smart contract development, to build the marketplace using blockchain;
- 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:
- “Ethereum Development Tutorial”;
- “Basic Solidity Course” for learning Solidity, i.e. the proprietary language to code smart contracts in Ethereum;
- “DAPPS FOR BEGINNERS” website, which has valuable resources for developers building DApps.
Create your Ethereum account:
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:
- EOA: people joining their network open these;
- 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.
- Install ’testrpc‘, i.e. the blockchain client we will use in this guide for Ethereum DApp development.
- 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.
- It’s part of the Truffle toolset. Follow their GitHub instructions to install and use it.
- Install ’web3js‘, i.e. the tool to communicate with the blockchain network.
- This is an easy tool to use, there are specific instructions to configure files such as ’aconfig.js‘.
- You can also configure web APIs for communicating with blockchain easily by following instructions.
- Read their GitHub instructions to install and configure it.
- Install ’Truffle‘, i.e. the tool we will use to test and deploy smart contracts.
- It provides you with folders to maintain your smart contracts.
- 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.
- You can deploy your smart contracts easily with this tool.
- 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”.
Hire expert developers for your next project
1,200 top developers
us since 2016
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:
- Automatic execution of code without any intervention.
- The execution and outcome are verifiable on a blockchain.
- You can‘t alter the code.
- 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:
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:
- Transfer Ether to another address;
- Call a contract function that updates the network state;
- 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:
- Accept digital currencies like bitcoin payment integration;
- Build your own cryptocurrency and wallet for use in this marketplace;
- 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:
- 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.
- 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.
- 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
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.
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.
• IBM blockchain
• Hyperledger Fabric