Categories
Ref: medium

Blockchain basics: A clear and simple explanation of how it operates. | by Canny Crypto Cats

Welcome back to the Canny Crypto Cats’ basic crypto education series. This article is the first of many that will delve into the deeper technology of crypto, providing you with the essentials you need for your journey. In our first two articles, you learned how to create your own crypto wallet. If you haven’t done so yet, check out our guides on setting up MetaMask or Coinbase Wallet.

Now that you’re ready to dig deeper into the crypto universe, it’s time to explore the broader technology that your wallet lets you interact with. In just a few minutes, you’ll understand what a blockchain is and how it works. So, let’s get canny and dive right in!

What is a Blockchain?

The name itself gives us a hint. A blockchain is a sequence or chain of so-called blocks. It’s often described as a distributed ledger, which means it is a decentralized database that is shared, replicated, and synchronized among many participants. In simple terms, a blockchain network operates based on an independent computer program, known as a protocol, which defines the rules and procedures for how data is added, validated, and stored on the blockchain. This blockchain, which is the data structure that stores the actual data, operates across many devices, known as nodes.

Data a block typically contains.

A block is essentially a set of data, often visualized as a cube. We’ll use the diamond that the Canny Crypto Cats are wearing to represent the block. Each block contains a hash, transaction data like the wallet addresses of the sender and receiver, the amount of coins sent, and the hash of the previous block.

Hashes are strings of letters and numbers that serve as the fingerprint of the block. When a block is created, its hash must be calculated by the network participants. If the data in the block changes, its hash has to be recalculated. We will explore this topic further later. For now, just know that each block contains its own hash and the hash of the previous block.

What is the Purpose of Hashing?

Each previous hash of a block points to the actual hash of the previous block.

You now understand what a block is and that a blockchain consists of multiple such data blocks. But how are they linked together? As mentioned, each block contains the hash of its previous block. This means that if we look at the sequence of blocks generated one after another, the new block points to the previous one through its hash, as shown in the graphic above.

A tampered red block changes its hash from CDE to XYZ and therefore breaks the chain at this point because the previous hash CDE of the following block does not match the current hash anymore.

If someone tries to tamper with the data in one of the previous blocks, the hash of that tampered block will change. The following block will still have the old, unchanged hash of its previous block. This breaks the chain, making every subsequent block invalid due to the change.

To restore validity, every block would need to be recalculated, which requires a huge amount of computational power. Hashing is, therefore, one of the three security mechanisms of a blockchain, preventing scammers from manipulating, for example, the recipient of the sent cryptocurrency. However, hashing alone does not provide enough security. In theory, a very powerful computer system could recalculate invalid blocks, making blockchain manipulation possible again. To counter this, a second security mechanism called proof of work is used.

What is Proof of Work?

If you want to change something, you have to work for it. This is especially true for the proof of work mechanism in blockchains. As discussed earlier, whenever a new block is generated, meaning transactions need to be stored, the block’s hash must be calculated. This is achieved by solving complex mathematical puzzles that require significant computational power.

The proof of work mechanism increases the time required to generate a new block by making it power- and cost-intensive to solve these puzzles. Therefore, recalculating a tampered block and all subsequent blocks would be extremely time-consuming and expensive. But even this is not enough to secure the network completely. There is one more mechanism that contributes to the security of a blockchain.

Peer-to-Peer Network

Earlier, we discussed the term distributed ledger, noting that a blockchain is a decentralized database operating across many nodes around the globe. This is what makes crypto so secure. Anyone can join the peer-to-peer network and set up their own node. When you do, you receive a full copy of the entire blockchain. Every node has this copy and continuously compares it to copies held by other nodes. If one node tries to manipulate a block, every other node will compare its own copy of the blockchain to the tampered one.

A new green block is generated and sent to every node and therefore copy of the blockchain, which start to compare each other to reach consensus.

As a result, there will be no consensus, and the tampered copy will be identified as fake. In the graphic above, each node is represented by a Canny Crypto Cat. When a new green block is generated, it will be sent to every cat in the network. The copies are compared, and only after every copy is verified and consensus is reached will the new block be added to the blockchain. This process, as we’ve learned, involves the hash of the previous block being embedded in the new one.

The new block was legit and consensus was reached. The new block is now implemented on every node in the network.

Now you know the basic structure of how a blockchain works and its three security mechanisms. By understanding this, you are already ahead of many people out there. Knowledge is the foundation of creating an exceptional life. Follow us, the Canny Crypto Cats, on X to stay updated with important news or visit us on OpenSea and become part of Web3. Our upcoming articles will delve even deeper and guide you towards greater insights.

Source link

About Author

Leave a Reply

Your email address will not be published. Required fields are marked *