Implement a small blockchain in R and learn more about what a blockchain looks like and some of the core concepts behind it!
Size: 361.04 KB
Language: en
Added: Feb 09, 2018
Slides: 13 pages
Slide Content
AGRIAI
Blockchain in R
Cryptography To Become Virtually Un -hackable
Ramar Bose
Research Scholar, Anna University.
Blockchain
To store some data in a secure way. To this end, you first store the data in a
container - which you call a block.
BitCoin
In the case of BitCoin, each block contains several financial transactions.
When there are new transactions (or there is new data) a new block will be
created and will be added together with previous blocks to form a chain.
- The Blockchain.
Create Hash
To ensure the integrity of a block by connecting it to the other blocks in the chain.
A hash function takes something as an input and gives you a unique, encrypted
output.
Example :
Function that creates a hashed "block"
To calculate the valid hash if you know the hash of the previous block, which is created using
the hash of the block before and so on and so forth.
This provides you with an immutable, sequential chain of blocks.
block afterwards you would have to calculate all the hashes for the sequential blocks again
Proof-of-Work
The lot of information that must be stored in the blockchain, you will need to create a lot of
new blocks.
To control how many new blocks are created.
"Proof-of-Work" (PoW) algorithm which controls the difficulty of creating a new block.
"Proof" means that the computer has performed a certain amount of work.
To create an item that is hard to create but easy to verify.
PoW: find the next number that is divisible by 99 and divisable by the proof-number of the
last block.
Proof-of-Work Alogrithm
AddingNew Blocks
Define Genesis Block
Before you start building your blockchain, you need to start the chain somewhere. This
is done using a so-called Genesis Block. It contains no data and arbitrary values for
proof and previous hash (as there is no previous block).
Building the Blockchain
You start with the Genesis block and then add a few blocks using a loop.
Blockchain has been Linked Blocks
Output
Your chain looks like
AGRIAI
Ramar Bose
Research Scholar, Anna University.
Thank You