wtf is blockchain???

Download WTF is Blockchain???

Post on 21-Apr-2017

267 views

Category:

Technology

0 download

Embed Size (px)

TRANSCRIPT

  • WTF is Blockchain???Retro Friday Talk

    Guy Kloss

    guy.kloss@qrious.co.nzEnterprise Architect

    Qrious Limited

    7 October 2016

    guy.kloss@qrious.co.nz

  • NutsnBolts Explanation Beyond Money Issues

    Whats Money?

    Token, representing valueBy social contract

    Without acceptance, people wont care.Law doesnt matter!

    Guy Kloss | WTF is Blockchain??? 2/33

  • NutsnBolts Explanation Beyond Money Issues

    Outline

    1 NutsnBolts Explanation

    2 Beyond Money

    3 Issues

    Guy Kloss | WTF is Blockchain??? 3/33

  • NutsnBolts Explanation Beyond Money Issues

    Outline

    1 NutsnBolts Explanation

    2 Beyond Money

    3 Issues

    Guy Kloss | WTF is Blockchain??? 4/33

  • NutsnBolts Explanation Beyond Money Issues

    Building a Digital Currency: Infocoin

    The protocol: InfocoinThe money: infocoin

    Guy Kloss | WTF is Blockchain??? 5/33

  • NutsnBolts Explanation Beyond Money Issues

    First Step: A Signed Letter of Intent

    The problem: Double spending(using the same money multiple times)Procedure

    Statement of transactionSign that statement (with a crypto signature)

    No-one else could have created that statementAnnouncement of that statement to the entire world

    Guy Kloss | WTF is Blockchain??? 6/33

  • NutsnBolts Explanation Beyond Money Issues

    Using Serial Numbers: Unique Coins

    ProblemWhat if a statement is sent multiple times?More money, or a stutter?

    SolutionIntroduce identifiers (serial numbers) for infocoinsNeeds a trusted source of serial numbers (e. g. a bank)Bank keeps track of all infocoins& verifies all transactions are legit

    ProcedureBob checks back with bank(A) The serial number belongs to Alice(B) The infocoin hasnt been spent, yet

    Guy Kloss | WTF is Blockchain??? 7/33

  • NutsnBolts Explanation Beyond Money Issues

    Making a Collective Bank

    We dont want anyone to be in control of the currency Lets eliminate the bank

    ProcedureEveryone keeps a complete record oftransactions/ownershipsA shared public ledger

    The Blockchain(not quite, yet, but well call it that way already)

    Bob checks the transaction from Aliceagainst (his copy of) the blockchainIf it checks out:Bob sends the transaction to the entire networkEveryone updates their copy of the blockchain

    Guy Kloss | WTF is Blockchain??? 8/33

  • NutsnBolts Explanation Beyond Money Issues

    Making a Collective Bank

    The Problem:What if Alice sends the same infocoin to Bob andCharlie within a brief period time?

    Double spending problemBroadcast a transaction to the entire network

    Only accept on collective OK(when enough people have confirmed its OK)Whats enough?We dont know whos all on the Infocoin network!

    Guy Kloss | WTF is Blockchain??? 9/33

  • NutsnBolts Explanation Beyond Money Issues

    The Cheating Problem

    Scenario:Alice wants to take over the Infocoin networkShe creates a large number of bots (identities)Alices sock puppet identities swamp the network,announcing the transaction is OKOne or both (Bob and Charlie)are fooled into accepting the transaction

    Guy Kloss | WTF is Blockchain??? 10/33

  • NutsnBolts Explanation Beyond Money Issues

    Proof-of-Work

    Idea: Proof-of-workMake it hard to validate transactions(computationally costly)Reward validated transactions

    Why does that help?Costly effort:Not feasible to influence with many identitiesReward is to incentivise others to still do it

    Impractical to cheat

    Guy Kloss | WTF is Blockchain??? 11/33

  • NutsnBolts Explanation Beyond Money Issues

    Proof-of-Work Details

    Impractical to apply proof-of-work to every transactionQueue unapproved transactionsValidate transactions against own copy of blockchainSolve a hard computational puzzle the proof-of-workThe puzzle is related to the queued transactionsThe network accepts a validation only with the solution

    Guy Kloss | WTF is Blockchain??? 12/33

  • NutsnBolts Explanation Beyond Money Issues

    Block by Block

    Guy Kloss | WTF is Blockchain??? 13/33

  • NutsnBolts Explanation Beyond Money Issues

    The Puzzle

    Bitcoin uses a hash function SHA-256(also other functions will do)Queue has a label lA random number x (a nonce) is appendedThis is hashed h(l |x)If the hash starts with n zeros, the puzzle is solvedIf not, choose a new nonce x , rinse and repeat

    Guy Kloss | WTF is Blockchain??? 14/33

  • NutsnBolts Explanation Beyond Money Issues

    The Puzzle

    h("Hello, world!0")

    1312af178c253f84028d480a6adc1e25e81caa44c749ec81976192e2ec934c64

    h("Hello, world!1")

    e9afc424b79e4f6ab42d99c81156d3a17228d6e1eef4139be78e948a9332a7d8

    x = 2, 3, . . .; At x = 4250 we get:h("Hello, world!4250")

    0000c3af42fc31103f1fdc0151fa747ff87349a4714df7cc52ea464e12dcd4e9

    Number of leading zeros is adjusted regularlyCaters for increase in compute performanceNormalises new block frequency(Bitcoin: average 10 min per block)

    Guy Kloss | WTF is Blockchain??? 15/33

  • NutsnBolts Explanation Beyond Money Issues

    Rewarding the Sweat & Tears

    Competition with the worldSuccessful block wins a reward(in bitcoin, ether, infocoin, . . . )

    This is miningActs as an incentive for the hard workKeeps the network honestAdjustments to rewards system

    Halving eventsSuperceding with transaction fees for miners

    Capping of total number of coins ever

    Guy Kloss | WTF is Blockchain??? 16/33

  • NutsnBolts Explanation Beyond Money Issues

    Rewarding the Sweat & Tears

    Guy Kloss | WTF is Blockchain??? 17/33

  • NutsnBolts Explanation Beyond Money Issues

    Another Block in the Chain

    Wed like to retain order of transactionsOtherwise:Uncertainty on who owns which infocoin at a timeA linear chain: Next block refers to the previous

    A new block is added to the chain

    Guy Kloss | WTF is Blockchain??? 18/33

  • NutsnBolts Explanation Beyond Money Issues

    Another Block in the Chain

    Guy Kloss | WTF is Blockchain??? 19/33

  • NutsnBolts Explanation Beyond Money Issues

    Concurrency Causes Forks

    Occasionally a fork happensIf two miners succeed in solving the puzzle(nearly simultaneously)

    Guy Kloss | WTF is Blockchain??? 20/33

  • NutsnBolts Explanation Beyond Money Issues

    What now?

    This is what were trying to avoidKeep track of both pathsMiners only work on the longest forkOne will eventually get longerB gets the next block first, work on A will ceaseOutstanding transactions on B will be integrated

    Agreed upon ordering in time will be achieved

    Guy Kloss | WTF is Blockchain??? 21/33

  • NutsnBolts Explanation Beyond Money Issues

    Dishonesty on Forking

    Back to the double spending problem:Forks can be a chance to double spendWill be detected once both blocks are availableVariant on double spending if Alice = Bob(multiple identities)

    Forking intentionally after Charlie accepts the coinCommunity will continue on longest/earliest branchNot feasible to catch up with the legit branch

    Guy Kloss | WTF is Blockchain??? 22/33

  • NutsnBolts Explanation Beyond Money Issues

    Outline

    1 NutsnBolts Explanation

    2 Beyond Money

    3 Issues

    Guy Kloss | WTF is Blockchain??? 23/33

  • NutsnBolts Explanation Beyond Money Issues

    Content of Records

    For money, a block contain payment records.

    What if it contained . . .Multiple columns?Documents (e. g. JSON)?Code?

    Guy Kloss | WTF is Blockchain??? 24/33

  • NutsnBolts Explanation Beyond Money Issues

    Private Chains

    Within organisationsWithin user groups

    Guy Kloss | WTF is Blockchain??? 25/33

  • NutsnBolts Explanation Beyond Money Issues

    Non-Chains

    Just the hash trees (Merkle trees)Not using cryptographic signaturesOne-sided assurance only (from the CA side)

    No assurance from the client/userOnly proving the positive (document exists)

    Not the negative (document does not exist)

    Guy Kloss | WTF is Blockchain??? 26/33

  • NutsnBolts Explanation Beyond Money Issues

    Side Chains?

    What is the biggest, most usedand most secure blockchain in operation?

    BitcoinSo we should be using that one, right?Cant do. Not useful for non-payment purposes.

    Pegging a side chain to another (e. g. Bitcoin)Also possible for private chains

    Federation approach

    Guy Kloss | WTF is Blockchain??? 27/33

  • NutsnBolts Explanation Beyond Money Issues

    Visions

    New take on identity managementOwnership

    Land registriesAssets

    Transparency for KiwiSaver & weapons/tobacco/. . .NZX trading for (smaller) companiesProof of ownership

    Instant trading any timeSimplified Support Contracts

    Guy Kloss | WTF is Blockchain??? 28/33

  • NutsnBolts Explanation Beyond Money Issues

    Outline

    1 NutsnBolts Explanation

    2 Beyond Money

    3 Issues

    Guy Kloss | WTF is Blockchain??? 29/33

  • NutsnBolts Explanation Beyond Money Issues

    Proof of Work

    Waste of energy?US$ 1 million in electricity for every day10100 times Googles global compute capacity

    Scalability?Alternatives

    Proof of StakeHybridsCentralised

    May defeat the purpose

    Guy Kloss | WTF is Blockchain??? 30/33

  • NutsnBolts Explanation Beyond Money Issues

    Which Chain?

    Which chain to adopt for use?The scene is still much in flowNot all problems are solved, yet

    Guy Kloss | WTF is Blockchain??? 31/33

  • NutsnBolts Explanation Beyond Money Issues