Hi bro, what the heck is going on with Web3

12c3a974476979ca5ee0b53c2a68cfc6.png

To those who are half-understood: the knowledge in this article, if you explore it yourself, it may take half a year, a year or even longer to understand. This article tries to make you build a reliable cognition within half an hour.

Another: The example of the blockchain in this article is mainly Ethereum, and the two words are sometimes mixed. Please identify yourself.

Q: Hi, brother, Web3 is very popular now. I have read a lot of articles on the Internet, but I still can't figure out what Web3 is. Please tell me about it.

You can't read those articles because most of those articles are propaganda, and they don't teach very basic things.

Essentially, Web3 is a technical thing that needs some technical explanation.

If you stay on the surface, you will never grasp the substance.

Q: So, man, what exactly is Web3, I remember there was Web3.0 in the past, are they related?

Now (2022) what people call Web3 is no longer the Web3.0 that was proposed a few years ago. Obviously, since the advent of Web2.0, many technologies claim to be Web3.0, some of which are endorsed by celebrities.

There used to be popular sayings: Web3.0 is the Semantic Web; Web3.0 is the Internet of Things; Web3.0 is the Internet + artificial intelligence; Web3 is the Internet + virtual reality, etc., but because none of them have achieved substantial success, These claims have since been largely receded.

In the past two years, what people have said about Web3.0 basically refers to the Internet + blockchain + DApp (decentralized application). Moreover, it may be to clear the relationship with the previous Web3.0. The current name is basically Web3 . (Actually, minor version numbers don't help either)

Q: I said, why does this Web3 feel a little hot?

The main difference between Web3 and the previous Web1 (web page display) and Web2 (user-contributed content) is that users have a sense of security for their digital assets:

Unless I agree, no one can take away or change my data assets.

Previously, large corporations and governments had control over users' data. After all, the data is in the company. In theory, they can change it as they want, and delete it as they want. There is no way for users to do so.

Moreover, for the overlord terms of the website, users are often weak and have no bargaining power. The website uses your creation to attract customers and traffic, but you cannot share the benefits, or can only get meager returns.

From this point of view, Web3 is revolutionary:

At Web3, not only do companies no longer have control over your data, they also have no control over your earnings.

Something so valuable, and in its infancy, can you say people can't get excited.

Q: Why is this happening? Does the website no longer have control over its data?

Because the most important data is no longer in the website's database.

The most important data is on the blockchain.

You must know a little about the data security of the blockchain. First, no one can change the data. Second, assets cannot be transferred without the private key.

And the private key is only in your hands. (You have to take good care of yourself, keep your eyes open!)

Q: Why are websites willing to put data on the blockchain? Isn't it delicious to store it in its own database?

If there are two websites that provide the same function, one is traditional technology, and the other provides trusted data asset protection, but also allows people to benefit, which do you think people will choose?

That's why OpenSea.io stands out.

Q: How does OpenSea do this?

Users upload their own pictures, put a price on it (list), or wait for others to bid (offer).

If someone buys, OpenSea charges 2.5% of the transaction price as a handling fee.

In addition to making a profit from the first transaction, the author of the picture can still get 2.5% of each subsequent sale of the work (no matter how many times) (this value can be set as high as 10%).

The business logic of OpenSea itself is written as smart contracts and placed on the blockchain, so the security of data is protected by the blockchain.

The rights of the image owner are protected by the private key.

Moreover, all transactions can be publicly queried on the blockchain.

Websites using traditional technology cannot do this.

OpenSea will still have business logic bugs or website technical bugs, but the blockchain protects the most important things.

Q: What does the private key look like? Can you take a look at it?

0x96e716aac85c9bb67adcdff650379304cb2caf9df3cb88b39aedfd58da530db9

This private key is only temporarily generated by me, do not import this private key into your wallet because it has been exposed.

Q: Is the private key so long? How do you remember this?

Private keys are generally managed by wallets (such as MetaMask), and you don't need to remember them.

Regarding the backup or recovery of private keys, there are many mature solutions and precautions, which will not be discussed here.

Q: That's all? Is this exciting?

What's exciting? A sudden and huge benefit.

What benefits does the Web bring?

First, all the underlying data of DApps are disclosed to the public, and they are also tamper-proof.

Second, the blockchain has its own incentive mechanism. You can not only protect digital assets, but also exchange tokens.

There was no such good thing before, only in the past few years.

Q: I don't install it anymore. I'm in technology. I've done development. Can you tell me how Web3's system architecture is different from before?

If you have done development, then you can see what it is on the left side of the picture below:

6b102573fcdae68a6b4e91b689d2d18e.png

If you understand Ethereum, is the right side also easy to understand?

See references 1 and 2 for image sources .

Q: Oh, I see, the front desk is not much different from before, and the backend has become Ethereum.

Yes, as I said earlier, the core data is in Ethereum.

Q: So what is Ethereum? Can you tell me about Ethereum technology?

I don't have time right now, I have time to talk to you.

Follow me ("wei sir said"), maybe someday I'll post it.

Q: Then how do I call the data and code of Ethereum, I have never written such a program.

The so-called Ethereum 去中心化is actually that many nodes maintain data together. There is not only data, but also code. Code is what people often call smart contracts.

Each node can broadcast 交易the request, and other nodes will then execute the transaction and record the resulting data change (termed state change) on the blockchain.

Your frontend wants to interact with the blockchain and requires the ability to issue transactions, and in order to do that, you either maintain a node yourself, or you interact with one of the nodes.

Most people are too lazy to set up their own nodes (time-consuming, labor-intensive, and storage-intensive), so most of them use third-party services such as Infura or Alchemy to provide node services, and let these services help send transactions.

Of course, this involves a question of trusting them, which will be discussed later.

Q: How can I use Infura's services? I can be a programmer, you can talk about it in a little more detail.

You go to the Infura or Alchemy website, sign up for an account, and they'll give you a link ( provider) for you to use.

For example, a provider looks like this:

https://etheruem-mainnet.infura.io/v3/491234567abced4456abcaabbcdee

(The above is made up by me, don't use it directly, apply for one yourself)

Then you install Web3.jsthis library (or use the Web3.py library, this library that can communicate with the blockchain can be understood as Web3 API), establish a connection with the provider, make a transaction package, and send it to this connection. (essentially a json-rpc call).

This provider will broadcast your transaction to Ethereum and return the result to you.

Q: You are talking about sending transactions, how do I read the data on the blockchain?

In the same way, still using the Web3 API, you can read the specific data of blocks and transactions.

You can also monitor events of smart contracts (for example, use Web3.js to monitor, and specify a callback function, which can be automatically processed once an event occurs).

In addition, there is an API called "The Graph". Programmers can use GraphQL as a query language to quickly and easily query various data on the blockchain. The Graph will prepare and index all kinds of data, so you don't have to eat raw meat (read raw data and parse it) by yourself.

Q: Ah, it's as simple as that. I'm almost ready to say it. Should I develop a DApp?

In a simple enough case, you may develop a page to implement a DApp.

Q: Will the user login be different?

You're so smart, indeed, that you no longer need to save username and password information (unless you really want to), just let them log in with their wallet.

In addition, the wallet also has a provider function, you don't need to connect to Infura or Alchemy, you let the page script directly connect to the user's wallet, allowing the user's wallet to communicate with the blockchain.

However, be aware that Infura is also behind MetaMask.

Q: What is a wallet? for what? What does it look like?

For crypto(encryption technology and blockchain enthusiasts), wallet refers to an encrypted wallet, which helps you generate private keys and addresses.

The user's private key is stored in the wallet, so entering the wallet requires a password protection, otherwise others will take away the private key when they touch your computer.

If a DApp involves changing data, it needs to call the user's wallet, and with the user's confirmation, execute the transaction 签名, and then send it.

For example, the most popular wallet MetaMask looks like this:

8909d46b17c93d167ae55a65af78e2a4.png

Now, you can build this structure in your mind:

423de8dd97334ee1e46eb77ef473bb8c.png

Q: Another point, I heard that Web3 likes to store things on IPFS, what does this mean, and why not on Ethereum?

Storing things on Ethereum is expensive, so only the most important data is stored.

If it is relatively large data such as pictures, documents, audio and video, many of them are still stored using traditional technologies.

Of course, for "decentralization", data can be put on IPFS. IPFS is a decentralized storage protocol that uses and draws on BT (BitTorrent), Git (version management), DHT (distributed hash table) and other technologies. Advanced is also the best technology to use.

Unlike Web1 and Web2, on the IPFS network, the CID (hash) of a file determines its URI (link), that is, the same file has the same link. This is completely different from before,

For example, the IPFS address of Ape No. 1 in BAYC is: ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/1

There is another one called SWARM, which is also decentralized storage. The key technology of IPFS is similar, but not the same. Since it is dominated by the Ethereum Foundation, it has also attracted much attention, so I won't say more here.

Q: You keep talking about decentralization. Why do cryptos like decentralization so much? Is this really good?

In fact, advocating "decentralization" is a kind of worry and distrust of the current "centralized" Internet, and it is an extreme concern for data security.

Under the centralized structure, the user's data is stored in the company. What if it goes bankrupt one day?

For example, you worked so hard to make 1000 pictures on a drawing website, and suddenly one day the website said: "I'm sorry, the data is lost", what should you do?

For example, you uploaded 10,000 videos on a video app, but one day the company said, "Sorry, we gave up this product, what should you do?"

You can only admit it. Because in the user service agreement, the company has clearly arranged for data loss and stop service.

For example, a famous APP said in the "User Agreement":

"You understand and agree that the company has the right to modify, interrupt, suspend or terminate the software and related services according to the specific circumstances, for the needs of overall service operation and platform operation security."

"You understand and agree that the software and related services may be affected or interfered by various factors, and the company does not guarantee that the software and related services are fully suitable for the user's use requirements; Reliable or error-free; there is no guarantee that any errors in the software and related services will be corrected."

That is to say, when you use it, you have already ticked to agree: the company can suspend the service at any time, and the company does not guarantee that the service will not be error-free, nor does it guarantee that the error can be repaired.

Companies can also delete users' data and refuse users' postings according to their own criteria:

"If the company has reason to believe that your behavior violates or may violate the above agreement, the company can independently judge and deal with it, and has the right to terminate the service to you at any time without prior notice, and pursue relevant responsibilities in accordance with the law. "

Plus, companies can make money off of your work without paying you.

You see, in Web2, under the centralized model, the company has the final say. In order to use the company's services, users generally can only accept it. What can be done?

This is quite a bit like the relationship between employees and the company. The company asks you to 996, and you can 996. It is not easy to change jobs, and it is also 996.

So someone came up with something "decentralized". The user's data is not managed by one entity (person), but by 1,000 people.

And these 1,000 people act strictly according to the agreement. If you want to change the data, you need to agree with the majority of people!

These 1,000 people, who have never met anyone in the world, work together to protect the availability and integrity of user data.


Q: I see you mentioned availability and integrity, but what about the "confidentiality" of data?

The reason why I didn't say confidentiality is because the blockchain actually emphasizes openness and transparency.

If you need to provide confidentiality, that's not difficult.

Do you think, in the world created by crypto, do you still have to worry about this?

Q: But there have also been many hacking incidents in the Web3 world. Can you say it is safe?

Programs are written by people, and there will be bugs written by people. The reason is that simple.

But something as fundamental as BTC and ETH has worked very robustly for years after a very few early attacks.

Although there will be problems, in terms of security, Web1, Web2 and Web3 are incomparable.

Q: Why should these 1,000 people serve everyone?

All crypto technologies, when designing protocols, will consider their incentive model, that is, how to benefit the people who work.

So, you will see all kinds of cryptocurrencies, tokens, Tokens.

As long as you act in accordance with the blockchain protocol and contribute to data security, you will get benefits.

Users can also make contributions in DApps and earn Tokens.

Therefore, in the blockchain, all participants share the ecology and benefits.

This used to be very different (not much to say here) .

Q: But now the so-called decentralization, how can it really be achieved, isn't infura and alchemy centralized, so many of you use it.

Signal founder Moxie said in one of his articles 3 , 4 :

“Almost all DApps use Infura or Alchemy to interact with the blockchain, and nothing is used to verify the authenticity of the blockchain state or responses. This surprised me. Creating a trustless distributed consensus mechanism has invested in A lot of work, effort and time, but almost all customers who want access to it do so by simply trusting the output of these two companies."

“Blockchain proponents might say it’s okay if these types of centralized platforms emerge, because the data on the blockchain is fully available, and if those platforms misbehave, customers can simply move elsewhere. "

Well, he found the problem and then answered it himself, which was a good answer.

Q: For someone like me who has never been in contact with Web3, how can I experience it for myself?

Use chrome browser, or firefox browser, install a MetaMask wallet.

Then open OpenSea and feel the NFT first.

This is a typical Web3 application.

Q: But isn't OpenSea also centralized? You dare to trust it?

OpenSea is just a front-end, and the centralization of the front-end should not be feared, because this centralization can be broken.

The data on the backend of OpenSea is on the blockchain, which is what people care about most.

Q: Sir, you said before that the pictures of NFTs are not actually on the blockchain, which is not good.

Yes, I talked about it in the article "Catch NFTs with Intuition" .

Moxie found this too, saying this:

“Instead of storing data on-chain, NFTs contain a URL that points to the data. Looking at many NFTs sold in popular marketplaces for tens, millions of dollars, the URL is usually just to some VPS running Apache. Anything Anyone who has access to the machine, anyone who buys the domain name in the future, or anyone who breaks the machine can always change the NFT's image, title, description, etc. to whatever they want (whether or not they don't "own" it) the NFT).”

My understanding is that this is the early days of Web3, everything is still rough, Ethereum storage is expensive, IPFS has not yet spread, and now only the most important data is on the blockchain, and a lot of data is still centralized.

Let’s just do it first, the meal should be eaten one bite at a time, and the key depends on the future development.

Whether you like it or not depends on your cognition, you can think it is a baby, you can think it is shit.

This is like, 30 years ago, when people saw the Web1 Internet for the first time, what was the use of this thing?

After all, the title of this article by Moxie is: My first impressions of Web3.

Q: It seems that the back end can be decentralised. Can the front end of the website be decentralised?

Of course, the front desk of the website is nothing more than some html/css and script files, just put it on the decentralized storage system.

Now, the Web3 architecture can be imagined like this:

0500a9b3c398ebd7272618ac3d07d032.png

Q: Another point, I heard people say that the gas fee on Ethereum is very expensive, and then the speed is very slow, and there are very few transactions per second. How can this be used?

Well, this is indeed a big problem. The gas fee is expensive because everyone wants to use it, so the higher bidder will use it first.

The number of transactions per unit time is small, because the size of each block is limited, the current maximum is 30Mgas, the average block time is about 15 seconds, and each transaction costs about tens of thousands to hundreds of thousands of gas , you said how many transactions can there be (don't forget, more than a dozen transactions per second).

Therefore, many people are now working on layer 2 technology, just to solve this problem at layer 2, although eth2 on the first layer is also working on solving this problem.

Rollup technology (including optimistic rollups, zk rollups) is the most promising of the current two-layer solutions. Arbitrum One, Optimism, Metis and other solutions are excellent representatives of optimistic rollups technology; zkSync and StarkEx are excellent representatives of zk rollups, and These second-tier solutions are themselves decentralized.

"As the name implies, the Rollup technology is to roll up a bunch of transactions into a rollup transaction. After all nodes receive the rollup transaction, they do not execute the rolled up logic, but only accept the execution results of these logics. Therefore, this rollup transaction The gas required will be much less than the gas required to execute these transactions.” 5

The number of transactions per second on the second layer can reach thousands, which greatly solves the congestion and expensive problems of the first layer. Smart contracts can be directly deployed on the second layer, and DApps can also directly call the second layer. The first layer is more to use solid algorithms to ensure data security.

You can make up this architecture diagram (add another layer between provider and ethereum) .

Q: Can they really solve the capacity problem in a decentralized way?

Rest assured, for so many years of computer and network technology development, I have never seen a capacity problem that cannot be solved.

CPU, memory, storage, network speed, which capacity problem has not been solved.

The only thing that hasn't been resolved over the years is the battery capacity.

Q: I ask the last question, do people really need Web3?

To put it another way: Do people really need to protect their data assets?

Q: Web3 is so simple? Why do I think it should be more mysterious?

If you want to blow it, of course, it can be a little more mysterious.

I won't blow it.

Text|Wei Jianvan

If you want to learn more, you can reply to web3more in the background


  1. The Architecture of a Web 3.0 application(https://www.preethikasireddy.com/post/the-architecture-of-a-web-3-0-application) 

  2. Alpha Rabbit: Web3 Application Architecture 

  3. My first impressions of Web3(https://moxie.org/2022/01/07/web3-first-impressions.html) 

  4. Founder of Signal: After developing two decentralized applications, I found that Web3 may be a false proposition (https://www.chaincatcher.com/article/2068727) 

  5. What is Rollup(https://zhuanlan.zhihu.com/p/367736563) 

Guess you like

Origin blog.csdn.net/vigor2323/article/details/123220170