0% found this document useful (0 votes)
24 views34 pages

Blockchain SEE Theory

Blockchains are permanent records of transactions stored in blocks. Each block contains a block header with metadata like a version number, timestamp, and cryptographic hash, as well as a block body containing transactions. The mining process adds validated transactions to blocks and solves a complex math problem to generate a signature for each new block, securing it to the blockchain. This process provides security and confirmation of transactions on the distributed ledger.

Uploaded by

Dhanush Y J
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views34 pages

Blockchain SEE Theory

Blockchains are permanent records of transactions stored in blocks. Each block contains a block header with metadata like a version number, timestamp, and cryptographic hash, as well as a block body containing transactions. The mining process adds validated transactions to blocks and solves a complex math problem to generate a signature for each new block, securing it to the blockchain. This process provides security and confirmation of transactions on the distributed ledger.

Uploaded by

Dhanush Y J
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 34

 Block-Permanent store of records/ transactions which, once written,

cannot be altered or removed


 Each block consists
◦ Block header
◦ Block body
 Block version:
◦ 4-byte long version number
◦ Indicates the protocol version used by the node for block
validation rules
 Merkle tree root hash: Contains the hash value of all the
transactions in the block
 Timestamp: Stores the current time as seconds in the universal
time since January 1, 1970
 nBits: Target threshold of a valid block hash (to set current
difficulty)
 Nonce: Number Used Only Once is a 4-byte field that stores a
random number which usually starts with 0 and increases for
every hash calculation. Any change made to block data (like
Nonce) will change the entire block hash
 Is the process of validating transactions and adding them to the
Blockchain
 Nodes that performs mining process are called Miners

 Thus miners provide security and confirm transactions

 Mining performs two important functions

◦ Generate and release new cryptocurrency


◦ To verify, authenticate and then add  transactions to Blockchain
 There are 7 steps to process and add transactions to blockchain
 Step 1 : User performs a transaction using their wallet application
 Step 2 : Transactions broadcasted by wallet application and stored in pool
of unconfirmed transactions
 Step 3 : Miners select transactions from these pools and form them into a
‘block’.
 Miners usually prioritize transactions that have high transaction
fee set, to get highest reward
 Multiple miners can select the same transaction to be included in
their block
 Miners verifies and collects only the eligible transactions based on
blockchain history
 Step 4 : Once miner has created its block, it has to be added into the
blockchain for others to register the transactions
 The block first needs a signature, to confirm that it is a valid block
and other nodes can agree and accept this block
 This process of obtaining signature and their by acceptance is known
as CONSENSUS
 This signature is created by solving a very complex mathematical
problem that is unique to each block of transactions (finding Nonce)
 Every miner will work on a different problem unique to the block
they built
 Step 5 : The miner that first finds an eligible signature (output hash
value- a 32 digit string with preceding zero’s[signature requirement]) for
its block, broadcasts this block and its signature to all the other miners
 Step 6 : Other miners verify signature’s legitimacy as follows :
 Takes the string of data of the broadcasted block, hash it to see if the

output hash matches the included signature (output hash value)


 If valid, the other miners will confirm its validity and agree that the

block can be added to the blockchain


 The other nodes will accept the block and save it to their transaction

data as long as the transactions inside the block correspond correctly


with the current wallet balances (transaction history) at that point in time
 Step 7 : After a block has been added to the chain, every other block that
is added on top of it counts as a ‘confirmation’ for that block
 Example : If a transaction is included in block 502, and the blockchain is
507 blocks long, it means that transaction has 5 confirmations (507–502).
 The more confirmations your transaction has ( the deeper the block is
embedded in the chain), the harder it is for attackers to alter it.
 After a new block is added to the blockchain, all miners need to start over
again at step three
1. Make transactions
2. Wait in pool to be selected by miners
3. Miners collects valid transactions, forms the block
4. Finds signature to that block- CONSENSUS mechanism
5. Broadcasts the block to others
6. Others verifies the signature
7. Block finally gets added to the chain, gets confirmations.
8. Repeat step from 3 to 7
 A consensus mechanism
◦ Is a fault-tolerant mechanism used in computer and blockchain systems
to achieve necessary agreement on a single data value or a single state
of the network among distributed processes or multi-agent systems, such
as with cryptocurrencies
◦ It is useful in record-keeping, among other things
 A set of rules that decides on the contributions by the various participants
of the blockchain
 Different consensus mechanism algorithms work on different principles
◦ PoW : Proof of Work
◦ PoS : Proof of Stake
◦ PoC : Proof of Capacity
◦ PoB : Proof of Burn
◦ PoA : Proof of Activity
 Is a common consensus algorithm used by the most popular
cryptocurrency networks like bitcoin and litecoin
 It requires a participant node to prove that the work done and submitted
by them qualifies them to receive the right to add new transactions to the
blockchain 
 However, this whole mining mechanism of bitcoin needs high energy
consumption and longer processing time
 A low-cost, low-energy consuming, alternative to PoW algorithm
 It involves allocation of responsibility in maintaining the public ledger to
a participant node in proportion to the number of virtual currency tokens
held by it.
 However, this comes with a drawback that it promotes cryptocoin saving,
instead of spending
 Allow sharing of memory space of the contributing nodes on the
blockchain network.
 The more memory or hard disk space a node has, the more rights it is
granted for maintaining the public ledger
 Instead of investing into expensive hardware equipment, validators ‘burn’
coins by sending them to an address from where they are irretrievable
 Validators earn a privilege to mine on the system based on a random
selection process
 The more coins they burn, the better are their chances of being selected to
mine the next block
 Validators have a long-term commitment in exchange for their short-term
loss
 Proof of Activity (PoA) combines PoW and PoS mechanisms
 First, the miners must do the heavy computation to add an empty block
with header information and reward address
 Afterward, one empty block gets chosen based on the number of coins
they hold in their respective accounts
 Then, the miner of that empty block gets the chance to add its transactions
to the block
 The transactions are verified by network validators
 A digital signature is a mathematical technique used to validate the
authenticity and integrity of a message, software or digital document
 It applies cryptographic measures to the content of a message or
document in order to show the following to the message’s recipient:
◦ The sender of the message is real (authentication)
◦ The sender cannot deny that they sent the message (non-repudiation)
◦ The message has not been altered since it was sent (integrity)
 All digital signatures are electronic, but not all electronic signatures are
digital
 Digital signatures are based on public-key cryptography, also known as
asymmetric cryptography
 Normally there are three algorithms involved in the digital signature
process :
◦ Creation of two keys that are mathematically linked: an algorithm
provides a private key together with its corresponding public key
◦ Signature: this algorithm produces a signature when a private key and
the message that is being signed is received
◦ Verification: this algorithm checks the authenticity of the message
verifying it together with the signature and the public key
 When the sender digitally signs a document, a cryptographic hash is
generated for the document
 That cryptographic hash is then encrypted using the sender's private key,
which is stored in a secure HSM box (Hardware Security Module)
 It is then appended to the document and sent to the recipients along with
the sender's public key
 The recipient can decrypt the encrypted hash with the sender's public key
certificate
 A cryptographic hash is again generated on the recipient's end
 Both cryptographic hashes are compared to check its authenticity. If they
match, the document hasn't been tampered with and is considered valid
 The Ethereum virtual machine is the engine in which transaction code
gets executed
 EVM enables the development of potentially thousands of different
applications all on one platform
 Contracts written in a smart contract-specific programming language are
compiled into ‘bytecode’, which an EVM can read and execute
 It actually handles the internal state and computation in Ethereum
 Practically, EVM can be thought of as a large decentralized computer with
millions of objects called “accounts” which have the ability to maintain an
internal database, execute code and also they can talk to each other
 Truffle
◦ Truffle is a command-line development tool that offers a complete
ecosystem for developing and testing Ethereum-based applications
◦ Truffle comes with a configurable build pipeline support to make the
development process more convenient
 Remix IDE
◦ Remix IDE is an open-source, JavaScript based debugging and
compiling tool that is primarily used for writing Solidity contracts
◦ The best aspect of Remix IDE is that you can use it both in the browser
as well as locally
◦ It uses Metamask to connect to the Ethereum framework
 MetaMask
◦ MetaMask is a browser based tool designed for Ethereum
◦ It is a wallet that functions as a browser extension
◦ MetaMask allows you to interact with the Ethereum framework in a
hassle-free manner
 Solidity
◦ Solidity is the primary programming language used to write smart
contracts on the Ethereum framework
◦ It is a statically typed, high-level, contract oriented programming
language that draws inspiration from JavaScript, Python, and C++
◦ Smart contracts are designed to innately store all the programming logic
that occurs within the Ethereum Blockchain
 Ganache
◦ Ganache is an Ethereum development tool that is a part of the Truffle
Suite
◦ It is basically a personal Blockchain framework for Ethereum
development that can be used to deploy contracts, develop DApps, and
run tests
◦ It is available both as a desktop application (for Windows, Mac, and
Linux) and a command-line tool

You might also like