I am new to blockchain and smart contract technology.

I want to understand the overall flow on how decentralized marketplace work. Let's say we have a decentralized marketplace built using smart contracts for listing creation, escrow, etc. Questions:

  1. I assume all the listings are stored on Ethereum blockchain. If so, does that mean anyone who wants to view the listings (clients) need to have Ethereum client running on the machine? Is there a way to not have Ethereum client running on the machine and be able to browse the listings?
  2. What's the difference between building a decentralized marketplace on blockchain vs. P2P approach?

One approach is using a blockchain directly. These markets will place product listing information directly into a blockchain, allowing buyers to reference the blockchain and purchase from there. Another method is to create a network of nodes that all talk to each other directly and don’t reference a blockchain, similar to BitTorrent. Original article

  1. Using smart contracts to achieve decentralized marketplace, is it blockchain approach or P2P approach?
  2. With P2P approach, does that mean you rely your network to run the node and keep the system up? Or anyone with Ethereum node running can do the same?
  3. How do you achieve "searching" if the listings' data are decentralized stored on the blockchain? I see Augur and OpenBazzar have searching function. How did they achieve this?
  4. If I build API for interacting with smart contracts, does that mean my API is not decentralized because it'll be hosted on some server such as AWS or Azure? Will this API be talking to one of the node we hosted on our own?
  5. How does a web client interact with the marketplace? Web client makes API requests then API interacts with smart contract on the node hosted by me?

Any help is greatly appreciated!


Here's a go :

  1. If you're not particularly authenticating to the client and just want to see the data, your ethereum client could be on a website back end system - that way locally you're just browsing the web (and in fact, you could authenticate to your website as well)

  2. If you share the market data via a P2P protocol, pretty quickly you'll want a transaction system so you can establish consistency (see the CAP theorem) between your nodes and consensus on what's happened / who has something to sell that hasn't been sold yet etc. At that point you might as well just use a blockchain.

  3. Smart contracts as they are today need a blockchain to run on. And most blockchains use P2P protocols under the hood.

  4. P2P and Ethereum would need network connectivity. But all of these protocols are pretty resistant to dropouts / being offline. If you were offline for a long time they would need some time to catch up before you could fully engage again.

  5. You can either parse the entire blockchain every search (slow), or have some special nodes whose job it is to constantly parse the chain and pick out the transactions of interest (and probably do some validation too), these nodes could perform local searches of their cut down list of transactions.

  6. Your smart contract can be considered an API in itself ('here's the set of rules for interacting with me'). Or you can design an API layer on top of someone else's interface, that extends it to give you some blockchain functionality, and publish it for the 3rd party to add into their system. Your API will probably be interacting with at least one of the blockchain nodes (via a smart contract, or by parsing the chain data) to do the interesting bits

  7. Yes web client can talk to an API for a function which you or someone else is hosting, that knows how to interact with the blockchain smart contracts. Or they can just go straight to the smart contract (subject to suitable identity system etc).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.