MedRec

chmod for medical records

Nchinda Nchinda

@Firescar96

Researcher in Viral Communications

https://slides.com/firescar96/medrec-45

Hashing

Public Key Cryptography

Diffie-Hellman

Signing

Encryption

Merkle Trees

zkSnarks?

On Distributed Communication Networks - Paul Baran

Bitcoin and the Blockchain

Strengths

  • it works. today. right now.
  • global reach
  • objective inference
  • inexpensive and swift
  • irreversible transactions
  • consensus and security
  • psuedonymous

A cypherpunk is an activist who uses software, protocol, and most importantly cryptography to invoke social and political change.

https://bitcoin.org/bitcoin.pdf

  • it works. today. right now.
  • global reach
  • objective inference
  • inexpensive and swift
  • irreversible transactions
  • consensus and security
  • psuedonymous

What's the Blockchain

  • it works. today. right now.
  • global reach
  • objective inference
  • inexpensive and swift
  • irreversible transactions
  • consensus and security
  • psuedonymous

Consensus

PoW, PoS, PoA

What is mining?

It's like Sudoku

  • No central banks

  • No physical form

  • No government backing

  • Anyone can participate

  • No formal identification

Proof of Work

 

Hard to Solve, Easy to Verify

How hard can it be?

  • Current Bitcoin Difficulty (1011 different possibilities)

  • The number of bits on a computer hard disk (typically about 1013, 500-1000 GB)

  • The number of cells in the human body (more than 1014)

  • The number of neuronal connections in the human brain (estimated at 1014)

  • Maximum Bitcoin Difficulty (1077 different possibilities)

  • The estimated number of atoms in the observable Universe (1080)

  • The lower bound on the game-tree complexity of chess (estimated at around 10120)

  • it works. today. right now.
  • global reach
  • objective inference
  • inexpensive and swift
  • irreversible transactions
  • consensus and security
  • psuedonymous

But...what is the blockchain?

header

body

header

body

header

body

time

header

body

header

body

time

header

 Alice -> Bob; 1 BTC; .0001 fee

 Alice -> Charlie; 1 BTC; .0001 fee

 Dan -> Alice; 1 BTC; .0004 fee

Reward: 12.5BTC

header

 Alice -> Bob; 1 BTC; .0001 fee

 Alice -> Charlie; 1 BTC; .0001 fee

 Dan -> Alice; 1 BTC; .0004 fee

Reward: 12.5BTC

header

 Alice -> Bob; 1 BTC; .0001 fee

 Alice -> Charlie; 1 BTC; .0001 fee

 Dan -> Alice; 1 BTC; .0004 fee

Reward: 12.5BTC

header

...

...

...

Reward: 12.5BTC

header

...

...

...

Reward: 12.5BTC

demo

Wallets do not hold your bitcoin

  • it works. today. right now.
  • global reach
  • objective inference
  • inexpensive and swift
  • irreversible transactions
  • consensus and security
  • psuedonymous

Pseudonymity

Almost anonymous

  • it works. today. right now.
  • global reach
  • objective inference
  • inexpensive and swift
  • irreversible transactions
  • consensus and security
  • psuedonymous

But Bitcoin is just a distraction from the blockchain...

Nyet.

What if we put code...on the blockchain

Types

  • boolean
    • true or false
  • int and uint
    • represent 256 bit signed and unsigned numbers respectively
  • address
    • holds a 20 byte ethereum address
  • bytes1 - bytes32
    • fixed size byte array
  • struct
    • fixed size byte array
  • enum
    • fixed size byte array

Contract Structure

pragma solidity ^0.4.0;

contract SimpleStorage {
    uint storedData;

  function SimpleStorage() {
    // ...
  }

  function bid() payable { // Function
    // ...
    }
  }

}

Special Operations

  • msg.sender
    • the ethereum address that directly called the contract
  • msg.value
    • value of the calling transaction
  • block.number
    • current blocknumber
  • sha256 and sha3
    • hash functions
  • selfdestruct(<address>)
    • kill self and send money to an address
  • wei, finney, szabo, ether
    • currency denominations

Contract walkthrough

Applications

Ethereum Blockchain

go-ethereum

ganache-cli

parity

MedRec

Web3

MedRec

overview of contracts

MedRec in 45 minutes

By Nchinda Nchinda

MedRec in 45 minutes

  • 769