To recap, last week we defined decentralization where
Decentralization means there is no central point of control. Instead, decisions are made over a distributed network of computers (via consensus, to be discussed later!). Decentralization removes responsibility and capability from a central location and devolves it across a network of connected computers.
We briefly touched upon Web 2.0 and the interaction of the user with any application through the front end with support of back end logic & database.
To quote Vitalik & at the cost of repeating myself
Blockchains are
politically decentralized (no one controls them) and
architecturally decentralized (no infrastructural central point of failure)
but they are logically centralized (there is one commonly agreed state and the system behaves like a single computer)
We introduced Web 3.0 where the infrastructure is decentralized.
Let us see some underlying issues in Web 2.0:
Single point of failure - If the systems and databases are centralized in one location / company / authority, any system failure or hack takes down the whole infrastructure. All the users of a centralized system are dependent on a single source of service.
Security & Data privacy - We all know about companies monetizing our personal data by selling it to advertisers and also tracking our browsing habits which results in loss of privacy. The numerous hacks and attacks on critical IT infrastructure across the world exposes the shortfall in security measures undertaken.
Below is a very high level view of a Web 3.0 application
We can see that there is no centralized back end for defining business logic or centralized database to store data and information. The computers forming part of the blockchain are all connected in a peer-to-peer fashion. Web 3.0 IT stack focuses on peer-to-peer technology. What is peer-to-peer technology?
As per Merriam Webster, peer-to-peer is defined as
relating to, using, or being a network by which computers operated by individuals can share information and resources directly without relying on a dedicated central server In peer-to-peer computing, every client can be a server. You string together two or more computers, and everyone can share files, programs, drives …, printers, and anything else that's attached.
So, peer-to-peer means computers are connected to each other and they can share data, files or anything that is part of the connected network. In a blockchain, all peers can communicate with each other and send & receive messages. Blockchain is not the first application to use decentralization. A popular application called BitTorrent uses peer-to-peer file sharing technology. As per wikipedia,
BitTorrent is a communication protocol for peer-to-peer file sharing(P2P), which enables users to to distribute data & electronic files over the internet in a decentralized manner
Let us take the example of Bitcoin (again!).
Bitcoin is a cryptocurrency which is operated on a blockchain (a peer-to-peer network)
There is no centralized trusted authority like a Central Bank monitoring the issuance and usage of Bitcoin
Bitcoin sits on a distributed ledger that stores all the transactions in the network
The ledger is replicated across all the computers which are connected as part of the bitcoin network
When we say blockchain is decentralized, what exactly is decentralized here?
Decentralized Storage
Sharing a decentralized ledger which means data needs to be stored in a decentralized manner. Thus storage of data needs to be decentralized. But blockchain by design cannot store large amounts of data. It can store simple transactions and we will leave it at that for now.
Decentralized Communication
Of course, the communication between the computers need to be decentralized in the peer-to-peer network.
Decentralized Computation
In Web 2.0, we spoke about the back end which runs the logic & computation of a web application. What is the analogous "back end" logic in a web 3 application? It is called a "smart contract".
What is a smart contract? Is it a contract which is smart?? Neither. Read on......
Bitcoin blockchain is the first generation of blockchain systems where financial transactions are recorded publicly with cryptographic signatures. There are no computations or applications over and above this. The second generation of blockchain systems provides a base to deploy & execute programs on the blockchain itself. The Ethereum blockchain is one such example.
Ethereum is software running on a network of computers that ensures that data and small computer programs called smart contracts are replicated and processed on all the computers on the network without a central coordinator. The blog from where this definition was taken is a good introduction to Ethereum for those interested.
Ethereum is the largest decentralized software platform which means we can create applications on it. So how can we program the logic into these applications? For e.g., if we want the software to do something at a particular point in time, how is that done? It is done through Smart Contracts.
Smart contracts are pieces of code that allow the Ethereum blockchain to move data or value. Smart contracts are instructions of when & how data or value should move.
We will leave it at that for now to focus only on Decentralization
Why Decentralize and not use centralized database?
Vitalik's blog has the answer to that. As per Vitalik, the three main reasons for decentralization are:
Fault Tolerance - Decentralized systems are less likely to fail accidentally because they rely on many separate components that are not likely to fail together
Attack Resistance - Decentralized systems are more expensive to attack & destroy or manipulate because they lack sensitive control points that can be attacked at much lower cost than the economic size of the surrounding system.
Collusion Resistance - It is much harder for participants in decentralized systems to collude to act in ways that benefit them at the expense of other participants, whereas the leaderships of corporations and governments collude in ways that benefit themselves but harm less well-coordinated citizens, customers, employees and the general public all the time.
Does decentralized databases fully resolve the issues surrounding centralized databases? No. Read the full blog to get a holistic view on decentralization which is beyond the scope of our discussion.
If everything is decentralized, how will the computers which are part of the network agree on a specific action? This is managed through consensus. An offshoot of decentralization is decentralized consensus which is our next rabbit hole to dive into !!.
Wait!! In the Web 3.0 diagram, I referred to something called "wallet" through which the user interacts with the blockchain similar to connecting to the internet using a web browser. Another rabbit hole to dive into !!!