BlockChains &�Elliptic Curve Cryptography �
Presented by: Kelle Clark�Mini Talk Series�04/08/21
A Blockchain is a decentralized,�distributed,�immutable ledger that can be extended by all member nodes within its consortium network.�
Blockchains
Three types of accounts shown as the nodes: user accounts, member accounts and smart contract account.
Consortium network of member nodes uses a Peer-to-Peer (P2P) Architecture �
DB of blocks is replicated at all member nodes
Consortium Method chosen governs the creation of the blocks�
Base case (index 0):�Genesis block 🡪 sha-256 🡪encrypt��Inductive step (prev block added):�next transaction(s)+ metadata + prev block’s hash 🡪 sha-256 🡪 mine block to “satisfy difficulty level” with elliptic curve encryption��== immutable ledger��
Overview of a Blockchain Construction
time
Blockchains�post 2009 �Choose the platform
Bitcoin
Ethereum
Hyperledger�Fabric
IBM Blockchain
Microsoft Azure VSCode�BC extension
Litecoin
PUBLIC
PRIVATE
Consortium Method needs to provide incentive to use assets for good not to attack!
Tamper Evident through cryptographic links, immutable blocks
Earning the right to create, creates a reward system that generates electronic currency…like Bitcoin and Ether
Trustless, no need for parties involved to trust each other
Decide on the consortium method:�how to earn the reward.�
POW
POS
PoST�dPoS
dPoW
POA
Etc.
Finding the needle in a Blockchain
Access a block by the hash value or index in chain, but no common blockchain query language.
Within Etherium, can use �Etherium Quey Language EQL patterned after SQL��
SELECT block.parent.number, block.hash, block.timestamp, block.number, block.amountOfTransactions
FROM ethereum.blocks AS block
WHERE block.timestamp �BETWEEN date('2016−01−01') AND now() �AND block.transactions.size >10
ORDER BY block.transactions.size
LIMIT 100
Reference : Bragagnolo et al.
EQL Block Query Example
The Graph and Bitquery
To access the data stored within blocks of a blockchain, developers of dApps using blockchain db depend on centralized servers to index the data….defeating the beauty of Blockchain��The Graph ~ perform queries on Etherium
Bitquery ~ > performs queries on 20 blockchain platforms�
Creating a BlockChain in Visual Studio Code using js
Download Visual Studios Code.�Git clone Savjee/SavjeeCoin: A simple blockchain in Javascript. For educational purposes only. (github.com)�In VSCode, open node_modules/savjee/src/blockchain.js��add lines to end of blockcoin.js:�const myKey = ec.genKeyPair();�const {Blockchain2, Transaction2} = require('savjeecoin’);�const myChain = new Blockchain();�const tx = new Transaction(myKey.getPublic('hex'), 'toAddress', 100);�tx.signTransaction(myKey);�myChain.addTransaction(tx);�myChain.minePendingTransactions(myKey.getPublic('hex'));
console.log(JSON.stringify(myChain, null, 4));�console.log('Public key:', myKey.getPublic('hex’));�console.log('Private key:', myKey.getPrivate('hex’));��in terminal run cli: node blockchain.js
Resources
Databases: systems to record and access data for functional or analytic tasks.
Centralized: single point of failure/authority
Decentralized:�Division
Distributed:�Independence
Proof-of-Work�(POW)�
Proof-of-Stake�(POS)�
The more cryptocurrency “mined” (awarded), the greater the danger of deflation…