This document discusses blockchain implementation and provides details about how blockchains work. It contains the following key points:
1) Transaction data is grouped into blocks and linked together through cryptographic hashing to form a chain. Each new block contains the hash of the previous block.
2) Blockchains provide a secure and permanent record of transactions through a distributed network of nodes that validate new blocks. Once data is recorded, it cannot be altered without consensus from the network majority.
3) The document then discusses specific aspects of blockchain like public distributed ledgers, hash encryption using SHA256, proof of work, and mining new blocks to generate bitcoin rewards.
It proposes a blockchain implementation to securely store immutable records like
2. Block in a blockchain
Transaction data is permanently recorded in files
called blocks. They can be thought of as the individual
pages of a city recorder's record book
3. • Blocks hold batches of valid transactions that are hashed
and encoded into a Merkle tree. Each block includes the
cryptographic hash of the prior block in the blockcha`in,
linking the two. The linked blocks form a chain.
4. • By design, a blockchain is resistant to modification of the
data. It is "an open, distributed ledger that can record
transactions between two parties efficiently and in a
verifiable and permanent way". For use as a distributed
ledger, a blockchain is typically managed by a peer-to-
peer network collectively adhering to a protocol for inter-
node communication and validating new blocks.
5. • Once recorded, the data in any given block cannot be
altered retroactively without alteration of all subsequent
blocks, which requires consensus of the network majority.
Although blockchain records are not unalterable,
blockchains may be considered secure by design and
exemplify a distributed computing system with high
Byzantine fault tolerance. Decentralized consensus has
therefore been claimed with a blockchain.
6. 1) Public distributed ledger:
• The blockchain is accessible to everyone who’s part of the
network. The users can even access the transaction
details from the time the blockchain was created. The
users however don’t get access to the identities of the
people involved in the transactions.
• There’s no central authority like a bank that controls the
blockchain. This prevents any data alteration that can take
effect by hacking this central authority. The users in the
network ensure that no alteration to the block can stay
permanent, as each user has a copy of the blockchain.
9. 2) Hash Encryption:
• Blockchain uses the SHA256 algorithm to secure its data.
• The sender’s address (his/her public key), the receiver’s
address, the details of the transaction and his/her private
key are passed through the SHA256 algorithm. The
encrypted output obtained then is transmitted across the
world. After it is verified, it is added to the blockchain.
• The SHA256 algorithm makes hacking the data near
impossible, and makes the verification of the sender’s and
receiver’s authenticity very easy.
10.
11.
12.
13. 3) Proof of Work
• Previous Hash: The hash address that can uniquely
identify the preceding block.
Transaction Details: The details on various transactions
that are to take place.
Nonce: The random value that is used to variate the value
of the hash address of the block
Hash Address of the Block: The values of previous
hash, transaction details and nonce are passed through a
hashing algorithm. The output obtained, which is a 256-
bit, 64-character long value is the hash address that is
used to uniquely identify the block. This output is the hash
of the block.
14.
15.
16. 4) Mining:
• The person who finds the nonce that satisfies the hash
requirement for the block is awarded the 12.5 bitcoins.
The last transaction in every block assigns 12.5 BTC to
the miner as a reward. This is the only way to generate
new Bitcoins. Every 4 years the reward for mining a block
reduces. The next halving, which would take place in
2020 would reduce the reward to 6.25 BTC.
20. Our implementation
• Certain records are required to be immutable after the certain
period of time such as mark sheet of passed students , tax
statement etc.
• Suppose there is a network of nodes and they contains some
documents
• Instead of saving these documents in a central node which can
be prone to attack or misused by the admin as there is one
single point of failure.
• So let those documents be stored locally on nodes.
• We are taking documents and convert the documents and run
SHA256 overate to get the hash-code for the documents.
• Now this hash code is distributed to all the nodes on the
network .
• Each node continuously cross validate each others hash
codes.
21. • If one node makes changes to its documents it’s hash
code also changes. And it fails the cross validation part.
For ADDING A NEW BLOCK.
When a new document is introduced to any node. It runs
SHA256 and shares its hash-code to other nodes. Which
then they store in their DB
22. SUPPOSE WE NEED TO CHANGE A
DOCUMENT WHICH IS ALREADY
ADDED
• Suppose one node changes the a document which is
already added in the block. So the top hash code will also
change. This will get the node invalidated out. So instead
he will send a request to all other nodes for a change. If
majority accepts his request. The sender node will make
changes in his chain and share his top hash which the
nodes will accept. And since majority(51% or more) have
accepted this changes. Others will be forced to take this
change.