The decentralized Webshop!

Hello World! This is a decentralized webshop that is fully owned by its users, takes no fees and is able to sell you digital items without any intermediate that takes his share of fees! How is this possible you ask? By utilizing different Blockchain technologies! But let us go back a few steps and first talk about the motivation behind this project before we dive into the technical details.

This will be a multi-part explanation serious about the motivation behind this innovative and fun project.

Decentralization? What are you talking about?

You often see mainstream media or high profile technology experts criticizing Web3 projects that they actually lack the promised decentralization.

https://moxie.org/2022/01/07/web3-first-impressions.html

This is often true (sometimes maybe a bit exaggerated). A lot of infrastructure that is required to interact with the various Blockchains rely on centralized actors in the ecosystem. Your Metamask Wallet for example uses API endpoints from Infura (thats basically a service provider Metamask talks to in order to figure out your wallet balances without fully downloading the 600+GB Ethereum Blockchain). But it means if Infura goes down (or decides not to serve your API requests), you won’t be able to interact with the Blockchain. Like it has happened to people from Venezuela in 2022 (Infura reversed this configuration “error” later).

https://twitter.com/infura_io/status/1499446959827931175

Actors like Opensea started to censor certain NFTs from their platform and a lot of services like Uniswap banned wallets that previously interacted with Tornado Cash from using their service like reported by Coindesk.

https://www.coindesk.com/tech/2022/08/22/popular-uniswap-frontend-blocks-over-250-crypto-addresses-related-to-defi-crimes/

So are you saying this is the nail in the coffin for Web3 and everything is hot air?

No, certainly not. That’s the part were mainstream news reports often don’t dig deeper: You can start your own Ethereum node at home and point your Metamask to this node instead of Infuras server and everything is back to normal. The ban from Uniswap also was only affecting their frontend. If you interacted with the underlying Smart Contracts directly or used alternative frontends everything was working just fine (Uniswaps contracts are actually immutable, no one can ever change them).

We must understand that there are different levels of censorship resistance and decentralization in the Web3 ecosystem. If a service throws you out, but you can with medium effort setup a workaround to fully restore your access this is also totally fine! As a developer of a Web3 project you often need to make compromises and take decision on what level of decentralization you want to archive vs. usability considerations.

W3Shop’s commitment to decentralization

The first key challenge of this project was born out of this: what level of censorship resistance and decentralization can be, as of today, archived without cutting into usability. This is especially important as this shop should make sure once bought items remain accessible by the customers. Nothing would be more frustrating if you suddenly lose access to once bought digital items over time.

How does W3Shop archive this?

Okay, now it is getting a bit technical…

Every technology that is used for the project is evaluated against certain security aspects and if it would stop working if a single entity is compromised. It is also taken into consideration of how easy it would be for a user to circumvent a possible outage by spinning up some hardware on his own and how high those requirements would be (no one would spin up a 2000$/month server to access his bought shop items).

It was clear from the beginning that the W3Shop will be a browser only dApp and that all of its functionality must be archivable by wallet interaction alone (why this was not 100% archivable we will see in an upcoming blog post).

If a certain technologie requires a central backend to interact with, this is a big red-flag for this project. Especially if a core functionality is provided by it (if the shop would still work without it, in theory that could be considered, but mostly is impossible as this is a front-end only application).

The project is a single page front-end application that fully runs in your browser. It is not even hosted via the DNS system which in itself is centralized (this is a system that translates URLs like google.com in a machine-understandable number to fetch data from a central server).
W3Shop uses a so called ENS domain. This is similar to the well-known DNS system, but instead relies on smart contracts on Ethereum to resolve human readable names into addresses for machine communication.

If you use a IPFS/ENS enabled browser (like Brave, or Chrome/Firefox with certain extensions installed) and enter the address ipfs://w3shop.eth in your address bar, the Ethereum blockchain is queried and the data is transferred from the IPFS network. This means in theory the webpage’s content does not need to live on one single server but instead a network of multiple sources can provide you with the data of your request.

If you only use a regular browser, the alternative would be to access the shop via https://w3shop.eth.limo. This request uses the Limo Gateway to get the website content. Of course this is again a single point of failure. But was deemed acceptable because you can run your own gateway or just use another browser.

In case everything stops to work, you can also directly start the frontend locally on your home PC (there are actually plans to later build a desktop app from the software to make this even easier for non tech savvy users).

In the next article we talk a bit about the rest of the tech stack, like how the saving, encryption and access to the digital goods is managed. Follow on Twitter so you don’t miss it!

--- You did not fully understand every detail from this post or have feedback/questions? Feel free to reach out via Twitter or on Orbis.

https://twitter.com/w3shop_eth

https://app.orbis.club/group/kjzl6cwe1jw148g91hce2elv8hiktmbs2bppox00qtenvu1k73jlqa7yxmle7e0

If you want to contribute the the development or just curious about the code base, feel free to check it out on Github, it is open source!

https://github.com/tfelix/w3shop