Is Web3 all hype?

Yash Totla
CryptoStars
Published in
9 min readJan 31, 2022

--

In the beginning, God created Web 1.0. It was an information superhighway of documents connected together by hyperlinks, and it was good. Around 2004 we saw the emergence of Web 2.0, where more people started participating in the web through platforms like Facebook, YouTube, Twitter, and many others. It led to massive centralized tech corporations that dominate the flow of information and money on the internet.

We live in exciting times because we’re at the tipping point of Web 3.0 — a decentralized but secure internet. People can exchange money and information without needing an unnecessary middleman like a bank or tech corporation. Today’s blog is a complete introduction to the wild world of Web 3.0. We’ll take a look at the ecosystem from a high level and try to answer all the stupid questions you’ll have when you first get into it.

Is Web3 all hype, and should I even bother getting into it?

I would say yes to both. There’s obviously a ton of hype around Web 3, but not everybody’s buying it. Even papa Elon said it sounded like bs just a few days ago.

I love the vision of putting the web back in the hands of the people. Still, the reality is that many of these companies and the cryptocurrencies that they issue are controlled by vulture capitalists and silicon valley insiders. That’s not always the case, but much of the industry is propped up by FOMO. There’s a lot of scams and shady stuff to watch out for. Smart people are out there making a compelling argument about how Web3 doesn’t have the computing power, bandwidth, or storage to scale on any practical level.

Initial Token Allocations for Public Blockchains

The shills out there will tell you that crypto is growing faster than the internet was in the 90s. But that’s a dumb argument because crypto is built on top of the internet. You could use the same logic for TikTok. Crypto will never be as revolutionary as the internet was, but that doesn’t mean it’s not going to be a big deal.

Here’s how I look at it. I think the best-case scenario is that it’s like 1992, and things are just getting started. Web3 will grow for another 10 years and completely revolutionize the way the world works. On the other hand, the worst case is that the cryptocurrency bubble has already burst, and as it crashes, it will take Web3 down with it. For perspective, when the dot-com bubble burst, the stock of amazon declined by 90%, and they were one of the lucky companies that actually survived. If ethereum declines 90%, just imagine what that will do to #web3.

Do we even need cryptocurrency to build decentralized apps?

Decentralized tech has been around forever, like peer-to-peer file sharing with Napster back in the 90s or BitTorrent, which has a hundred million monthly active users. That being said, cryptocurrency is still kind of essential because you need some form of payment to build up a creator economy, and banks are not an acceptable solution. It also provides the incentive for people to provide the computing infrastructure that makes the whole thing possible.

How does a decentralized app or dapp on the blockchain work?

Let’s use the ethereum blockchain as our example, although there are many alternatives with different trade-offs out there. Ethereum is a giant network of computers where all the participants agree on the same state of the data across the network. Now ether is the cryptocurrency on the ethereum network, which is used to create transactions that change the state of the data. When you broadcast a transaction, you also offer up a small amount of ether, which incentivizes another computer in the network to execute the transaction. This is also called a gas fee, and conceptually it’s similar to paying AWS for cloud computing resources. If you want things done faster, you pay more gas.

Usually, when you build a web application, you write some backend code then deploy it to a centralized server like AWS. For a decentralized app on the blockchain, your backend code is contained in a smart contract usually written in the solidity programming language. The smart contract is just an application that lives on the blockchain to govern the behavior between multiple accounts. A decentralized app also needs to have a front end that can be built just like a typical website except that user authentication works in a completely different way.

How does user identity work in a decentralized app?

Unlike Web 2.0, the end-user owns all of their data. There’s no need for the developer to collect a username and password. The end-user has a public wallet address to receive payments and a private key that can sign transactions to send payments to someone else. The user can connect their wallet to a browser plugin like Metamask. Your front end application, like a react app, can then interact with that user’s wallet to do something interesting in the UI, like purchasing an NFT.

But what is an NFT? Well, actually, what is a token?

A token is just a digital asset. We already looked at one example in this blog, ether, the currency of ethereum. It’s a digital asset that you can trade with other people, but the cool thing is that developers can create their own tokens in the form of smart contracts. It’s basically just a number in a smart contract mapped to a wallet address. In fact, if I wanted to create my own cryptocurrency, I could do so by writing a smart contract that gives me an initial balance of 1 quadrillion tokens which I can then sell to you for one dollar a pop. Then you sell it to your friends for two dollars, then they sell it to their friends for three dollars, and we all get super-rich.

Now I know that sounds like a ponzi scheme, but everything is a ponzi scheme with the US Dollar being the leader in this space, so there is no need to worry about ethics or anything.

In this example, we’ve created a fungible token which means that one token has the same value as another token of the same size. One coin is always worth the exact same as another coin. Still, tokens can also represent assets that are not exactly alike, like pokemon cards, real estate, digital artwork, and stuff like that. These are examples of non-fungible tokens. Each token is unique and represents a different item which means that its actual market value might be different when you trade it in for some other kind of currency.

You’ve probably seen the NFT craze with entire marketplaces like OpenSea popping up to sell digital artwork as non-fungible tokens, which is an excellent example of a highly polished Web 3 app.

Now I want to switch gears and talk about technology.

What does the front end of a Web3 application look like?

For the most part, it’s not much different than a typical web app. You’ll likely use a UI library like React and all your other favorite front-end tools. Things become different when we start talking about user authentication. As I mentioned earlier, the end-user uses a plugin like Metamask to make their public wallet details available to a decentralized app.

How do developers connect to Metamask?

It’s straightforward because Metamask creates a global object on the browser window that we can use to access details about the wallet. Now figuring out what to do with this data is pretty complicated. Luckily there are libraries out there to make our lives easier. The two most popular options are web3.js and ethers.js. They provide a javascript-based API, making interacting with the end-user and smart contracts on the blockchain easier.

Here’s an example of how the process might look. We create a ‘provider’ with the window ethereum object, which is then used to create a ‘signer.’ You can think of the ‘signer’ as the current user. We then connect to a smart contract. Then change its state, which will require the user’s approval and is based on the logic in the smart contract itself. And that’s all it really takes to initiate a transaction on the front end.

What does the back end look like in a Web3 application?

Well, it’s probably a lot different than what you’re used to as an old-timey web developer. Instead of a server and database like PHP and MySQL, you’ll be writing smart contracts. There are frameworks out there designed to streamline development. Two of the most popular options are Hardhat and Truffle Suite. When you add them to your project, they’ll give you a place to write a smart contract in the solidity programming language.

Solidity is basically an object-oriented language explicitly designed for writing smart contracts on the blockchain. That may sound intimidating, but a project out there called OpenZeppelin provides templates for writing smart contracts that comply with industry standards. This makes it extremely easy to implement reliable code out of the gate.

The other thing a development toolchain will do for you is to provide a script to deploy your smart contract to the blockchain. It’s just a simple node script that signs a contract with your credentials and deploys it to an address on the blockchain.

Now you might be wondering how do I test this code before I deploy it because I have no idea if this thing actually works. That’s another thing that Hardhat and Truffle can help you out with. They can create a testing network on localhost, then generate a bunch of wallet addresses loaded up with fake crypto that you can use for testing. In the browser, you can connect Metamask to your testing network instead of operating on the actual ethereum network. In addition, if you’re building a serious app, you should consider writing automated tests for it. There’s a library called Waffle that can help you do that.

That’s what a basic decentralized app looks like, but one more stupid question you might have is –

Do I store all my data in the blockchain?

The answer is no. It’s not efficient or necessary to store everything in the blockchain, and that’s where off-chain storage comes in. In some cases, data might be too large to store on the blockchain, or it might need to be modified or deleted, which is impossible in a blockchain where all the data is read-only. The most common solution is the interplanetary file system or IPFS. It’s a decentralized way to share files, similar to how BitTorrent works. There are also databases built on top of IPFS like OrbitDB and ThreadDB, which is like a peer-to-peer version of MongoDB.

If you’ve made it this far in the blog, you might be thinking Web3 looks awesome but –

How do I get started?

The easiest way to start messing around with smart contracts is with the Remix IDE. It’s a browser-based tool that will handle all the compilation and everything for you, so you don’t have to mess around with any javascript. There are a couple of excellent YouTube channels that I want to mention. One is HashLips NFT for working with NFTs, and the other is Nader Dabit, just for all-around wisdom related to Web3.

I’m gonna go ahead and wrap things up here. If you have more questions about Web3, let me know in the comments, and I’m curious if you think Web3 is the future or if you think it’s just a big nothing burger.

Thanks for reading.

--

--

Crypto, NFTs, web3, metaverse and everything related to the blockchain