Block #1

Data Hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Difficulty: 2
Nonce: 0
Previous Hash: 002efa1c93385d9b160510f1179844ac2c2b921df6a4771cacbcf3eeea7cc667
Timestamp: 1640467834
Data:
Hash: a30560c5b4622915a689b1bfeb34c0b608ae110da715fb7c0b65d94c10a6473b
Created at: 25/12/2021 21:30:34
Usage

A Blockchain is a write-only database that guarantees its integrity with cryptographic hash functions. Each block is identified by a hash made from the data it contains, the previous block's hash and other parameters like a timestamp, difficulty and nonce.

The difficulty (or target) represents how many zeros a block's hash needs to start with so it can be added to the blockchain. To mine a block we increment the value of the nonce until we generate a hash that satisfies the difficulty requirements of the blockchain.

Flipping a single bit of any block in the chain causes an avalanche effect on the hashes of all following blocks. This makes it very easy for any node in a decentralized peer-to-peer network to verify the integrity of the blocks.

In this example we use the same Block Header structure that Bitcoin uses. You can manually mine the block by increasing the nonce and checking if it satisfies the difficulty, or you can mine it automatically and add it to the chain. Any difficulty over 4 will lag and slow down your web browser. For some perspective, the current difficulty of Bitcoin is about 20, and people usually mine it with specialized hardware.

Mined Blocks

Block #0

Data Hash: 79644a8f062f1ba9f7a32af2242c04711a634d42f0628ada6b985b3d21296eea
Difficulty: 2
Nonce: 485
Previous Hash:
Timestamp: 1640467834
Data: GENESIS BLOCK
Hash: 002efa1c93385d9b160510f1179844ac2c2b921df6a4771cacbcf3eeea7cc667
Created at: 25/12/2021 21:30:34
⌨️ Source Code 🖥️