What Is Blockchain?
As mentioned, blockchain is the underlying technology of bitcoin. Blockchain is a public distributed ledger in which transactions are recorded in chronological order. Any record or transaction added to the blockchain cannot be modified or altered, meaning transactions are safe from hacking. A block is the smallest unit of a blockchain, and it is a container that holds all the transaction details. A block has four fields, or primary attributes:
- Previous hash: This attribute stores the value of the hash of the previous block, and that's how the blocks are linked to one another.
- Data: This is the aggregated set of transactions included in this block—the set of transactions that were mined and validated and included in the block.
- Nonce: In a “proof of work” consensus algorithm, which bitcoin uses, the nonce is a random value used to vary the output of the hash value. Every block is supposed to generate a hash value, and the nonce is the parameter that is used to generate that hash value. The proof of work is the process of transaction verification done in blockchain.
- Hash: This is the value obtained by passing the previous hash value, the data and the nonce through the SHA-256 algorithm; it is the digital signature of the block.
SHA-256 is a cryptographic hash algorithm that produces a unique 256-bit alphanumeric hash value for any given input, and that is the unique feature of this cryptographic algorithm: Whatever input you give, it will always produce a 256-bit hash.