Introduction to
Blockchain Technology
AISHWARYA
Blockchain Myths
• Blockchain ≠ Bitcoin (or any other cryptocurrencies)
•You cannot replace a database with a blockchain
Blockchain is not a distributed database
Blockchain is not designed to securely store ANY data
•Anything and everything in the world cannot be solved using a blockchain
Blockchain is good but it cannot change the society in a week or a month
or a year
Decentralization
Requirements for a Successful Supply
Chain
1. Minimization of material procurement
2. Maximization of manufacturing capacity and sales
3. Meet demand numbers
4. Respond quickly to market opportunity by purchasing the production shortfall
from other players
5. Objective of each production unit would be to maximize the throughput and
its margin
6. Procurement would purchase the feedstock with not the best yields at lowest
cost
Requirements for a Successful Supply
Chain
Needs Strong Coordination among the Players
How do we obtain Real-time information from the
Stakeholders A web-based portal???
How do we obtain Real-time information from the Stakeholders?
We need a decentralized solution- Noone trust each other, buy they should
cooperate.
Blockchain is the answer!!!!
Decentralization and Blockchain
oYou have a network of different players (businesses, enterprises, commercial
establishments, Government or Private bodies, or even the individuals)
oEveryone has their own interest – they want to fulfill their goal
oThey do not trust each other
oIf they cooperate, the society gets benefited
oTrustless Decentralization = Blockchain
Solution to successful Supply Chain
Needs Strong Coordination among the Players
Hashing
Hashing is the process of converting raw data into an irreversible scrambled
format.
It applies a mathematical function, known as a hash function, to the input,
transforming it into a fixed-length output known as the hash value or digest. This
process ensures that the original information cannot be reconstructed from the
hash.
Requirement of Hashing
1. One Way : Data Encrypted
2. Deterministic : XYZ 2025205
3. Fast Computation:
4. Withstand Collision: No hacker should hack easily
5. Avalanche Effect:
Data
Password Hash Storage
If the recalculated hash matches the hash stored on the servers, during initial sign
up the log in is allowed
Integrity Verification
Hashing can be also for integrity checks to ensure the data isn’t corrupted . The
hash value/ digest will always be the same for similar input.
Hashing illustration
http://www.blockchain-basics.com/HashFunctions.html
Information hiding through Hashing
Given an H(x), it is “computationally difficult” to find x
• The difficulty depends on the size of the message digests
• Hiding helps to commit a value and then check it later
• Compute the message digest and store it in a digest store –
commit
• To check whether a message has been committed, match the
message digest at the digest store
What is SHA?
Secure Hash Algorithms
NSA & NIST joint development
Has multiple families such as SHA-0
SHA-1: Produces a 160-bit hash value, but is considered insecure due to
vulnerabilities.
SHA-2: A family of hash functions including SHA-224, SHA-256, SHA-384,
and SHA-512. SHA-256 is the most widely used in blockchain.
SHA-3: A newer standard designed to offer a higher level of security and
efficiency.
Website: https://en.wikipedia.org/wiki/Secure_Hash_Algorithms
Comparison of SHA Parameters
SHA-1
In cryptography, SHA-1 (Secure Hash Algorithm 1) is a hash function which
takes an input and produces a 160-bit (20-byte) hash value known as a message
digest – typically rendered as 40 hexadecimal digits.
It was designed by the United States National Security Agency, and is a U.S.
Federal Information Processing Standard.
Hash Function – SHA256
•Hashing is the process of converting raw data into an irreversible scrambled
format.
•It applies a mathematical function, known as a hash function, to the input,
transforming it into a fixed-length output known as the hash value or digest.
•This process ensures that the original information cannot be reconstructed from
the hash.
SHA-256
The “256” in SHA-256 signifies its fixed hash digest size, always producing a
256-bit value, regardless of the input plaintext or cleartext size. This
characteristic ensures consistent and strong cryptographic hashing.
Padd
Steps of SHA Working
Input Data: You provide some data (a message). This could be text, numbers, a file,
etc.
Padding: The message is first padded so that its length becomes a multiple of 512 bits.
Padding involves adding some extra bits to the message to ensure it's compatible with
the SHA-256 algorithm.
Message Blocks: The padded message is broken into chunks of 512 bits (64 bytes).
Initial Hash Values: SHA-256 starts with 8 initial hash values (these are constants).
Hashing Process: The algorithm processes each 512-bit block through 64 rounds of
mathematical operations (mixing, shifting, and rotating bits). These steps mix up the
data in a specific way.
Final Hash: After all the blocks are processed, the result is a fixed 256-bit (64-
character hexadecimal) hash value, which is the "fingerprint" of the input data.
Important Characteristics:
Fixed Size: Always produces a 256-bit output, regardless of input size.
Deterministic: Same input always produces the same hash.
Irreversible: It’s practically impossible to reverse the hash to get the original
input.
Unique: A small change in input drastically changes the hash (this is called the
avalanche effect).
Example
Input: "abc“
The word "abc" will be processed through SHA-256 to produce a 256-bit hash value.
Here’s an outline of the main steps involved in SHA-256:
First, the input string "abc" is converted into binary format using the ASCII values of
the characters:
'a' = 97 → 01100001
'b' = 98 → 01100010
'c' = 99 → 01100011
Step 1: Convert Input to Binary
The binary representation of "abc"
becomes:
01100001 01100010 01100011
Step 2: Padding the Input
SHA-256 requires the message length to be a multiple of 512 bits. If the input
message is shorter than 512 bits, it is padded. Padding is done by:
• Adding a single "1" bit.
• Adding "0" bits until the message length is 448 bits.
• Adding the original message length as a 64-bit binary number at the end (in
this case, 24 bits for "abc").
So, the padded message for "abc" looks like:
01100001 01100010 01100011 10000000 ...
00000000000000000000000000011000
This padded message is now 512 bits long.
Step 3: Initialize Hash Values
SHA-256 uses 8 initial hash values (these are constants):
H0 = 6a09e667
H1 = bb67ae85
H2 = 3c6ef372
H3 = a54ff53a
H4 = 510e527f
H5 = 9b05688c
H6 = 1f83d9ab
H7 = 5be0cd19
1.414213562...
0 . 0110 1010 0000 1001 1110 0110 0110 0111
6 a 0 9 e 6 6
7
Step 4: Process the Message in Blocks
SHA-256 processes the message in 512-bit blocks (in our case, there is only
one block). The message undergoes 64 rounds of operations, which involve:
Logical operations like XOR, AND, OR, and bitwise shifts and rotations.
Mixing the message bits with constants and the initial hash values.
Each round updates the hash values through a series of mathematical
functions. The goal of these operations is to mix up the input bits in a way
that results in a seemingly random output.
Step 5: Final Hash Value
After processing the block, the final hash values are concatenated to form the
256-bit output.
For the input “abc” the SHA 256 hash is:
ba7816bf 8f01cfea 414140de 5dae2223 b00361a3 96177a9c
b410ff61 f20015ad
Working of SHA
Step 1 & Padding length: Padding Bits: Bits are appended to the original input to
make it compatible with the hash function.
Total bits must always be multiple of 512 or 1024.
For example: 96 to 512 or 960 to 1024
The first bit added is ‘1’ and the rest are all zeros.(97 bits)
Original Message Padding Bits Length of input
Final Data to be hashed as a multiple of 512
RSA Algorithm:
The RSA algorithm is a widely-used encryption method that ensures secure
communication by converting plain text into scrambled, unreadable text (ciphertext) and
vice versa.
Key Generation:
1. Select two large prime numbers, p and q.
2 Multiply these numbers to find n = p x q, where n is called the modulus for encryption
and decryption.
3.
.
3. Choose a number e less than n, such that n is relatively prime to (p - 1) x (q -1). It means
that e and (p - 1) x (q - 1) have no common factor except 1. Choose "e" such that 1<e < φ (n), eis prime
to φ (n),
gcd (e,d(n)) =1
4. If n = p x q, then the public key is <e, n>. A plaintext message m is encrypted using public key <e,
n>. To find ciphertext from the plain text following formula is used to get ciphertext C.
C
Here, m must be less than n. A larger message (>n) is treated as a concatenation of messages, each of
which is encrypted separately.
5. To determine the private key, we use the following formula to calculate the d such that:
Or
6. The private key is <d, n>. A ciphertext message c is decrypted using private key <d, n>. To calculate
plain text m from the ciphertext c following formula is used to get plain text m.

Blockchain Technology Explained: A Beginner's Guide to the Future of the Internet

  • 1.
  • 2.
    Blockchain Myths • Blockchain≠ Bitcoin (or any other cryptocurrencies) •You cannot replace a database with a blockchain Blockchain is not a distributed database Blockchain is not designed to securely store ANY data •Anything and everything in the world cannot be solved using a blockchain Blockchain is good but it cannot change the society in a week or a month or a year
  • 3.
  • 4.
    Requirements for aSuccessful Supply Chain 1. Minimization of material procurement 2. Maximization of manufacturing capacity and sales 3. Meet demand numbers 4. Respond quickly to market opportunity by purchasing the production shortfall from other players 5. Objective of each production unit would be to maximize the throughput and its margin 6. Procurement would purchase the feedstock with not the best yields at lowest cost
  • 5.
    Requirements for aSuccessful Supply Chain Needs Strong Coordination among the Players How do we obtain Real-time information from the Stakeholders A web-based portal??? How do we obtain Real-time information from the Stakeholders? We need a decentralized solution- Noone trust each other, buy they should cooperate.
  • 6.
  • 7.
    Decentralization and Blockchain oYouhave a network of different players (businesses, enterprises, commercial establishments, Government or Private bodies, or even the individuals) oEveryone has their own interest – they want to fulfill their goal oThey do not trust each other oIf they cooperate, the society gets benefited oTrustless Decentralization = Blockchain
  • 8.
    Solution to successfulSupply Chain Needs Strong Coordination among the Players
  • 9.
    Hashing Hashing is theprocess of converting raw data into an irreversible scrambled format. It applies a mathematical function, known as a hash function, to the input, transforming it into a fixed-length output known as the hash value or digest. This process ensures that the original information cannot be reconstructed from the hash.
  • 10.
    Requirement of Hashing 1.One Way : Data Encrypted 2. Deterministic : XYZ 2025205 3. Fast Computation: 4. Withstand Collision: No hacker should hack easily 5. Avalanche Effect: Data
  • 11.
    Password Hash Storage Ifthe recalculated hash matches the hash stored on the servers, during initial sign up the log in is allowed
  • 12.
    Integrity Verification Hashing canbe also for integrity checks to ensure the data isn’t corrupted . The hash value/ digest will always be the same for similar input.
  • 13.
  • 14.
    Information hiding throughHashing Given an H(x), it is “computationally difficult” to find x • The difficulty depends on the size of the message digests • Hiding helps to commit a value and then check it later • Compute the message digest and store it in a digest store – commit • To check whether a message has been committed, match the message digest at the digest store
  • 15.
    What is SHA? SecureHash Algorithms NSA & NIST joint development Has multiple families such as SHA-0 SHA-1: Produces a 160-bit hash value, but is considered insecure due to vulnerabilities. SHA-2: A family of hash functions including SHA-224, SHA-256, SHA-384, and SHA-512. SHA-256 is the most widely used in blockchain. SHA-3: A newer standard designed to offer a higher level of security and efficiency. Website: https://en.wikipedia.org/wiki/Secure_Hash_Algorithms
  • 16.
  • 17.
    SHA-1 In cryptography, SHA-1(Secure Hash Algorithm 1) is a hash function which takes an input and produces a 160-bit (20-byte) hash value known as a message digest – typically rendered as 40 hexadecimal digits. It was designed by the United States National Security Agency, and is a U.S. Federal Information Processing Standard.
  • 18.
    Hash Function –SHA256 •Hashing is the process of converting raw data into an irreversible scrambled format. •It applies a mathematical function, known as a hash function, to the input, transforming it into a fixed-length output known as the hash value or digest. •This process ensures that the original information cannot be reconstructed from the hash.
  • 19.
    SHA-256 The “256” inSHA-256 signifies its fixed hash digest size, always producing a 256-bit value, regardless of the input plaintext or cleartext size. This characteristic ensures consistent and strong cryptographic hashing. Padd
  • 20.
    Steps of SHAWorking Input Data: You provide some data (a message). This could be text, numbers, a file, etc. Padding: The message is first padded so that its length becomes a multiple of 512 bits. Padding involves adding some extra bits to the message to ensure it's compatible with the SHA-256 algorithm. Message Blocks: The padded message is broken into chunks of 512 bits (64 bytes). Initial Hash Values: SHA-256 starts with 8 initial hash values (these are constants). Hashing Process: The algorithm processes each 512-bit block through 64 rounds of mathematical operations (mixing, shifting, and rotating bits). These steps mix up the data in a specific way. Final Hash: After all the blocks are processed, the result is a fixed 256-bit (64- character hexadecimal) hash value, which is the "fingerprint" of the input data.
  • 21.
    Important Characteristics: Fixed Size:Always produces a 256-bit output, regardless of input size. Deterministic: Same input always produces the same hash. Irreversible: It’s practically impossible to reverse the hash to get the original input. Unique: A small change in input drastically changes the hash (this is called the avalanche effect).
  • 22.
    Example Input: "abc“ The word"abc" will be processed through SHA-256 to produce a 256-bit hash value. Here’s an outline of the main steps involved in SHA-256: First, the input string "abc" is converted into binary format using the ASCII values of the characters: 'a' = 97 → 01100001 'b' = 98 → 01100010 'c' = 99 → 01100011 Step 1: Convert Input to Binary The binary representation of "abc" becomes: 01100001 01100010 01100011
  • 23.
    Step 2: Paddingthe Input SHA-256 requires the message length to be a multiple of 512 bits. If the input message is shorter than 512 bits, it is padded. Padding is done by: • Adding a single "1" bit. • Adding "0" bits until the message length is 448 bits. • Adding the original message length as a 64-bit binary number at the end (in this case, 24 bits for "abc"). So, the padded message for "abc" looks like: 01100001 01100010 01100011 10000000 ... 00000000000000000000000000011000 This padded message is now 512 bits long.
  • 24.
    Step 3: InitializeHash Values SHA-256 uses 8 initial hash values (these are constants): H0 = 6a09e667 H1 = bb67ae85 H2 = 3c6ef372 H3 = a54ff53a H4 = 510e527f H5 = 9b05688c H6 = 1f83d9ab H7 = 5be0cd19 1.414213562... 0 . 0110 1010 0000 1001 1110 0110 0110 0111 6 a 0 9 e 6 6 7
  • 25.
    Step 4: Processthe Message in Blocks SHA-256 processes the message in 512-bit blocks (in our case, there is only one block). The message undergoes 64 rounds of operations, which involve: Logical operations like XOR, AND, OR, and bitwise shifts and rotations. Mixing the message bits with constants and the initial hash values. Each round updates the hash values through a series of mathematical functions. The goal of these operations is to mix up the input bits in a way that results in a seemingly random output.
  • 26.
    Step 5: FinalHash Value After processing the block, the final hash values are concatenated to form the 256-bit output. For the input “abc” the SHA 256 hash is: ba7816bf 8f01cfea 414140de 5dae2223 b00361a3 96177a9c b410ff61 f20015ad
  • 27.
    Working of SHA Step1 & Padding length: Padding Bits: Bits are appended to the original input to make it compatible with the hash function. Total bits must always be multiple of 512 or 1024. For example: 96 to 512 or 960 to 1024 The first bit added is ‘1’ and the rest are all zeros.(97 bits) Original Message Padding Bits Length of input Final Data to be hashed as a multiple of 512
  • 28.
    RSA Algorithm: The RSAalgorithm is a widely-used encryption method that ensures secure communication by converting plain text into scrambled, unreadable text (ciphertext) and vice versa. Key Generation: 1. Select two large prime numbers, p and q. 2 Multiply these numbers to find n = p x q, where n is called the modulus for encryption and decryption. 3.
  • 29.
    . 3. Choose anumber e less than n, such that n is relatively prime to (p - 1) x (q -1). It means that e and (p - 1) x (q - 1) have no common factor except 1. Choose "e" such that 1<e < φ (n), eis prime to φ (n), gcd (e,d(n)) =1 4. If n = p x q, then the public key is <e, n>. A plaintext message m is encrypted using public key <e, n>. To find ciphertext from the plain text following formula is used to get ciphertext C. C Here, m must be less than n. A larger message (>n) is treated as a concatenation of messages, each of which is encrypted separately. 5. To determine the private key, we use the following formula to calculate the d such that: Or 6. The private key is <d, n>. A ciphertext message c is decrypted using private key <d, n>. To calculate plain text m from the ciphertext c following formula is used to get plain text m.