**3.1 What is a hash?**

A hash is the output of an algorithm. Simply put, an algorithm is a mathematical formula consisting of more than one step. It calculates on output from one or more inputs. The output of the hash algorithm is a code, an encryption of the input. If we

*Blockchain Technology in Supply Chain Management DOI: http://dx.doi.org/10.5772/intechopen.105761*


#### **Table 1.**

*Changing "T" at the beginning to "t" [13].*


#### **Table 2.**

*Length of input [13].*

run the same input through the same algorithm several times, the output (hash) will always be the same. That is why it is sometimes called the fingerprint of the data. If only one letter is changed, the hash completely changes (**Table 1**).

On the other hand, it is practically impossible to re-engineer a hash and get the original input. If only the hash is known, the data that were supplied to the algorithm for calculation of this hash cannot be found out.

Furthermore, a hash has a fixed length. If the SHA256 algorithm is used, the length is 32 bytes citation regardless of how long the input was (**Table 2**):

#### **3.2 Creating a chain**

It was mentioned earlier that a data record in the blockchain contains the hash of the previous block. It is also known that the hash changes when any of the inputs change. It follows that the hash of the previous block cannot be changed without changing the hash of the current block; the current block is hence linked to the previous block. So, we have a chain of blocks, or better: a blockchain.

• Block1 → Block2 → Block3 → Block4

If each new block contains the hash of the previous block, this means that if a hacker wants to change any data in any previous block of the blockchain, this hacker will have to change the previous hashes in all previous blocks. If they want to change data in Block2, this changes the hash of Block2 and therefore the hash of the previous block for Block3. Hence, the hash of Block3 also changes, and the hacker needs to regenerate that has, and this continues along the whole blockchain to the end.

#### **3.3 Distributed ledger technology**

Once a hacker in the earlier-mentioned scenario has access to the database, it would not be a problem to change all the hashes. This is where distributed ledger technology (DLT) comes in. A ledger is a type of database. If DLT technology is used, it means that each "node," that is, each computer on the network, carries the database. The network type is a peer-to-peer network [14].

If this ledger were on one server, it can be hacked more easily. Even if it is in a cloud, it could be hacked as the servers in a cloud all mirror each other. A distributed ledger is much resilient, as it not administered by a central server or entity.

If a transaction takes place and should be added to the blockchain, it needs to be verified. If everybody just added transactions, fraudulent or corrupt data could enter the blockchain. Therefore, a consensus mechanism is required [15]. If a node wants to add a transaction, it asks the other nodes for confirmation. The other nodes will vote for the update, using an algorithm. If more than a threshold, for example, 50%, of the replies are confirmations, the transaction will be added to the block.

## **3.4 Transparency and immutability**

In blockchain technology, the network used is a peer-to-peer network. This means that each node is connected to the other node directly, not *via* servers as in a local area network (LAN). If the majority of these computers on the network have to agree on a change, a hacker would have to hack the majority of the computers in order to change one block and the subsequent blocks. While this is not absolutely impossible, it is considered not feasible in the computing industry [16]. This means in practice that the data in the blockchain cannot be changed. This is called immutability.

Furthermore, since a copy of the whole ledger is on every computer connected to the network, it is transparent.
