1 of 19

BlockChains &�Elliptic Curve Cryptography �

Presented by: Kelle Clark�Mini Talk Series�04/08/21

2 of 19

A Blockchain is a decentralized,�distributed,�immutable ledger that can be extended by all member nodes within its consortium network.�

3 of 19

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�

4 of 19

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

5 of 19

Blockchains�post 2009 �Choose the platform

Bitcoin

Ethereum

Hyperledger�Fabric

IBM Blockchain

Microsoft Azure VSCode�BC extension

Litecoin

PUBLIC

PRIVATE

6 of 19

7 of 19

8 of 19

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

9 of 19

Decide on the consortium method:�how to earn the reward.�

POW

POS

PoST�dPoS

dPoW

POA

Etc.

10 of 19

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�

11 of 19

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

12 of 19

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

13 of 19

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

14 of 19

Resources

15 of 19

Databases: systems to record and access data for functional or analytic tasks.

  • SQL and NoSQL types of DB
  • Traditional databases use a Client Server Architecture where trust rests in the management of the system.

16 of 19

Centralized: single point of failure/authority

Decentralized:�Division

Distributed:�Independence

17 of 19

Proof-of-Work�(POW)�

  • The difficulty level of the cryptographic hashing problem tied to the collective computing power of the network and needed transactions per second.
  • Expense of MINING (working to solve THE problem) forms a basis for the value of the cryptocurrency

18 of 19

Proof-of-Stake�(POS)�

  • POS rewards miners for holding on to and using e-currency earned (staking)
  • Dividends earned are a function of amount staked
  • Collaborative computation to solve problem lessens energy consumption and manages deflation (amt of assets on market).

19 of 19

The more cryptocurrency “mined” (awarded), the greater the danger of deflation…