2. Components and structure of
blockchain
• Topics
- Blocks, The chain between blocks
- Hashing and signatures
- Block structure
- Block validators
- Smart contracts
- Block chain speed
3. Blocks
• A block in a blockchain is a fundamental component that carries crucial data about
transactions.
• When a transaction occurs, be it the transfer of a cryptocurrency like bitcoin or a
data exchange in a supply chain, the details are packaged into a digital structure
known as a block.
• A block contains not only the transaction data but also a timestamp marking when
the transaction occurred.
• As such, each block contains a unique identifier called a "hash." This alphanumeric
string acts as a digital fingerprint for the block, providing a way to confirm
transactions on the blockchain.
• The hash is a result of a complex mathematical process, and even a minor change
in the transaction data would generate a completely different hash, making the
blockchain highly secure against fraud and manipulation.
• Another important term related to the structure of a block is "nonce," an acronym
for "number used only once." This is an arbitrary bit of text that miners add in to
change the hash that the block produces.
4. • Block time – Approximate amount of time that each
block represents for transactions
Eg:2 minutes – 4 transactions.
If 100000 transactions happen, they have to wait for
their turn for an open block with space.
Some blockchains handle this prob with
network fees( amount that a sender is willing to pay to
have a transaction to be included in the block,Higher
the fee, greater the priority to be included in the
chain)
• Block size –The total amount of transactions that a
block can handle
10. header of an Ethereum block
• Hash of the previous block: Every block
header gives information about the previous
or parent block. This field contains the hash
value of the previous block and this reference
connects all the blocks. The size of this field is
32 bytes.
• Version: This field stores the version number
to show software upgrades. The size of the
version field is 4 bytes.
11.
12. Hashing and signatures
• Hashing-Hashing (or a hashing function) is a
mathematical procedure by which any input is
turned into a fixed-length output.
• Eg:SHA-1, SHA-2, and MD5.
• Output of a hashing function called MD5 with
an input of two pages of text:
9a137a78cf0c364e4d94078af1e221be
13. Hashing and signatures
• Hashing-Hashing (or a hashing function) is a
mathematical procedure by which any input is
turned into a fixed-length output.
• Eg:SHA-1, SHA-2, and MD5.
• Output of a hashing function called MD5 with
an input of two pages of text:
9a137a78cf0c364e4d94078af1e221be
14. Properties of hash function
• They are very fast for computers to run.
• The function is one way. You can get the hash
easily, but you cannot realistically use the
hash to restore the original.
• They can be used recursively.
15.
16.
17.
18.
19. The key properties of the hash function make it reliable.
Deterministic → This means that the output will be the same for the
given input in any given circumstances.
Preimage Resistant → The preimage resistant feature ensures that the
hash value is not useful for generating the input value.
Computationally efficient → The hash functions are efficient and don’t
require huge computational resources to execute.
Cannot be reversed engineered → The hash function cannot be reversed
engineered.
Collision resistant → Collision resistance ensures that no two inputs result
in the same output.
20. Merkle tree
• This recursive property to hashing is what
brings us to the concept of a Merkle tree,
named after the man who patented it.
• A Merkle tree is a data structure that, if your
were to draw it on a whiteboard, tends to
resemble a tree.
21.
22.
23. Digital signature
• Digital signing is a process to validate the authenticity and integrity of the
document by the sender. In simple terms, it means to check that the document
received is sent by the expected sender and it’s not changed by an intruder in the
network.
• Here, the private key of the sender encrypts the message. And the
corresponding public key of the sender, earlier shared with the receiver, can
decrypt the message.
• In order to generate a digital signature system, the sender creates a hash of the
document to be signed. Then, encrypt it with his own private key and send it. The
receiver decrypts the document using the sender’s public key. That ensures the
expected sender sends it.
• Digital Signing in Blockchain is a process to verify the user’s impressions of the
transaction. It uses the private key to sign the digital transaction, and its
corresponding public key will help to authorize the sender.
• However, in this way, anyone with the sender’s public key can easily decrypt the
document. Digital Signing targets the authenticity, not the security of the
document. It’s a way to ensure the source of the message transaction
24.
25. Digital key
• All digital signatures use public key
cryptography which uses private key and
public key
• To create a signature, the first hash is
produced from original data and the private
key is used to encypt the hash
• The encrypted hash + information(encryption
method) are added to original data
30. Global state
• Global state is a snapshot of all the data that
smart contracts can read from or write to,
such as account balances and the variables
within all smart contracts.
• Global state can be generally thought of as
the database of a blockchain, which is
required to validate incoming transactions
32. Block time
• Block time
• Bitcoin - 10 minutes
• Ethereum - 20 seconds
• Stellar - 4 seconds.
• These block times are determined by the code
that runs the network. For networks such as
Bitcoin, Litecoin, and Ethereum, the block
time is actually an average
33. Block size
• The block size is the maximum amount of
information that can be stored in each block. For
Bitcoin, this is 1 MB of data's worth of
transactions.
• For Ethereum, the limit is actually measured in
GAS, a special unit of measuring both processing
power (since Ethereum has smart contracts) as
well as storage.
• Unlike Bitcoin, the GAS/storage limit for each
block is not fixed but is instead adjusted by the
miners dynamically
34. Smart Contract (or cryptocontract
• A Smart Contract (or cryptocontract) is a computer
program that directly and automatically controls the
transfer of digital assets between the parties under
certain conditions.
• A smart contract works in the same way as a traditional
contract while also automatically enforcing the
contract.
• Smart contracts are programs that execute exactly as
they are set up(coded, programmed) by their creators.
Just like a traditional contract is enforceable by law,
smart contracts are enforceable by code.