### Blockchain Distributed ledger
A blockchain distributed ledger is basically a database of records, distributed and syncs across a network of nodes. This allows multiple people to have access to the records. A distributed ledger ensures that any member can have access to the stored records or data on the network without the control of any central entity. This is done locally by each node or computer on the network. This allows the distributed ledger technology to function as decentralized peer-to-peer network.
In blockchain distributed ledger, transactions have public witnesses who are the members that run the nodes or computers that power the network. Each member that run a node on the network can own an identical copy of the ledger that is distributed across the multiple nodes in the network and any changes that is made to the ledger would reflect on all the copies in each of the network of nodes. With the peer-to-peer nature of the distributed ledger technology, blockchain technology also make use of this technology as a way of securing any record or information stored on the blockchain. This makes it difficult for hackers to hack or for the blockchain to be shut down because there isn’t a central point.
### How Blocks Hashes Work
Block hash is one of the key aspects of blockchain. Hash is basically a string of encrypted alphanumeric value that are of a fixed length. This fixed length of alphanumeric value that stores information and data on the blockchain. The hash is the output of alphanumeric value generated from an input which is the raw information or data. When a block hash is produced, it becomes irreversible, which is why it is used as a security measure in blockchain. Block hashes output value would always have the same fixed length no matter the length of the input data.
To demonstrate how block hashes work, let’s look at a tool andersbrownworth which is https://andersbrownworth.com/blockchain/hash
.png)
Inputting the data: Blockchain is amazing
The generated hash output is: 22ce6b60547d06c5cffc6b41266f0f4a7737b2c7959a584d72108482ce824d5f
.png)
I will be inputting another data with a longer input,
Inputting the data: Cryptocurrency has a lot of benefits compared to the centralized conventional financial system
The generated hash output is: 526f9d8cff4c639b526959207d86860b0006a094a793e014062f973843718b28
.png)
We can see that both hashes have the same fixed length of alphanumeric value containing the input data. This shows that block hashes outputs would always have the same fixed length no matter the length of the input data.
Visiting the block section of the website [here](https://andersbrownworth.com/blockchain/block)
From the screenshot, we can see that the first block hash begins with 4 zeros which is known as the difficulty level.
.png)
I will be inputting the data; this is great. We can see that the hash output value is showing as invalid and cannot be added to the chain.
.png)
I clicked on mine and the hash output value becomes valid and the block is valid.
.png)
### What happens when any middle of the block gets changed
To demonstrate what happens when the middle of the block gets changed, I will be visiting the blockchain section of the website [here](https://andersbrownworth.com/blockchain/blockchain)
In blockchain, blocks are arranged in chronological order which means that it is arranged one after the other in time. The new references the previous block. block 2 is created, Block 2 comes after block 1, block 3 comes after block 2 and so on[.](https://steemit.com/hive-108451/@chimzycash/steemit-crypto-academy-season-3-week-6-post-for-stream4u) With this, all the blocks that are created are chronological tied to each other, which means that once any block is changed, it would become invalid and every block created after would be invalid as well since the new block references the previous block.
When the data in the middle block is changed, for instance, we have 3 blocks, block 1, block 2 and block 3…
From the screenshot, we have mined different data for **block 1, block 2 and block 3.**
.png)
#### Block 1
**Data:** I like to read books
**Nonce:** 29794
**Hash:** 000070218b66c36527c133ed91a7ca00456e4a832a1968c977709c6ab69f789c
#### Block 2
**Data:** The day is bright
**Nonce:** 124613
**Hash:** 0000c1ed289665240ffa079ff6dc26f2f6da58c36cc5eb6bacdd890578415cd0
#### Block 3
**Data:** It is good to work hard
**Nonce:** 59305
**Hash:** 0000f6cd1e306712fbddd4b411ff7131276e254e8f79edfef8a90bbd8e0c41f6
We can see above that I have mined 3 valid blocks with different data in each of the blocks. Each blocks have its own unique data and is valid. Block 1 is not referencing any previous block that is why it showing 0000… in the prev. **Block 2 is referencing block 1 as we can see that the prev hash in block 2 matches the output hash in block 1. Block 3 references block 2 as the prev hash in block 3 matches the output hash in block 2.**
.png)
When i change the data in block 2, there will be a new hash and the block will be invalid. **After changing the block 2 data to “Super amazing”**, we can see on the screenshot that all the blocks created after block 2 is now invalid as well since block 3 references block 2. **Block 3 is tied chronologically to block 2 and referencing it, it means that block 3 has become invalid.**
.png)
Blockchain and Cryptocurrency Basic - Blockchain Distributed ledger and How Blocks Hashes Work in Blockchain
@chimzycash
· 2023-05-07 20:55
· blockchaintech-crypto
#blockchaintech-crypto
#piotr
Payout: 0.000 HBD
Votes: 200
More interactions (upvote, reblog, reply) coming soon.