A blockchain is a distributed database that maintains a continuously growing list of data records that cannot be tampered.
The blockchain was the main technical innovation behind Bitcoin. There a blockchain is used as a public ledger of all transactions made with Bitcoins.
A blockchain consists of a number of blocks that are linked with each other with each block linked with its previous block. And, each block consists of a batch of timestamped transactions and a hash of previous block. As the blocks are linked with each other forming a chain, hence the name of the database.
Bitcoin and Blockchain
When two people want to exchange Bitcoin, the owner of the Bitcoin has to digitally sign the transaction using his secret key, so that the transaction cannot be tampered with. Also, the payee has to ensure that the Bitcoin is not spent earlier by the owner.
Using a central authority can be an easy solution of this problem. But, Bitcoin is a decentralized digital currency. No single institution controls the bitcoin network. So, Bitcoins use blockchain for this purpose.
In Bitcoin, a blockchain consists of a number of blocks linked with each other, with each block containing timestamped valid transactions of Bitcoins and a hash of previous block. When a node joins the Bitcoin network, a copy of the blockchain gets downloaded automatically.
When two people exchange Bitcoins, an encrypted record of the transaction is sent to all other nodes in the Bitcoin network. Each node in the Bitcoin network performs the task of validating and relaying transactions. So, when the encrypted record of the transaction is sent, the other nodes verify the transaction by performing complex cryptographic calculations on the record and notify one another in real time. When a majority of the nodes agree with the authenticity of the transaction, the transaction is added to the ledger.
A Bitcoin actually consists of a chain of digital signatures. It contains hash of the previous transaction, public key of the next owner and signature of the current owner. A payee can verify the signatures to verify the chain of ownership.
When new transactions are broadcast to all nodes, each node collect the transactions in a block. Each block uses the hash of the previous block, a nonce (a 32 bit value) to calculate the hash of the new block with required zero bits.
All the nodes verify the transactions present in the block and notify one another about theit acceptance. When the majority of the nodes agree, the next block is created.
Please note that, Bitcoin transactions are maintained using a Merkle Tree (What is a Merkle Tree ?) . Only the root of the Merkle Tree is included in the block's hash.
Blockchain and Digital Signatures
Usually a digital signature is made using the private key of the owner. Whoever wants to verify the signature can do so using the corresponding public key.
But, suppose a company wants to accept Bitcoins for its trades. Now, because of security reasons, the company would not want that only a single employee will have access to the company's Bitcoin wallet's password. Any transaction should need approval from more than one employees of the company. A multisignature address is created for that purpose.
A multisignature address is an address associated with more than one ECDSA private keys. So, in an m-of-n address, when a Bitcoin address is generated, it is associated with n private keys. And, at least m private keys will be required to make a transaction possible.
And this concept can be used in making digital signatures. One can create a multisignature m-of-n address using n private keys and use that to record digital signature of documents in a blockchain. Anyone can verify the digital signature using public keys, but to make the digital signature one would need at least m private keys, out f n private keys associated with the multisignature address.
Blockchain and IoT
The concept of blockchain can also be used in IoT. In a IoT, the devices communicate with each other and blockchain can be used there to verify each communication without human intervention.
When the product is first created, the manufacturer can register it to the universal blockchain. And later, the blockchain can keep immutable record of the communication between the smart devices. As a result, this can enable autonomous functioning of the smart devices without intervention of any centralized authority.
For example, using blockchain, smart devices in a manufacturing plant can communicate with each other and place orders for repairing some of its parts without human intervention or any other centralized intervention.
Another example can be, smart home appliances like laundry machine, dishwasher, vacuuum machine etc can communicate with each other using blockchain and diagnose, schedule or pay for their maintenance without human intervention.
So, blockchain provides us with some fundamental features which can be applied in many core businesses along with cryptocurrencies. This article gave some basic information on blockchain and some of its usages. Hope you liked it.