Professional Documents
Culture Documents
BC Final PDF
BC Final PDF
PRACTICAL FILE
Submitted By: Submitted To:
Annanya Badarya Mr. Manish
Sharma Assistant Professor
(20100BTCSE07515) CSE Department
Three blocks, all containing some transaction data. Not quite special yet. You can compare it to
some stand-alone word documents that simply describe what transactions have occurred and
how these have impacted certain balances. Document 1 would then chronologically describe
the first transactions that have occurred up to 1 MB, whereafter the next transactions would be
described in document 2 up to another MB, and so on. These documents are the blocks of data.
These blocks are now being linked (aka chained) together. To do this, every block gets a unique
(digital) signature that corresponds to exactly the string of data in that block. If anything inside
a block changes, even just a single digit change, the block will get a new signature.
Step 3 — How the signature (hash) is created.
The cryptographic hash function is used to create the digital signature for each unique block.
There is a large variety of hash functions, but the hashing function that is used by the Bitcoin
blockchain is the SHA-256 hashing algorithm. But how do the signatures stop someone from
simply inserting a new signature for each block after altering one (a change goes undetected if
all blocks are properly linked, people won’t be able to tell there was a change)? The answer is
that only hashes (signatures) that meet certain requirements are accepted on the blockchain.
Step 4 — When does the signature qualify, and who signs a block?
A signature doesn’t always qualify. A block will only be accepted on the blockchain if its
digital signature starts with — for example — a consecutive number of zeroes. For example;
only blocks with a signature starting with at least ten consecutive zeroes qualify to be added to
the blockchain. However, as explained in chapter 3, every string of data has only one unique
hash bound to it. What if the signature (hash) of a block doesn’t start with ten zeroes? Well, in
order to find the block a signature that meets the requirements, the string of data of a block
needs to be changed repeatedly until that specific string of data leads to a signature starting
with ten zeroes. Because the transaction data and metadata (block number, timestamp, et
cetera) need to stay the way they are, a small specific piece of data is added to every block that
has no purpose except for being changed repeatedly in order to find an eligible signature. This
piece of data is called the nonce of a block. The nonce is a completely random string
of numbers (note: pictures show other digits as well, but a nonce can only be numbers). To
summarize what was just explained, a block now contains; 1) transaction data, 2) the signature
of the previous block, and 3) a nonce. The process of repeatedly changing the nonce and
hashing the block’s data to find an eligible signature is called mining and is what miners do.
Miners spend electricity in the form of computational power by constantly changing the block
composition (nonce) and hashing it until they find an eligible signature (output). The more
computational power they have, the faster they can hash different block compositions and the
more likely they are to find an eligible signature faster. It is a form of trial and error.
Introduction:
Bitcoin was created in 2009 by Satoshi Nakamoto, a pseudonymous developer. Bitcoin is
designed to be completely decentralized and not controlled by any single authority. With a
total supply of 21 million, its scarcity and decentralized nature make it almost impossible to
inflate or manipulate. For this reason, many consider bitcoin to be the ultimate store of
value or ‘Digital Gold’. Bitcoin is fully open-source and operates on a proof-of-work
blockchain, a shared public ledger and history of transactions organized into "blocks" that
are "chained" together to prevent tampering. This technology creates a permanent record of
each transaction. Users on the Bitcoin network verify transactions through a process known
as mining, which is designed to confirm new transactions are consistent with older
transactions that have been confirmed in the past, ensuring users cannot spend a Bitcoin
they don’t have or attempt to double-spend coins.
BTC in practice
New coins are created as part of the Bitcoin mining process. Bitcoins are rewarded to
miners who operate computer systems that help to secure the network and validate
incoming transactions. These Bitcoin miners run full nodes and use specialized hardware
otherwise known as Application Specific Integrated Circuit Chips (ASICs) to find and
generate new blocks. Once a series of computationally demanding problems have been
solved a completed "block" is added to the ever-growing "chain", this mining process can
fluctuate and become easier or harder depending on network demand and value, this is
known as the network difficulty. Besides block rewards, miners also collect transaction fees
which further incentivizes them to secure the network and verify transactions. This
independent network of miners also decreases the chance for fraud or false information to
be recorded, as the majority of miners need to confirm the authenticity of each block of
data before it's added to the blockchain, in a process known as "proof of work."
Introduction:
The original Ethereum concept was introduced in 2013 by Vitalik Buterin with the release
of the Ethereum whitepaper and in 2015 the Ethereum platform was launched by Buterin
and Joseph Lubin along with several other co-founders. Ethereum is described as “the
world’s programmable blockchain,” positioning itself as an electronic, programmable
network that anyone can build on to launch cryptocurrencies and decentralized applications.
Unlike Bitcoin which has a maximum circulation of 21 million coins, the amount of ETH
that can be created is unlimited, although the time that it takes to process a block of ETH
limits how much ether can be minted each year. Another difference between Ethereum and
Bitcoin is how the networks treat transaction processing fees. These fees are known as
“gas” on the Ethereum network and are paid by the participants in Ethereum transactions.
The fees associated with Bitcoin transactions, however, are absorbed by the broader Bitcoin
network. Additionally, although both Bitcoin and Ethereum currently use Proof-of-Work
consensus mechanisms, Ethereum is in the process of gradually transitioning to a different
consensus algorithm known as Proof-of-Stake, which uses significantly less energy.
ETH in practice
Because ETH acts more as a utility token than a token of value, its supply is technically
infinite although this inflation curve slows dramatically over time. In theory, Ether will
always be in demand, meaning inflation should never devalue the asset beyond use, thus
Ether consistently enters circulation in the form of miner rewards. Miners get paid a
transaction fee called “gas.” Gas is paid by the user initiating the transaction to the miner
who validates the transaction- incentivizing future mining and network security. Because
there is so much use of the Ethereum network, gas fees can run quite high. This is because a
block can only hold so much gas which varies based on transaction types and amounts. As a
result, miners will choose transactions with the highest gas fees, meaning users are
competing to validate transactions first. When Ethereum transitions to a Proof-of-Stake
model, instead of miners verifying transactions, the network will use the owners of
significant stakes to validate transactions.
Aim: Case study of Private and Public Key Cryptographic and Digital
Signature.
Introduction:
Private Keys and Public Keys terms are used in cryptography. These keys are used to
encrypt/decrypt sensitive data.
Private Key:
The private key is used in both encryption as well as decryption. This key is shared between
the sender and receiver of the encrypted sensitive information. The private key is also
called "symmetric" because it is shared by both parties. Private key cryptography is faster
than public-key cryptography mechanism.
Public Key:
A private key should be kept secret for effective security; a public key can be freely
circulated without jeopardizing security.
In such a system, anybody can encrypt a message using the intended receiver's public key,
but only the receiver's private key can decode the message. This allows a server application
to produce a cryptographic key for compatible symmetric-key cryptography, then encrypt
that freshly generated symmetric key using a client's freely disclosed public key.
Digital Signature:
Digital signatures are the public-key primitives of message authentication. In the physical
world, it is common to use handwritten signatures on handwritten or typed messages. They
are used to bind signatory to the message.
Similarly, a digital signature is a technique that binds a person/entity to the digital data.
This binding can be independently verified by receiver as well as any third party.
Digital signature is a cryptographic value that is calculated from the data and a secret key
known only by the signer.
In real world, the receiver of message needs assurance that the message belongs to the
sender and he should not be able to repudiate the origination of that message. This
requirement is very crucial in business applications, since likelihood of a dispute over
exchanged data is very high.
Model of Digital Signature
As mentioned earlier, the digital signature scheme is based on public key cryptography. The
model of digital signature scheme is depicted in the following illustration −
Abu Dhabi is one of the richest cities in the world, boasting modern architectural wonders
from the first circular skyscraper to the dramatic Etihad towers to the world’s farthest
leaning tower. When it comes to managing the land deeds for the 375 sq. miles on which
the modern cityscape is built, there is a scope to digitize them and share these records with
the citizens and other stakeholders using cutting-edge technology.
Starting from selling a piece of land to constructing a building or residential complex to
selling the units to managing tenancy, there are a multitude of steps involved in creating a
land deed record and the process can span up to six years to complete.
“Unfortunately, all of this is not documented properly,” says Amey Rajput, General
Manager of the Blockchain Public Sector and Supply Chain Practice at Tech Mahindra1 ,
the leading provider of digital transformation consulting and business reengineering
services and solutions based in Pune, India. “The Department of Urban Planning &
Municipalities [DPM] had given the Abu Dhabi City Municipality2 [ADM] a road map of
what they wanted to adopt in the future to digitize their organization and one of the use
cases was a land registry.”
How Tech Mahindra Deployed Hyperledger Fabric for the Digital Transformation of Abu
Dhabi’s Land Registry
• View a land deed: Citizens can review information or completed documents related to
their land deed, and they can trust the data to be authentic. On Smart Hub, you cannot
manipulate, cheat, or use Photoshop in the document. In short, you cannot use those
documents for illegal purposes.
• Share a land deed: This function allows property owners to grant access to
documentation to an entity or individual for a limited time in order to complete certain jobs,
such as re-negotiating a loan or obtaining permission to work on site. The time sensitive
access can be given to multiple entities or government agencies, and once the designated
time frame expires, the app automatically revokes access.
• Review the audit trail: Under the Share With option on Smart Hub, owners can see how
many times a document was used and for what purposes, and subsequent owners will also
have complete transparency into the history of the property. You can also see if the
apartment is still under mortgage or if there is another loan which is taken against the deed.
Citizens First
“In the end, the number of smart contracts the land registry can produce was not a metric of
success for the ADM. The focus was more on the customer experience and less on the
technology,” says Malhotra.
“The municipality wanted to implement it so that citizens do not have to come to the
municipality and stand in queues for work they wanted to do, such as paying a bill or
document verification,” says Rajput. “Now everybody can accomplish all the activities for
which they would normally come to the ADM with just a click of a button.”
In the next phase, the future focus will be onboarding a wide variety of government and
non-government entities, such as banks. Another goal is to develop a personal identification
verification process that uses smart contracts versus physical ID cards.
Finally, the road map for the land registry includes capturing the land registration process.
There are a lot of 2D drawings which come from the developer, and multiple iterations and
approvals are needed to even construct a building. Tech Mahindra wants to capture that
end-to-end process on the blockchain.
Experiment – 7
Aim: Case Study taXchain provides a faster, better, cheaper way to
complete EU tax forms using Hyperledger Fabric
taXchain
• A blockchain network to exchange digitized tax forms
• Sponsored by Henkel and Siemens
• Developed by KrypC using Hyperledger Fabric 2.2
• One tax form is now in production, with more being implemented
Goals
• Prove that digitized tax forms save time and money
• Build an open, flexible platform that can support many partners
• Showcase the network to companies across the EU
Approach
1. Identify a nagging business problem
2. Build a working Proof of Concept with blockchain
3. Complete a production-ready network
4. Create an association to promote the network
5. Extend the network with more partners and further forms
Results
• Cost to complete one tax form slashed by 75% (from €120 to €30)
• Time to fill out one tax form cut from days to minutes
• Further gains to come from exploiting all free trade agreements
Python Code:
# importing the required libraries
import hashlib
import json
from time import time
# creating the Block_chain class
class Block_chain(object):
def init (self):
self.chain = []
self.pendingTransactions = []
self.newBlock(previousHash = "The Times 03/Jan/2009 Chancellor on brink of
second bailout for banks.", the_proof = 100)
self.pendingTransactions = []
self.chain.append(the_block)
return the_block
#Searching the blockchain for the most recent block.
@property
def lastBlock(self):
return self.chain[-1]
# Adding a transaction with relevant info to the 'blockpool' - list of pending tx's. def
newTransaction(self, the_sender, the_recipient, the_amount): the_transaction = {
'sender': the_sender,
'recipient': the_recipient,
'amount': the_amount
}
self.pendingTransactions.append(the_transaction) return
self.lastBlock['index'] + 1
# receiving one block. Turning it into a string, turning that into # Unicode
(for hashing). Hashing with SHA256 encryption,
# then translating the Unicode into a hexidecimal string. def
hash(self, the_block):