Udemy

What is the Blockchain and Why Use it?

A free video tutorial from David Joseph Katz
Software Engineer
Rating: 4.5 out of 5Instructor rating
18 courses
306,497 students
What is the Blockchain and Why Use it?

Learn more from the full course

Build a Blockchain and a Cryptocurrency from Scratch

Updated for 2022-23: Build a blockchain and cryptocurrency. Discover the engineering ideas behind Bitcoin and Ethereum!

07:15:25 of on-demand video • Updated October 2022

Discuss the implementation of Blockchain and cryptocurrencies.
Understand main blockchain concepts like Proof-of-Work, mining, peer-to-peer connections, etc.
Build their own blockchain and cryptocurrency.
Create a NodeJS application with real-time websocket connections.
Build an API with NodeJS and Express.
English
What is the blockchain and why use the blockchain? First let's start with a more formal definition of the blockchain and unpack it. Formally, the blockchain is a distributed and decentralized ledger that stores data such as transactions between individuals and that ledger is publicly shared across all the nodes of its network. The storage itself consists of multiple blocks of data chained together like the links of a physical chain. So how are these links created? Well, every block is given a unique value that looks like a random string of characters. We call this value the hash since it's generated from a hash function that creates the unique output for every unique input that it receives. The hash is generated based on the unique data that we want the block to store. This data within the block can be anything: a string like ;foo' for example or an array of numbers, or more relevantly a list of transactions from one individual to another one. The unique hash for the block is generated not only from the data we want to store, but also more metadata about the block such as when it was created and its position in the chain. Theres also one more very crucial data point used to generate the hash of a new block: the unique hash of the last block is also used as part of the input that the new block uses to generate its hash. This means that the last block is an integral part of creating the new block's hash value. In addition, the block itself will now have a reference to the last block hash value as part of its public data. Links from block to block are created because each new block makes a reference to the last block's value. This reference to the last block's value links the last block to the new one. And as more blocks are created, eventually we have this chain of blocks creating the blockchain. Ok, so thats a high level overview of the blockchain. There's still a few concepts from the original definition that we have yet to explore. So let's unpack those. First off, we have this idea of a ledger. The ledger is a record keeping book that records all the transactions of an organization. Tt records contracts, payments. movements of assets, etc. So that the organization can track its economic history. As a ledger,m the blockchain serves the purpose of storing transactional data. So the blockchain is a ledger and as we defined earlier, it's in fact a distributed ledger. So what makes it distributed? A blockchain Ledger is distributed because the ledger itself is shared with everyone using the block chain network. In this network multiple nodes, or rather multiple individuals through computers connect to the core blockchain network. By connecting to the blockchain network, they each get a copy of the complete blockchain ledger that has recorded the entire history of data that is stored in the blockchain. Now that everyone has a copy of the blockchain ledger, they will get updates every time someone changes their individual block chain, as it's sent through the network. This idea of the blockchain ledger being distributed touches on the idea of the blockchain also being decentralized. Since everyone has a copy of the updating ledger there is not one central organization with the responsibility of updating and maintaining that ledger. Let's discuss this idea of decentralization further by contrasting the centralized and decentralized models. In the centralized model a bank holds the ledger itself and records the transactions of everyone's financial accounts. It holds all the data for the organization. So the bank, as the central organization has all the responsibility, and yet all of the power at the same time. So some might see this as a potential negative of a centralized model. Since a ledger is controlled by a single entity, they have complete authority. Whether that means invalidating transactions or enacting fines that you might find unfair. However there are some positives to the centralized model since the bank can perhaps give you incentives to join their system or they can give you reward points for using your credit card and insurance policies in case your items get lost or damaged. Still, in the system, you completely trust that central entity in order to record all of your transactions. On the other hand the decentralized model is trustless which counter-intuitively means you trust the decentralized system itself. And in a way you can trust it even more than a central organization. Everyone has equal power and access to the history of transactions in the decentralized model. And furthermore everyone has the responsibility of recording these transactions. So the system is fair and transparent. And the record of transactions is not kept behind closed doors. You don't trust one organization to manage the data. Rather, you trust the system itself, since you don't have to trust anyone. Finally let's continue answering this question, we've already started answering a little bit but let's ask again. Why use the blockchain? So, as a distributed and decentralized system, it's trustless; in the sense that you don't place all the power of recording transactions within one organization. Now this also means we eliminate the necessity for third party intermediaries and middlemen to handle our transactions that could interact fees for their services. In the blockchain network two nodes can trade with each other directly without having to rely on a bank or an accountant to officially document the transaction. Given the nature of the decentralized system the blockchain is also highly secure. There is not one central point of failure. A hacker that is trying to take down a bank needs only take down that one bank in a centralized system. In the blockchain, the attacker needs to take over thousands if not millions of nodes and computers to hijack the network. This also makes a system very dependable. With all the nodes of the blockchain network recording transactions. You can trust that what you did is present, even if your own connected node temporarily goes down. Overall, we now have a better grasp of the blockchain and its definition. We understand what it means when we define that the blockchain is a distributed and decentralized ledger that stores data such as transactions between individuals. And we know the great benefits of that ledger being publicly shared across all the nodes of its network. Next up, let's explore the main ways that blockchain technology is being used today in order to revolutionize the world.