Introduction to Blockchain:
Blockchain is a list or chain of records called blocks which are linked and secured by cryptography.
Record is the data which is stored in the form of a block and are secured by cryptography method and are
linked together by a cryptographic link. A block contains data, hash of the data and a previous hash. The
block in the blockchain has a block number or block id, nonce (number used only once), data, hash,
previous hash, time stamp (shows the time at which the block is created) and data. The first block in a
blockchain is called genesis block.
Blockchain is a secure technology used for transactions (transfer of any type of data). The link in the
blockchain is given by the previous hash value. If the hash of a current block and hash of previous data in
the next block are not same, the cryptographic link will break.
Now we will discuss some of the terminologies of the blockchain that are mentioned above.
Nonce:
It means “number used only once”. Size of nonce will be fixed and miners change this nonce by solving a
cryptographic puzzle. In bitcoin, the number of zeros are fixed in hash and these zeros denote difficulty
level. The less the number of zeros, the more is the difficulty level. It is required for miners to change the
nonce in order to get the required number of zeroes in the hash, this is called cryptographic puzzle. Once
the cryptographic puzzle is solved by the miner, then they will be able to deploy a block. If two miners
solve the cryptographic puzzle at the same time, then one with more resources will take the lead.
Hash:
Hash is like a function in which the data is passed and the result is a fixed length hexadecimal value (64
characters) or a function that maps variable length data into fixed length output. The hash is always
unique for a block unless the same person is cloned. The probability of having same hash is 1 in 60
million which is almost negligible. Many hashing methods are used but for blockchain, we use sha256.
Sha256 will be a combination of characters 0-9 and A-F and it is 256 bit. Hash functions are irreversible.
The genesis block will have a zero value for the previous hash as it is the first block.
The requirements for hash algorithms or its characteristics are:
• One way: Since, hash is a mapping technique so it maps the variable length data to fix length
output but the reverse is not true because it is mapping technique and not like encryption.
• Deterministic: The output will be the same if two people have the same data and created at the
same time or when a person is cloned.
• Fast computation: Hash is developed as the data is typed.
• Avalanche effect: A small change in the data will modify the entire hash value.
, Transaction:
Transaction means transfer of data. For example, to deploy an application, to create any smart
contract, or creating and deploying dummy cryptocurrency. Transactions can be financial or non-
financial.
Financial transaction: The financial transaction includes transfer of amount, bitcoins or ethers.
Nonfinancial transaction: The non-financial transactions does not include transfer of money. Its
applications include blockchain based Electronic voting machine (EVM), supply chain etc.
Cryptocurrency:
Cryptocurrency is the medium of exchange, created and stored electronically in the blockchain using
encryption techniques to control the creation of monetary units and verify the transfer of funds.
Bitcoin and ethers are best known examples of cryptocurrency.
Cryptocurrency uses cryptography to generate digital signatures. Digital signature is a combination of
public and private key which combine with smart contract and which when verified, then the
transaction will take place.
Private key is used both for encrypting and decrypting data and shared between sender and receiver of
the encrypted sensitive information. It is also called symmetric as being common for both parties.
From private key one can retrieve account.
Public key is used to encrypt, and for decryption it uses private key. It is not shared between sender
and receiver.
The following figure shows the encryption and decryption of a message by public and private keys.
Sender Receiver
This is a private Encryption Encrypted Encryption This is a private
Key of blockchain Algorithm Message Algorithm key of blockchain
Unencrypted message Receiver’s public key Receiver’s private key Unencrypted message
Decentralized distributed peer to peer:
Blockchain supports decentralized distributed peer to peer network. In decentralized distributed peer to
peer network, every user in itself is a master. Resources can be shared if the nodes agree to it. Multiple
copies of data will be created and each node in peer to peer blockchain will have all the information of
transaction in order to validate the transaction.