DEV Community

Cover image for Web3 series( Part 1) : Intro to Web3 & Block chain
Shahriyar Al Mustakim Mitul
Shahriyar Al Mustakim Mitul

Posted on

Web3 series( Part 1) : Intro to Web3 & Block chain

What is Web3?
First lets know what is Web1?

Image description

Image description
You could not change anything of the page.

Web2.0

Image description

In Image description
web2.0, the admin could control the page and at the same time you had the opportunity to interact with the admin .

Now, Web3.0

Image description
Using the Blockchain, apps can now share their databases and background.

So, to sum up

Image description
Block chain offers a decentralized way to share element and you can also exchange value. It was not possible before. You can exchange information and also monetary values.

First you had a computer and once the internet came, now you have apps, snapchats and so on. Now Web3 came and it is predicted that, things will change very fast because of this..........

Why is it so famous?
Because it is Open System & Composable.

What is this Open System mean, right?

Assume that you want to build an app which will have your location and all of your friends. You can easily know at any time where the person is . But do you have the data? Do you know where the person lives? or where he is right now?

May be not. But Facebook, LinkedIn has those. But they won't provide the data to you. This is called Closed system. Closed system is good for a company but not for developers or new innovations.

Composable means that you can build apps over another one. Currently you might not be able to use Facebook's data to build something but in Web3, things will be open sourced and you can build an app over another and another person will build one over you.

What is Block Chain

You may say
Blockchain - the technology that powers Web3 and Cryptocurrencies
You can think blockchain literally like chain of ordered blocks point to each other.

Image description

What this blocks contain?
The actually contains transactions.

Image description
Some terminologies:
Block - think of it as a hard drive that contains data that can be added on, but never delete from. Like a company ledger or an accounting ledger.

Blockchain - a group of blocks that adds on top of each other, like a continuation of the last block. Think of it as a group of hard drives that extends the last block

By the way , you have heard of Decentralized, right?
What is this? Actually block chain runs on Nodes. These can be thousands and millions of nodes across the globe. These nodes can communicate with each other.

The amazing fact is that, anyone can take part in this network and nodes. And this makes Block chain decentralized. That means that anyone can contribute or use . Open for all. There is no part which is kept Hidden. Literally anyone can come and use this software and data and these makes it De centralized.

All this things are maintained by the Consensus Algorithm.

Image description

We are going to focus on Proof of Work . Thats what Ethereum focuses on to manage these networks and transactions.

You can know more about Ethereum coins here

Let's now know what is Proof of Work
Work basically means the computing resources.

Image description

So, in servers there is literally CPU running, what are they doing? they are basically running something right?
In Blockchain world, we call these miners who solves problems to get a block cash

Image description
They use Brute force to get the correct match in order to find block hash.

So, what is this block hash?
Basically block chain has chains of blocks and each has unique hash associated with it. In order to find the next hash, you need to know all the previous hashes.

Image description

So, the miners just try to find the hashes by Brute force and guessing and checking.

Image description
This is what time it takes for Ethereum & Bitcoin to solve a math problem to find a hash or block hash. That's how the coin makers designed the system.

Once a miner gets the right hash, it broadcast it to other miners and they verify it in the least of time.

Now the question is

Image description

Talking about the Ethereum coin,

Image description
It can not be created in any other way.

So, now let's know what happens in a transaction.
Remember, we told blocks contain transactions , Right? Now assume Elan is trying to send 1 Ethereum to Albert

Image description

Image description

Image description

How to send that? Basically Elan sends her transactions to a Transaction pool

Image description

It then gets distributed into the network within the pool

Image description

While sending a transaction, you are sending your personal sign which can only be signed with your private keys. No one else can send your transactions because they won't have your private keys. nce it is signed, it's within a package and with something called gas. We will know about gas later . For now, just assume this gas carries some fees.

So, the transaction has your signed transaction+ some fees(gas) + miner tips. And this gets sent to everyone's transactions.

Image description

So, everyone's transactions now get into the same pool.

Now miners go and search for transactions and decide which one they one to include in their blocks.

[Note: Blocks carry transactions I told you earlier]

Image description

The choose a transactions based on the highest miner tip

Image description
Therefore miner tips become important here cause they gave the most priority to a transactions fee .
Now, lets understand it from a real transaction

Image description
you can see the value & transaction fee here.

Transaction fee= Miner tip + Cost of your transaction. This is what Miner tip is:

Image description

but what about transaction fees?
In the case of transaction, you actually need computing resource .Transaction from A to B actually have some cost to ship. This cost is measure in the term called gas. Ahha!

Happy now? Let's know about it.

So, when you drive a car, you need gas to go from place A to B, right? This is what gas means in blockchain. Some fees to ship.
This prevents from hackers. Want to know how?
If a hacker hacks and then try to run an infinite loop of transaction, he will need to add infinite fees (gas) with these transactions. Obviously thus he won't do it.

Now, you may have a question that *how to know your transaction fee , right?
*

Firstly ,it basically depends on the complexity of transaction.
Transaction from San Fransisco to LA
Image description
will cost less than one from San Francisco to New York

Image description

Secondly, it also depends on the price of gas
There are certain price associated with gas itself . Depending on the increasing/decreasing rate of it , transaction fee increases or decreases.

thirdly, it depends on the network congestion.
For example, you want Uber at Eid Day , and it will cost much higher if you would call it on some normal day. Right? So, that's it.

Now, when a transaction is picked within a block by a minder, it is sent and minder het minding tips but the gas is destroyed along with the ether.

So, for a coin like Ethereum, you can see that this can only be created when you mind blocks and than block transfer transactions. Also, it gets destroyed only when a transaction is done.

Let's know some other currency called FIAT Currency

Image description

This transaction is backed by the government. example: US Dollar, Taka etc.
These money is locked in banks and they don't let other know about your transactions, right? this is completely opposite of transactions in blockchain. In blockchain, you share your transaction to everyone in the node or network and miner finds it and takes it within a block to create an coin (Ethereum/bitcoin etc).

Image description

this is the Ethereum transaction diagram looks like. Publicly available on public ledgers .

But for FIAT transactions:

Image description

Security aspects of Block chain

Image description

Because of these aspects , hackers can not hack though Block chain

Top comments (0)