The Future of E-Commerce

By Matin Ghaffari, Wenyuan "Sandy" Chen, Alan Amirian, Yu Huang

Image Description

The emergence of blockchain technology has increased possibilities of decentralization in many industries, one of which is the online marketplace and escrow system. As a decentralized, Ethereum based escrow system, BlockBazaar addresses the issue of trust between unknown buyers and sellers in a digital marketplace by acting as a mediator, through the use of smart contracts, removing the need for human interaction and extra costs.

Via smart contract code, users may have more trust and a greater sense of reliability, as smart contracts are open source and transparent, unlike third party firms that subject their users to rely on often obscure and undisclosed methods. Using an escrow mechanism that requires buyers and sellers to make double deposits, it creates a trust-less system that giving the transactors a strong incentive to complete their arrangement.

In coordination with our smart contract, our application includes a user friendly front end that makes it easy for buyers and sellers to complete transactions, while also providing users with all of the aforementioned benefits of blockchain technology in an efficient and convenient manner.

Back to top

Goerli Test Network: This is the test network where our smart contracts run until our protocol is ready for production. It is a test Ethereum network that replicates the Ethereum Network (EVM - Ethereum Virtual Machine) and uses the test currency we are using, Goerli Test Ether. While we developed our platform completely using the Goerli Test Network, we are using the Polygon Mumbai Testnet for the purposes of our demo as the Goerli Test Network is currently saturated with traffic in anticipation of the upcoming Ethereum update.

Javascript: JavaScript helped us set up and connect our smart contract to our front end, essentially working as the bridge for our decentralized application. In particular, the Node.js and Express.js packages were used for connecting with MetaMask, our database, and our smart contract code.

Remix-Ethereum: Remix-Ethereum is where we write and deploy our smart contract code.

Parse Server: Parse Server is a back end that we used in conjunction with Node.js to set up our database and store all relevant data necessary to complete a transaction. Crucially, no private information is stored here except for the buyer's shipping address that is also hidden in the database.

MetaMask Wallet: The buyer/seller must connect to their MetaMask wallet, in order to utilize the smart contract, as the currency (Ether) and unique ID (public key) are contained in the MetaMask wallet.

Etherscan.io: Prior to the development of our front end, this was the tool we used to run the smart contract and monitor it. However, we can now do all the core functionalities through our front end and we now use etherscan.io as a dashboard to monitor active contracts.


Back to top
Image Description

1. The seller deploys the smart contract via our application with the necessary Ether cost attached to it and sets data on the item's cost, quantity, etc. The smart contract holds the funds and is documented on the etherscan website for the buyer and seller to monitor.

2. When a buyer is found, they confirm their purchase and deposit two times the transaction amount into the smart contract. With both parties double depositing, they will both bear the same risk if the contract is not completed, creating an equally strong incentive for both parties to complete the transaction.

3. After confirming their purchase, the buyer's MetaMask account is automatically connected to the smart contract and recognized as the purchaser. The seller then ships the item to the buyer.

4. The Ether will be locked into the contract until the buyer confirms receiving the promised item agreed upon, at which point the buyer will be refunded half of their input into the smart contract (1x the price of the product). Following this transaction, the buyer is removed from the smart contract.

5. Finally, the seller will refund their stored Ether, to receive their whole input, as well as the revenue generated from the transaction (total of 3x the price of the product to account for the seller's profit and their original deposit).


Contract Execution Logic

Image Description
Back to top

Our platform decentralizes peer-to-peer e-commerce using blockchain and smart contracts for increased security, transparency, and cost-effectiveness; allowing for a trustless marketplace. The combination of our easy to navigate front end combined with our smart contract code makes it a simple process for any individual to safely and securely process transactions without third parties and their overbearing costs and safety concerns.

However, the true limitless potential of decentralization lies deeper in the idea that we can safely eliminate the need for third-party mediation in not only centralized marketplaces but also in other industries such as finance, insurance, real estate, supply chain, gaming, and more. Thus, decentralization promises to be the future in all the aforementioned industries as it quells privacy fears and eliminates unnecessary costs, while putting the decision completely in the hands of the two opposing parties, rather than relying on a third party for anything.

Back to top

Back to top