Blockchain

Piyush Harsh
3 min readMar 19, 2021

--

Blockchain, sometimes referred to as Distributed Ledger Technology (DLT), makes the history of any digital asset unalterable and transparent through the use of decentralization and cryptographic hashing. If we simplify, it is the growing list of records (blocks) managed using cryptography. Cryptography is the practice and study of techniques for secure communication in the presence of third parties called adversaries.

Blockchain is a specific type of database which differs from a typical database in terms of storage mechanism of information; it stores data in blocks that are then chained together.

As new data comes in it is entered into a fresh block. Once the block is filled with data it is chained onto the previous block, thus making the data chained together in chronological order.

A variety of information can be stored on a blockchain, most commonly used so far has been as a ledger for transactions. In Bitcoin’s case, blockchain is used in a decentralized way implying that no single person or group can control; all users collectively retain control. Decentralized blockchains are immutable, which means that the data entered is irreversible. Considering the case of Bitcoin, this means that transactions are permanently recorded and viewable to anyone.

A database structures its data into tables whereas a blockchain, like its name implies, structures its data into chunks (blocks) that are chained together. This makes it so that all blockchains are databases but not all databases are blockchains. This system also inherently makes an irreversible timeline of data when implemented in a decentralized nature. When a block is filled it is set in stone and becomes a part of this timeline. Each block in the chain is given an exact timestamp when it is added to the chain.

Every chain consists of multiple blocks and each block has three basic elements:

  • The data in the block.
  • A 32-bit whole number called a nonce, a randomly generated code when a block is created. It then generates a cryptographic hash.
  • The hash is a 256-bit number wedded to the nonce. It must start with a huge number of zeroes.

When the first block of a chain is created, a nonce generates the cryptographic hash. The data in the block is considered signed and forever tied to the nonce and hash unless it is mined. Miners create new blocks on the chain through a process called mining.

In a blockchain every block has its own unique nonce and hash, but also references the hash of the previous block in the chain, so mining a block isn’t easy, especially on large chains.

Miners use special software to solve the incredibly complex math problem of finding a nonce that generates an accepted hash. Because the nonce is only 32 bits and the hash is 256, there are roughly four billion possible nonce-hash combinations that must be mined before the right one is found. When that happens miners are said to have found the “golden nonce” and their block is added to the chain.

Making a change to any block earlier in the chain requires re-mining not just the block with the change, but all of the blocks that come after. This is why it’s extremely difficult to manipulate blockchain technology. Think of it is as “safety in math” since finding golden nonces requires an enormous amount of time and computing power.

When a block is successfully mined, the change is accepted by all of the nodes on the network and the miner is rewarded financially.

--

--