Lecture 6 - Bitcoin and Blockchain Technology

Updated 21 Oct 2026

Traditional Online Transactions

  • Traditional model relies on a trusted third party (e.g., a bank) sitting between two parties to validate a transfer (e.g., $10,000 from a giraffe to a lion 🙂)
  • The third party must:
    1. Validate entries
    2. Safeguard entries
    3. Preserve historic records
  • Downsides: expensive, slow, subject to fraud

Analogy It's like needing a notary to witness and approve every single handshake deal you make — reliable, but slow and costly, and you're trusting one person's honesty and diligence completely.

The Advent of Bitcoin

  • 2009: Bitcoin announced by Satoshi Nakamoto
    • Pseudonym for a person or group of people
  • 2009–2011: slow start…
  • 2011–2013: Silk Road and Dread Pirate Roberts
  • End of 2013: Bitcoin price skyrockets
    • and the world notices!

Analogy Think of Bitcoin's early years like a startup with no marketing budget — it grew quietly among a small technical crowd until a dramatic price spike suddenly put it on the front page of every newspaper.

Tracing Blockchain's Origin

  • The shortcomings of current transaction systems
    • Became apparent during the 2000's financial crisis

  • Diagram comparison:
    • Centralized model: Auditor's records, Party A's records, Party B's records, and Bank's records are separate, cross-checked entities
    • Decentralized model: Auditor, Party A, Party B, and Bank all hold the same replica of the ledger; transactions and the ledger itself are digitally signed/encrypted

Analogy When people lost trust in banks during the financial crisis, it was like losing faith in a referee mid-game — blockchain proposes that everyone keeps an identical, verifiable copy of the "scoreboard" so no single referee (bank) is needed.

Ledger

  • A ledger is traditionally a physical or centralized record book of transactions (image: a handwritten accounting ledger)

Decentralization

  • Replace cash with a Ledger

  • Network topology comparison:
    • Centralized: one central hub connects to all nodes
    • Decentralized: several hubs, each connecting to a cluster of nodes
    • Distributed Ledgers: every node connects to every other node (fully meshed)
  • "The New Networks"
    • Distributed ledgers can be public or private and vary in structure and size
    • Public blockchains require computer processing power to confirm transactions ("mining")
    • Public: Users are anonymous; each user has a copy of the ledger and independently participates in confirming transactions
    • Private/permissioned: Users are not anonymous; permission is required to hold a copy of the ledger and participate in confirming transactions

Analogy A ledger is like a shared notebook that everyone can see — instead of trusting one person's memory (a bank), everyone keeps a copy and checks each other's entries.

Blockchain Basics

  • พูดถึง smart contract ด้วย
    • why not app perform authentication

The Properties of Distributed Ledger Technology (DLT):

  • Programmable — a blockchain is programmable (i.e., smart contracts)
  • Distributed — all network participants have a copy of the ledger for complete transparency
  • Secure — all records are individually encrypted
  • Immutable — any validated records are irreversible and cannot be changed
  • Anonymous — the identity of participants is either anonymous or pseudonymous
  • Unanimous — all network participants agree on the validity of each record
  • Time-stamped — a transaction timestamp is recorded on a block

Programmable = we can program to automate … in blockchain

What is Blockchain Technology?

  • Bitcoin stores all its transactions onto a public database called a Blockchain

Bitcoin's Technical Components

  1. Transactions & Scripts
    • Transactions
      • The entire transaction is hashed using SHA-256, and this hash eventually serves as its globally unique transaction ID
    • Scripts
      • The scriptPubKey specifies the hash of an ECDSA public key and a signature validation routine
  2. Consensus and Mining
    • Based on Blockchain
    • Uses a challenging computational puzzle (usually called proof of work) to determine which party's block will be considered the next block in the chain
  3. Communication

Analogy A transaction ID from hashing is like a fingerprint for a document — even a tiny change in the transaction produces a completely different fingerprint, so tampering is easy to spot.

Hash Properties

  • Irreversible (one-way function)
    • Digest cannot be converted back to the original plain text
  • Fixed-Length Message Digest (Hash value)
  • Deterministic function
    • Same message will always produce the same hash value (message digest)

Analogy A cryptographic hash is like a meat grinder: you can turn a steak into ground meat, but you can never turn ground meat back into the original steak. Feed it the exact same steak twice, though, and you always get the exact same ground meat.

Cryptographic Hash Function

Hash function definition:

H:0,1∗→0,1k\boxed{H : {0,1}^{*} \rightarrow {0,1}^{k}}

  • Deterministic function
  • Accepts ~any string as input
  • Fixed-size output (typically k=256k = 256 bits)
  • Efficiently computable

Security properties:

  • Collision-free
  • One-way
  • Puzzle-friendly (defined further later)

Hash Property 1: Collision-Free

  • Nobody can find xx and yy such that:

x≠y and H(x)=H(y)\boxed{x \neq y \text{ and } H(x) = H(y)}

  • Diagram: two different inputs xx and yy both pointing into a single output node H(x)=H(y)H(x) = H(y) — this must never be findable in practice

Analogy Collision-freeness is like a fingerprint scanner that (in theory) never assigns the same fingerprint to two different people — if it did, an impostor could pass as someone else.

Collision Resistance in Practice

  • There are faster ways to find collisions for some hash functions:
    • MD5 — collisions found (broken)
    • SHA-1 — near-collisions found (weakened)
  • Others are currently collision-resistant:
    • SHA-256 — used heavily in Bitcoin and others
    • SHA-3 — used in Ethereum

Merkle–Damgård Construction (SHA-256)

  • The message is split into fixed-size blocks (e.g., 512 bits each): Message block 1, block 2, …, block n, with padding at the end
  • Each block is fed through a compression function cc, chained together starting from an Initialization Vector (IV, 256 bits), producing a final 256-bit output

Theorem: If cc is collision-free, then the hash is collision-resistant.

Analogy This construction is like a bucket brigade: each block of the message gets mixed into a running "state" bucket-by-bucket, so the final output depends on absolutely everything that came before it.

Hash Property #2: One-Wayness

  • We want: "Given H(x)H(x), it is infeasible to find xx"
  • But this breaks down if we know information about xx
    • Example: a coin flip with only two possible values, "heads" or "tails"
    • Since there are only 2 possible pre-images, it's easy to find xx just by hashing both options and comparing

Analogy One-wayness is strong when the space of possible original messages is huge (like guessing a random 256-bit number), but it collapses when the space is tiny (like guessing between only "heads" and "tails") — the attacker can just try every possibility.

Hash Pointers

Key idea:

  1. Take any pointer-based data structure
  2. Replace pointers with cryptographic hashes
  • This gives an authenticated data structure

If a hash function is secure, its output is indistinguishable from random.

Blockchain: Linked List with Hash Pointers

  • A blockchain is essentially a linked list where each block stores prev: H(...) — a hash pointer to the previous block, instead of a plain memory address
  • Use case: tamper-evident log

Block Chaining

  • Each block contains: a block hash, a pointer/hash to the previous block, a proof-of-work value, and its transactions
  • Example chain: Block 4711 (hash: uuozq523, previous block: fgztr56a, proof of work: 000000ftz67zw, transactions: 6akthth, s67dhaj9) → Block 4712 (hash: xeazq5au, previous block: uuozq523, proof of work: 000000acko3e, transactions: hsjuet67, hategof8) → Block 4713 (hash: 53qqoai6, previous block: xeazq5au, proof of work: 000000xbuou54, transactions: 7ahzsgrb, pahejros)

Proof of work to find nonce

Modifications to Any Block Will Propagate Forever

  • If a block's data is tampered with (illustrated with a lightning bolt striking one block's data), the hash pointer chain breaks
  • Since every later block's hash depends on the previous block's hash, the change is detectable all the way up to the final hash pointer

Analogy This is like a stack of carbon-copy receipts — scribbling on the third receipt back leaves a visible mismatch on every receipt copied on top of it.

Chained Hashes

  • More general construction than one-way hash chains
  • Useful for authenticating a sequence of data values D0,D1,…,DND_0, D_1, \dots, D_N
  • H∗H^* authenticates the entire chain

H(DN−1,∣∣,HN−1);H(DN)H(D_{N-1} ,||, H_{N-1}); H(D_N)

Analogy Think of each hash as a wax seal stamped on top of the previous seal. Breaking or forging any seal in the middle would be obvious because every seal after it depends on the one before.

How to Search Transactions in Any Block?

  • Binary hash tree (Merkle tree)
  • A hash tree is a tree of hashes in which the leaf nodes are hashes of data blocks (e.g., a file or set of files)
  • Nodes farther up in the tree are the hashes of their respective children
  • Example: hash 0 is the result of hashing the concatenation of hash 0-0 and hash 0-1

hash0=hash(hash(0-0),+,hash(0-1))\boxed{\text{hash}_0 = \text{hash}(\text{hash}(0\text{-}0) ,+, \text{hash}(0\text{-}1))}

where ++ denotes concatenation.

Analogy A Merkle tree is like a family tree of fingerprints — each "parent" fingerprint is derived by combining its two "children" fingerprints, all the way up to one "ancestor" fingerprint (the Merkle root) that summarizes everyone below it.

Merkle Tree: Binary Tree with Hash Pointers

  • Same idea as a hash pointer linked list, but arranged as a binary tree: each internal node H(⋅)H(\cdot) hashes its two children, all the way down to the raw (data) leaves

Verification of Individual Transaction

  • Block structure: Block Header (Block Hash) contains Prev Hash, Nonce, and Root Hash
  • The Root Hash is built from Hash01 and Hash23, which are each built from leaf hashes Hash0, Hash1, Hash2, Hash3 over transactions Tx0, Tx1, Tx2, Tx3
  • Pruning example: After pruning Tx0–Tx2 from the block, only Hash01 (already computed) and Hash23 need to be kept, and only Tx3 remains stored directly — the Root Hash can still be recomputed and verified

Merkle Hash Tree for Data Authentication

  • Construct a binary tree where each leaf corresponds to a piece of data
  • Each internal node is hash of two children
  • Authenticate the root using some method
  • The leaf hash and the sibling hashes along its authentication path are sufficient to reconstruct the Merkle root and verify the leaf's inclusion in the tree
    • Needs log⁡(n)\log(n) steps to authenticate any node
    • Example: to authenticate TX3, certain branches can be pruned

Analogy Verifying one transaction in a huge block is like proving one specific brick is part of a wall without checking every brick — you only need the "stack" of neighboring bricks directly above your brick, not the whole wall.

Merkle Hash Trees

  • Authenticate a sequence of data values D0,D1,…,DND_0, D_1, \dots, D_N
  • Construct a binary tree over the data values
                T0
        T1              T2
    T3      T4      T5      T6
 D0  D1  D2  D3  D4  D5  D6  D7

Merkle Hash Trees II

  • Verifier knows T0T_0
  • Question: How can the verifier authenticate leaf DiD_i?
  • Solution: recompute T0T_0 using DiD_i
  • Example: to authenticate D2D_2, send D3,T3,T2D_3, T_3, T_2

T0=H(H(T3,∣∣,H(D2,∣∣,D3)),∣∣,T2)\boxed{T_0 = H\big(H(T_3 ,||, H(D_2 ,||, D_3)) ,||, T_2\big)}

                T0
        T1              T2
    T3      T4      T5      T6
 D0  D1  D2  D3  D4  D5  D6  D7

(in the verification, T3,D2,D3,T2T_3, D_2, D_3, T_2 are the values sent/used)

Analogy This is like proving you were at a specific seat in a stadium without showing a photo of the entire stadium — you only present the ticket stubs of the seats connecting your row up to the exit gate (the root).

Merkle Tree Recap

  • A Merkle proof is a succinct proof that a message is one of the leaves of a Merkle tree
  • Example dialogue between a light client and a full node:
    1. Light client: "I know the root H1234. Please give me m2."
    2. Full node: "Here it is: m2."
    3. Light client: "Prove to me your m2 is genuine."
    4. Full node sends the Merkle proof (just 2 hashes: H1, H34) that lets the client recompute H1234 from m2 and confirm it matches the known root

Tamper-free: As long as you have the root, no one can deceive you into accepting fake messages.

Discussion Questions (Merkle Tree Pruning)

  • Consider a Merkle tree over Tx0–Tx7 with root RR, built from H03/H47 → H01/H23/H45/H67 → H0...H7 → Tx0...Tx7
  • Scenario: Tx0, Tx1, Tx2, and Tx3 are old transactions that no longer need to be individually accessed, but the node must still be able to verify the integrity of the remaining transactions Tx4–Tx7 against the original Merkle root RR
  • (a) Which nodes/data can be pruned?
  • (b) Which hash value must be retained to preserve the commitment to the pruned subtree?
  • (c) Suppose the verifier later wants to authenticate Tx5. What hashes are required as its Merkle proof?

Bitcoin Transactions

  • An electronic coin is a chain of digital signatures
  • Each owner transfers the coin to the next by digitally signing:
    • A hash of the previous transaction
    • The public key of the next owner
    • These are added to the end of the coin
  • A payee can verify the signature to verify the chain of ownership
  • Diagram flow: each Transaction block contains the current Owner's Public Key → Hash → previous Owner's Signature; each new owner signs with their Private Key and the next owner verifies using the chain

Analogy


A Bitcoin "coin" is like a cashier's check that gets endorsed and re-endorsed on the back each time it changes hands — each endorsement (signature) proves the chain of custody all the way back to its origin.

Double Spending Problem

  • The problem remains that a payee cannot verify that the owner did not double spend the coin
  • Could be solved by a central coin-issuing authority, but that makes Bitcoin reliant on a central authority again
  • Example diagram: a Buyer sends a coin (ID: 537704) toward both Seller A and Seller B at once — an attempt at double spending

Analogy


Double spending is like photocopying a $20 bill and trying to spend both copies — without a central bank checking serial numbers, two different merchants might both accept the "same" money.

Bitcoin Blocks and Verification

So we need mechanism, to make sure the coin used only once!

  • Transactions are included in Bitcoin blocks that are broadcast to the entire network
  • Bitcoin relies on a hash-based Proof-of-Work (PoW) scheme to detect double spending of the same Bitcoin

Attacker Model

  • A malicious client A forms the core of the attack model
  • Assume A is trying to spend a coin B at a merchant V, which she already spent earlier
  • The attack succeeds if V accepts the bitcoin but can't redeem it later
  • A requires at least one helper peer, H, to succeed with the attack
  • The attack has a greater chance of succeeding if multiple helper peers are present in other parts of the world
  • Diagram: Attacker → Bitcoin Network → Vendor (with transaction), and Attacker → colluding address → Bitcoin Mining Pools

Analogy


This is like handing a $100 bill to a friend nearby (V) and, seconds later, handing a photocopy of the "same" bill to a different friend far away (H), hoping each friend's local circle doesn't compare notes before one of them accepts it as real.

The Attack (Race Attack)

  • A connects to V and creates transaction T1T_1 with coin B
  • Since A and V are on the same network, V receives T1T_1 almost immediately
  • Since Bitcoin clients accept all connections, the transaction is received
  • A few seconds later, A connects to H and transfers the same coin B to H in transaction T2T_2
  • Since H is assumed to be on the other side of the globe, there's a good chance H doesn't know about T1T_1
  • H immediately starts broadcasting T2T_2 in its local network and waits for confirmation

Success of the Attack

  • The attack succeeds if:
    • The time required for V to receive T1T_1 is shorter than that for T2T_2
    • The number of hosts that included T2T_2 in their blockchain is in the majority

Prevention of Double Spending Attack

  • Unfortunately, there is no way to fully prevent this attack, since the problem of time lag between a transaction and its acceptance lies in the protocol itself
  • Damage from a fraudulent transaction can be limited by capping the number of bitcoins transferred in an unverified transaction

Alternative Cryptocurrencies and Block-Generation Trade-offs

Bitcoin

  • Target block interval: ≈ 10 minutes
  • PoW: SHA-256d

Litecoin

  • Target block interval: ≈ 2.5 minutes
  • PoW: Scrypt

Why shorter block time?

  • Faster inclusion of transactions in blocks
  • Faster initial confirmation and better responsiveness
  • But more frequent blocks can increase competing/stale blocks

Key Security Point

  • Shorter block time → faster confirmations
  • Double-spending resistance → consensus + accumulated work + confirmations

Trade-off: decreasing the block interval improves responsiveness, but an excessively short interval increases fork/stale-block risk due to network propagation delay.

Analogy


Block time is like how often a security guard does rounds. More frequent rounds (shorter block time) catch problems faster, but if the guard rushes too much, they might miss things or bump into each other (forks/stale blocks).

Double Spending Prevention

  • Centralized
    • Usually implemented using an online central trusted third party that verifies whether a token has been spent
    • This represents a single point of failure from both availability and trust viewpoints
  • Decentralized
    • By 2007, several distributed systems for double-spending prevention had been proposed
    • Bitcoin implemented a solution in early 2009 using a cryptographic protocol called proof-of-work, avoiding the need for a trusted third party
    • Transactions are recorded in a public ledger called a blockchain
    • A transaction is valid when included in the blockchain with the most accumulated computational work
    • This makes double-spending increasingly infeasible as the network grows

Proof of Work

  • Involves scanning for a value that, when hashed (e.g., with SHA-256), produces a hash beginning with a certain number of zero bits
  • A number called a nonce is added to the end of a transaction to influence the final hash
  • The role of the nonce is to make the final hash begin with a certain number of consecutive zeros
  • The average work required is exponential in the number of zero bits required, but the result can be verified with a single hash
  • Since inverse computation isn't possible for cryptographic hash functions, the only way to find the nonce is trial and error

Proof of work: it’s not environmental friednly, we need to use rsource to solve the problem.

Analogy


Finding the right nonce is like guessing a combination to a lock by trying every possible number — extremely tedious to find, but instantly checkable once someone tells you the answer.

PoW Diagram Example

  • Illustration: two connected blocks, each containing a Previous Hash, a Message, a Digital Signature
  • A PoW nonce value is tried (e.g., 2147483647) and fed through SHA256
  • Example resulting hash pattern: 0000000000000000000000000110001100111010101100... — many leading zero bits, which is what makes it "hard to find, easy to verify"

PoW Example (Probability)

  • Suppose we're trying to find a nonce that makes the final hash begin with 30 zeros
  • If the hash is composed of just 1s and 0s (two possibilities per bit), the probability is:

P=1230≈one in a billion\boxed{P = \frac{1}{2^{30}} \approx \text{one in a billion}}

  • Finding the nonce proves someone has done the required work — hence "proof of work"
  • Once found, other participants can run SHA-256 on the number to instantly confirm its validity
  • This information is compressed into a block and added to the chain
  • A new block also contains the hash of the previous block, which affects the new block's hash
  • To alter data stored within the blockchain, an attacker would need more than 50% of the network's total computational power to keep producing nonces faster than everyone else

Mining (Proof of Work Process)

  • Mining is the process of generating proof of work
  • All miners compete to find a number that, when added to a block of transactions, causes the block to hash to a code with certain rare properties
  • Finding such a rare number is hard, but verifying it once found is easy

PoW is only useful when trustless consensus is required; otherwise it is an expensive and needless waste of resources.

Proof of Work in Bitcoin

  • Implemented by incrementing a nonce in the block until a value is found that gives the block's hash the required number of zero bits
  • Once the CPU effort satisfies the proof-of-work, the block cannot be changed without redoing the work
  • Since later blocks are chained after it, changing a block requires redoing all subsequent blocks too
  • Each Block contains: Prev Hash, Nonce, and its transactions (Tx, Tx, …), chained to the next Block

Proof of Work Flowchart

  1. Proposed Block — each block contains a hash of the previous block; the block is secured using SHA-256 (a cryptographic hash algorithm)
  2. Combine and hash the previous block header with a Nonce (a cryptographic, arbitrary integer used only once)
  3. Compute the Hash Number
  4. Check: Is HASH < Target value? (the target value is a threshold set by mining difficulty)
    • No → increment the nonce and try again (loop back to step 2)
    • Yes → Proof of work achieved
  5. Approved Block — verified block is added to the existing blockchain, and a Block Reward (new bitcoins) is distributed to the miner

Analogy


This flowchart is like a slot machine that a miner pulls billions of times per second — most pulls don't win, but as soon as one does (hash < target), the win is instantly verifiable by anyone else just by checking the same numbers.

PoW Worked Example

  • Let the mathematical problem be: Given data XX, find a number nn such that the hash of nn appended to XX results in a number less than YY
  • Example — a hypothetical hash function, with Y=10Y = 10, X=’test’X = \text{'test'}:

hash(X+n)<Y\boxed{\text{hash}(X + n) < Y}

  • hash('test') = 0x0f = 15 > 10 (not solved)
  • hash('test1') = 0xff = 255 > 10 (not solved)
  • hash('test2') = 0x09 = 9 < 10 — OK, Solved.

Bitcoin Block Generation

The difficulty usually depends on number of consecutive zero, more zero, more time

  • When a new block is mined, the miner is rewarded with currency (block reward + transaction fees), incentivizing continued mining
  • Historically, the generating peer was awarded 50 Bitcoins, and the system is re-primed afterward
  • In Proof of Work, other nodes verify block validity by checking that the block's hash is less than a preset number
  • The resulting block is broadcast to the network and, after verification, added to the blockchain by all clients

Proof of Work provides the needed security and has proven to work well so far. However, it is very energy consuming.

Why You Can't Cheat at Bitcoin

  1. Say everybody is working on block 91
  2. But one miner wants to alter a transaction in block 74
  3. He'd have to redo all the computations for blocks 74–90 and do block 91 — that's 18 blocks of expensive computing
  4. Worst of all, he'd have to do it all before everybody else in the Bitcoin network finishes just the one block (91) that they're working on

Analogy


Cheating on an old block is like trying to secretly rewrite chapter 3 of a book after chapters 4 through 20 have already been printed, bound, and distributed to everyone — you'd have to reprint and redistribute the entire rest of the book faster than everyone else can finish reading the next chapter.

PoW Functions

List of known proof-of-work functions:

  • Integer square root modulo a large prime
  • Weaken Fiat–Shamir signatures
  • Ong–Schnorr–Shamir signature broken by Pollard
  • Partial hash inversion (formalizes "reusable proof of work," RPOW, as in Hashcash)
  • Hash sequences
  • Puzzles
  • Diffie–Hellman-based puzzle
  • Moderate
  • Mbound
  • Hokkaido
  • Cuckoo Cycle
  • Merkle tree based
  • Guided tour puzzle protocol

Reference: Wikipedia — List of proof-of-work functions

PoW Challenge Issues

  • New developments in PoW
  • Comparison of existing functions
  • Parallel computation algorithms to solve PoW

How is Currency Issued?

  • Bitcoin protocol assigns a preset amount of newly issued currency for every block, to the miner who first assembles it with the correct proof of work
  • Transaction fees incentivize miners to do the work required to create consensus, keeping the network large enough that circumventing it becomes very expensive

Open Issues:

  • Size of the blockchain network and each node's local database
  • Security management

How a Bitcoin Transaction Works (Infographic Summary)

  • Wallets and addresses: Both Bob and Alice have Bitcoin "wallets" on their computers
  • Creating a new address: Each new address contains information about previous blockchain transactions; uses public key cryptography — a private key and public key pair. Alice's wallet holds many key pairs
  • Public Key Cryptography 101: When Bob creates an address, a private key and public key are generated; the public key allows anyone to verify the signature, but only the private key can create a valid signature
  • Submitting a payment: Alice tells her wallet the recipient (Bob) and the amount; her wallet signs the transaction with her private key
  • Verifying the transaction: Miners compete to bundle transactions into blocks and find a nonce whose hash meets the difficulty target; each new block references the previous block's hash
  • Transaction verified: Once a miner solves the block, Alice's payment to Bob is recorded permanently on the blockchain

Analogy Creating a Bitcoin address is like getting a padlock (public key) that anyone can snap shut around a message for you, but only your matching key (private key) can open it or prove you're the one who locked it.

Proof of Stake (PoS)

  • If Bob has more stake than Alice, he is more likely to win ("mine" the next block)
  • Removes the energy and computational power requirement of PoW, replacing it with stake
  • Stake = amount of currency an actor locks up for a period of time
  • In return, actors get a chance proportional to their stake to be the next leader and select the next block
  • Examples of coins using pure PoS: Nxt, Blackcoin

Stake

Analogy


PoS is like a raffle where the number of tickets you hold is proportional to how much money you've put into a shared pot — the more you've staked (and have to lose), the higher your chance of being picked, and cheating risks losing your stake.

Proof of Stake (PoS) — Mechanics

Consensus based on economic stake rather than computational mining:

  • Validators lock cryptocurrency as stake and participate in block proposal and validation
  • Validator selection and voting power depend on the protocol and the amount of stake
  • Dishonest behavior is discouraged through lost rewards and, for slashable offenses, slashing
  • PoS avoids the energy-intensive hash competition used in Proof of Work

PoS: The Nothing-at-Stake Problem

A historical/basic PoS concern: supporting competing forks is inexpensive.

  • When a blockchain forks, a validator may have little immediate cost in supporting multiple competing branches
VoteOutcome
Vote for Chain A onlyAllowed
Vote for Chain B onlyAllowed
Vote for BOTH A and BAllowed ← Nothing-at-stake problem
  • Unlike PoW miners, validators don't need to repeat expensive hash computation for every branch
  • If many validators attest to multiple branches, chain convergence and finality can become harder

Why can a fork happen?

  • A fork can occur naturally when two miners/validators produce competing blocks at nearly the same time (due to network delays), or intentionally when blockchain rules/protocols change

Key consequence: supporting competing forks can weaken convergence/finality and increase security risk.

สุดท้ายแล้วยังไง chain ต้อง converge ให้เป็น cannonical chain (valid chain)
Remove fork → Chain convergence → Cannonical chain*

Analogy


Nothing-at-stake is like a juror who can vote "guilty" in two different, contradictory trials at once, because voting itself costs them nothing — there's no penalty for hedging their bets on both outcomes.

Modern PoS: Mitigating Nothing-at-Stake

Economic penalties + fork choice + finality:

  1. Stake — validators lock assets that are economically exposed if they misbehave
  2. Slashing — conflicting attestations and other slashable actions can destroy part of a validator's stake
  3. Finality — fork-choice and finality rules drive the network toward one canonical chain
    • Finality = that vlock of chain is valid and cannot be mutable

Modern PoS makes conflicting behavior economically costly and uses explicit rules to establish a canonical, finalized chain.

PoS — Validator Selection (Math)

  • In PoS, instead of miners racing with computational power, validators are chosen based on their staked tokens
  • Probability of being selected ≈ proportional to stake
  • Validators propose and vote on blocks
  • The protocol mathematically determines who proposes, who votes, and when finality occurs

Total stake:

S=∑i=1Nsi\boxed{S = \sum_{i=1}^{N} s_i}

Probability of validator ii being chosen as block proposer:

P(i)=siS\boxed{P(i) = \frac{s_i}{S}}

Example: If total stake S=1000 ETHS = 1000\ ETH and validator ii stakes si=100 ETHs_i = 100\ ETH, then P(i)=0.1P(i) = 0.1 (10% chance).

Analogy This is exactly like a weighted raffle: if you bought 100 out of 1000 total tickets sold, you have a 10% chance of your name being drawn — no computation needed, just proportional luck.

Ethereum: Modern Proof of Stake

Ethereum transitioned from PoW to PoS in September 2022 (The Merge).

  • Validators stake ETH to participate in consensus
  • Validators propose blocks and submit attestations about the chain
  • Ethereum combines a fork-choice rule with Casper FFG-style finality
  • Slashing penalizes specific conflicting or malicious validator behavior
  • Ethereum is therefore a current example of operational PoS — not merely a proposed Casper research design

Ethereum PoS Flow: Stake ETH → Propose/attest → Fork choice → Finality → Rewards/penalties

PoS Block Proposal

  • At each slot (≈12 seconds in Ethereum), one validator is pseudo-randomly chosen to propose a block

Mathematically:
Proposer=H(randao_seed,∣,slot) mod N\boxed{\text{Proposer} = H(\text{randao\_seed} ,|, \text{slot}) \bmod N}

where:

  • HH = cryptographic hash function
  • randao_seed = randomness beacon generated from previous validator signatures
  • This ensures unpredictability + fairness

Attestation (Voting)

  • Other validators vote on the block's validity. Votes are weighted by stake
  • For validator ii:

wi=siS\boxed{w_i = \frac{s_i}{S}}

  • A block is justified if ≥2/3\geq 2/3 of total stake votes for it:

∑i∈Vwi≥23\boxed{\sum_{i \in V} w_i \geq \frac{2}{3}}

where VV is the set of validators voting for the block.

Types of Finality

Probabilistic Finality (PoW — Bitcoin):

  • There's always a small probability that a longer chain could appear, causing a "reorg" and invalidating recent blocks
  • Bitcoin users wait for multiple confirmations (usually 6 blocks ≈ ~1 hour) to be confident their transaction won't be reversed
  • More confirmations → lower probability of reversal

Deterministic Finality (PoS — Ethereum):

  • After Ethereum's Merge, the protocol includes finality checkpoints
  • Once a block is finalized (roughly every 2 epochs ≈ 12 minutes), it cannot be reverted unless an attacker burns a huge amount of staked ETH through slashing
  • Gives stronger guarantees than PoW, since it's mathematically locked once finalized

Analogy Probabilistic finality (PoW) is like being "pretty sure" a rumor is true because more and more people keep repeating it. Deterministic finality (PoS) is like a notarized, signed contract — once it's stamped, there's no more "probably."

Finality (Casper FFG)

  • Finality is achieved in two stages: justification → finalization
  • Checkpoint: At the end of each epoch (32 slots ≈ 6.4 minutes), the protocol designates a block as a checkpoint
  • Justification: A checkpoint CkC_k is justified if at least 2/3 of total stake votes (attestations) link it to a prior justified checkpoint
  • Finalization: A justified checkpoint CkC_k becomes finalized if it is followed by another justified checkpoint Ck+1C_{k+1}

Formal condition (Justification):

∃,Cj,Ck such that Cj→Ck and ∑i∈Vwi≥23\boxed{\exists, C_j, C_k \text{ such that } C_j \rightarrow C_k \text{ and } \sum_{i \in V} w_i \geq \frac{2}{3}}

where Cj,CkC_j, C_k are checkpoints, and wiw_i is the stake weight of validator ii.

Diagram: Epoch k−1k-1 → Epoch kk (Justified CjC_j, ≥2/3 stake votes) → Epoch k+1k+1 (Justified CkC_k, link CkC_k to CjC_j with ≥2/3 stake votes) → Epoch k+2k+2 (CkC_k finalized when Ck+1C_{k+1} is justified)

Key properties:

  • Two-stage consensus: justification → finalization
  • Finalized blocks are irreversible unless > 1/3 of total stake is slashed
  • Provides strong security against long-range attacks and reorgs
  • Used in Ethereum's PoS (Casper FFG)

What is finality?

  • Finality is the point at which a transaction (or block) is considered immutable and permanently part of the blockchain ledger
  • After finality, the transaction cannot be changed, canceled, or double-spent, even if forks or network reorganizations occur

Example (Ethereum):

  • Slot time: 12 seconds
  • Epoch: 32 slots (≈ 6.4 minutes)
  • Finality typically achieved in about 2 epochs (≈ 12.8 minutes) under normal conditions

Rewards

  • Validators earn rewards proportional to their stake and correct participation

Ethereum reward formula (simplified):
Ri=siS\boxed{R_i = \frac{s_i}{\sqrt{S}}}

  • This design ensures diminishing returns for very large stakers → encourages decentralization

Slashing Conditions

  • If a validator cheats (e.g., double votes, equivocation), they lose a portion of their stake

Penalty:

Slashed(i)=f(si,offense)\boxed{\text{Slashed}(i) = f(s_i, \text{offense})}

  • For Ethereum, slashing can burn up to 100% of stake depending on severity and correlated misbehavior

Slashing = forced loss of staked coins for misbehavior.

PoW vs PoS

AspectBitcoin (PoW)Ethereum (PoS)
ConsensusProof of Work (SHA-256 mining)Proof of Stake (staking ETH)
EnergyVery highVery low
SecurityBased on hash powerBased on staked ETH
ParticipationNeeds ASICs + cheap electricityNeeds ETH stake (32 ETH or pools)
RewardsBlock subsidy + fees, halved ~4 yrsStaking rewards + fees
FinalityProbabilistic (~1 hour)Deterministic (~12 min)
CentralizationMining pools dominateStaking pools/exchanges risk
Eco ImpactHeavy carbon footprintEnvironmentally friendly

A Bitcoin Transaction (Real Example)

  • Screenshot from a blockchain explorer (blockchain.info) showing a real transaction: inputs/outputs (addresses and amounts), transaction size, received time, estimated confirmation time, fee, and a network propagation map
  • Also compares wallet security models:
    • Desktop client: client-side encryption, two-factor authentication, immune to server-side hacks
    • Web wallet: convenience, but relies on trusting the web provider

Which is More Decentralized — PoS or PoW?

  • Open discussion question posed to compare the decentralization properties of Proof of Stake versus Proof of Work
  • Answer: It depends, given the blockchain network
    • If you ahve more stake, high chance to lock the block chain
    • Miner if you have lot of resource (group of miner), they can lock and gain priority in proposing the block and solving the puzzle

The Attack Scenario

  • A bitcoin transaction is accepted only if a majority of clients in the network mark it as valid
  • By design, a transaction requires about 10 minutes in the best case before it's included in a block and broadcast for confirmation
  • If a merchant client accepts a transaction initially but later gets refusal from a majority of peers, the attack is successful → the attacker gains the majority of the network

Block Generation Time

  • Transactions can be delayed further depending on the difficulty of the hash currently being calculated
  • The complexity of the hash is adjusted based on the generation time of the previous hash

Blockchains and Distributed Ledgers

  • Blockchains: the technology behind cryptocurrencies
    • Analogous to the TCP/IP protocol that is the foundation of the internet
  • Blockchains are Distributed Ledgers
    • Ledgers are historically centralized and private
    • Blockchains are decentralized or distributed

Analogy If TCP/IP is the plumbing that lets any computer talk to any other computer, blockchain is the plumbing that lets any party transact with any other party — without needing a bank in the middle.

Blockchain (Definition)

  • Blockchain is a distributed public ledger that contains all the transactions ever executed in the system
  • Data is generated and stored in units of blocks
  • Consecutive blocks are connected in chronological order to form a chained data structure
  • All user nodes participate in the validation, storage, and maintenance of data
  • Creation of a new block should typically be approved by more than half of the users, then broadcast to all user nodes for network-wide synchronization → all local ledgers are updated upon the creation of a new block
  • Once synchronized, modify or delete operations are generally not allowed

Blockchain Characteristics

Arranged around a central "Blockchain Characteristics" hub:

  • Decentralized
  • Distributed
  • Digital Ledger
  • Chronological and Time Stamped
  • Irrevocable and Auditable
  • "Trustless" Operation (based on consensus)
  • Reduces Dependencies on Third Parties
  • Immutable and Nonrepudiable
  • Cryptographically Secured
  • Transparent and Verifiable

Blockcahin Redaction
Transactions in Blockchain can be redacted (deleted) if it use Chameleon Hash rather than SHA 256

How Blockchains Work: Basics

  • Chronological Ledger
    • Transactions often "pseudo-anonymous"
    • Transactions are grouped together in "blocks"
    • Transactions are logged and stamped with information about the time, amount, and participants — as if a notary were present at every transaction
  • Blockchain is not centralized (does not have one owner), therefore there are strict rules about how it must be maintained

Blockchain Structure

  • Simple visual: a new block joins onto a growing row of connected block icons labeled "Blockchain," extending outward with an arrow

Source: edureka.co blockchain tutorial

How Blockchains Work: Maintenance

  • The individuals who maintain and update the blockchain are called miners, and they are paid a reward
  • Miners process transactions by:
    • Solving a complex mathematical problem
    • Sending transactions to other nodes to be verified

Mining Pools

  • Solving puzzles (mining) is hard!
    • Miners join pools and share work/reward
  • How to optimally split work?
  • Mechanism design considerations:
    • Rational miner behavior?
    • How to allocate reward?

Analogy A mining pool is like a group of people pooling lottery tickets together — the odds of any single ticket winning stay tiny, but pooling many tickets makes a win much more frequent, and the group splits the prize based on contribution.

Live Demo

Consensus Algorithms

  • Proof of Work (PoW)
    • Used by: Bitcoin, early Ethereum
    • Mechanism: Miners solve computationally expensive puzzles (hashing); the first to solve gets to propose the next block
    • Strengths: High security, Sybil resistance
    • Weaknesses: Energy intensive, slow throughput, vulnerable to 51% attacks if one miner controls majority hash power
  • Proof of Stake (PoS)
    • Used by: Ethereum 2.0, Cardano, Algorand
    • Mechanism: Validators are chosen to create new blocks based on the amount of cryptocurrency they "stake"
    • Strengths: Energy efficient, faster finality, scalable
    • Weaknesses: "Nothing at stake" problem (mitigated in modern designs), requires complex slashing/penalty rules
  • Practical Byzantine Fault Tolerance (PBFT) and Variants
    • Used by: Hyperledger Fabric, Tendermint (Cosmos)
    • Mechanism: Nodes exchange messages and reach agreement if at least 2/3 of them agree, tolerating up to 1/3 malicious actors
    • Strengths: Fast finality, low latency, energy efficient
    • Weaknesses: Communication overhead increases with network size, so more suitable for permissioned blockchains

พูดถึง public blockchain, Hyberledger เป็นอย่างไร ถ้ามี hospital ต้องการใช้ block chain intrasturcture sharing patient data, what do we choose?
Permissioned blockchain??

Practical Byzantine Fault Tolerance (PBFT)

  • Introduced by Castro and Liskov (1999) as a practical way to tolerate Byzantine faults (nodes behaving arbitrarily or maliciously) in asynchronous distributed systems
  • Widely used in permissioned blockchains (e.g., Hyperledger Fabric, Tendermint, Zilliqa), where participants are known but may still fail or act maliciously
  • PBFT handles up to ff faulty replicas out of n=3f+1n = 3f+1 total replicas, guaranteeing both safety and liveness

n=3f+1\boxed{n = 3f + 1}

  • The system has:
    • One primary (leader) node: coordinates the consensus process
    • Multiple backup nodes (replicas): verify and agree on the leader's proposals
  • Consensus is reached if at least 2f+12f+1 nodes agree (a supermajority)
  • This ensures the system works even if up to 1/3 of nodes are faulty or malicious

Analogy


PBFT is like a jury of 3f+1 people who must reach a supermajority (2f+1) agreement before delivering a verdict — even if up to f jurors are corrupt or confused, the honest majority can still reach the correct, final decision.

PBFT Workflow

The protocol consists of three main phases (plus replies):

  1. Pre-Prepare Phase
    • Client sends a request (transaction) to the primary
    • Primary assigns a sequence number and multicasts a pre-prepare message to all backups
  2. Prepare Phase
    • Each backup verifies the message (valid signature, correct sequence)
    • Each backup broadcasts a prepare message to all other replicas
    • When a node collects 2f2f prepares (plus its own), it moves to the commit phase
  3. Commit Phase
    • Replicas exchange commit messages
    • Once a node gathers 2f+12f+1 commits, it considers the request committed locally (finalized)
  4. Reply
    • Each replica executes the request and sends a reply to the client
    • The client waits for f+1f+1 matching replies to confirm success

Finality is immediate: once a block is committed, it cannot be reverted.

Disadvantage: communication cost, depends on number of node, ส่งไม่หยุด

PBFT Workflow (Diagram)

  • Message flow across 5 columns/phases: Request → Pre-prepare → Prepare → Commit → Reply
  • Rows: Client → Primary node → Replica 1 → Replica 2 → Replica 3
  • The diagram shows the client sending a request to the Primary node, which then fans out pre-prepare messages; replicas then cross-communicate during Prepare and Commit, before each replica replies directly back to the Client

PBFT Example

  • f=1f = 1, n=4n = 4
  • Total replicas =3f+1=4= 3f + 1 = 4
  • Tolerates 1 malicious node
  • Consensus requires 2f+1=32f + 1 = 3 consistent responses
    • For reaching the consensus

Features:

  1. Safety: No two honest replicas commit different values (agreement)
  2. Liveness: Clients eventually receive replies (as long as < 1/3 are faulty)
  3. Deterministic finality: Once committed, it's final — no chain forks like in PoW

PBFT: Primary and Backup Replicas

Example: 4 authorized organizations operate 4 PBFT consensus nodes (n=4n=4, f=1f=1)

  • Node 0 — Primary (University A): proposes/orders the request (Pre-Prepare)
  • Node 1 — Backup (University B)
  • Node 2 — Backup (University C)
  • Node 3 — Backup (University D)
  • Prepare + Commit: all replicas exchange messages and reach agreement

If Primary fails or is Byzantine:

  • View change → another replica becomes the new Primary

PBFT fault tolerance:

  • n≥3f+1n \geq 3f+1 → with 4 replicas, PBFT tolerates 1 Byzantine replica

Key idea: the Primary is also a replica; it temporarily acts as the leader, while the others are backup replicas.

Weakness of PBFT

  • Communication Overhead
    • Each phase requires all-to-all communication
    • Complexity: O(n2)O(n^2) messages per consensus round
    • Limits scalability → practical up to ~100 nodes
  • Leader Bottleneck
    • Primary can become a single point of slowdown (though view-change protocols exist)
  • Permissioned Requirement
    • Assumes known validator identities (not fully open/public like Bitcoin)

Analogy PBFT's all-to-all messaging is like a meeting where every single attendee must call every other attendee individually to confirm the decision — great for a small committee, but unmanageable once the group grows into the hundreds.

Optimizations & Variants

  • Tendermint PBFT: BFT consensus with rotating leaders and proof-of-stake voting power
  • HotStuff (used in Diem/Libra): A streamlined PBFT variant with linear message complexity
  • SBFT, Zyzzyva, BFT-SMaRt: Optimized versions for higher throughput
  • Committee-based BFT: Random subsets of validators participate in consensus rounds to reduce communication cost

Three "Levels" of Blockchain

  1. Storage for digital records
  2. Exchanging digital assets (called tokens)
  3. Executing smart contracts
    • Ground rules — terms & conditions recorded in code
    • Distributed network executes the contract & monitors compliance
    • Outcomes are automatically validated without a third party

Source: Tech Trends 2017, The Kinetic Enterprise, "Blockchain: Trust economy," Deloitte University Press, 2017

Blockchain's Advantages

  • Tamper-proofing
    • Diagram: data → generate hash → e.g. a3c8sdfc → c9me30vd, combined with a timestamp from a timestamp server, all chained into successive Blocks
    • Since each block's hash depends on the data + timestamp before it, altering old data changes all downstream hashes and is immediately detectable
  • Disaster Recovery
    • In an application built on blockchain, every user has the right to generate data and keep a full copy of it
    • Diagram: a Centralized connection (many clients → one central Database) vs. a Decentralized connection(many clients, each connected to its own Blockchain node, which are meshed together)
    • This may cause some redundancy, but improves the network's reliability and fault tolerance

Analogy


Disaster recovery via blockchain is like everyone in a family keeping their own copy of important documents — losing one person's copy doesn't lose the family's history, because everyone else still has theirs.

Current Research and Application of Blockchain in Cybersecurity

  • Diagram: Blockchain Applications branch into:
    • Financial ← Digital Currency, E-commerce, Data storage
    • Medical ← Record share
    • IoT ← Device management, Data interaction, Supply chain management
    • Then Financial/Medical/IoT connect through to further categories:
    • Cyber security → Authentication, Key management, Secure communication
    • Education → Electronic certificate, Anti-counterfeiting, Copyright protection
    • Else → Predictive analytics, Digital identity

Examples of Blockchain Application Research

  • Decentralized distributed secure domain name service
    • Traditional → vulnerable to DDoS attacks
    • Blockchain-based DNS → establishes a map between DNS and hash, letting users register, transmit, and revise domain name data on any system node
    • Since every system node can act as a DNS server, attacks targeting one or more servers (DNS hijacking, cache poisoning) do no harm to the whole system
  • Keyless Signature Infrastructure (KSI)
    • Traditional → relies on key-based authentication (key publication, key revocation)
    • KSI → relies on timestamp and hash value in the blockchain
    • By monitoring these hash values with timestamps, unauthorized access to a file, operating system, or application can be detected
    • KSI has been applied in nuclear power stations and flood-control systems in the UK
  • Secure Data Storage in Healthcare
    • By developing customized access rules that meet unique security requirements using multi-signature techniques, users can only create, share, and update a clinical case with permission from the blockchain network

Ref. D. Puthal et al., "The Blockchain as a Decentralized Security Framework," IEEE Consumer Electronics Magazine

#MidtermExam Last semester, half-half project, design blockchain to support his project. Think about application (เป๋าตัง), on-top with the เป๋าตัง how can the transaction propagate to the blockchain, sensitive function??

As a security (cyber securtiy) program, how to write secure web application.

  • Strong access control (autehntication - 2FA reccomended) + Authroizartion (Priviege)
  • Password (hashing + salt)
  • SQLi prevention (input validation + prepared statement)
  • Source code scanning
  • WAF
  • XSS

Security Issues of Blockchains

  • Technical Limitations
    • Size of the blockchain
    • Distributed storage mechanism creates a broader attack surface
    • Consensus mechanism may trigger a cooperative attack — if one or more nodes control more than 51% of computing power, they can join together to launch an attack
  • Potential Risk of Cryptography Application
    • If a user loses their private key, it becomes impossible to access their digital assets on the blockchain
    • Quantum computing raises the chance of cracking asymmetric encryption algorithms
  • Opensource blockchain platforms attract intensive attacks
  • Security Management of Self-organization and Anonymity
    • Autonomous and frequent cross-border data flow in blockchain → difficulty of supervision

Using Blockchain in Industries

  • Diagram: Blockchain Applications branch into 5 domains:
    • Finance Services → Asset Management, Insurance Claims Processing, Cross-Border Payments
    • Smart Property → Money Lending, Smart Car, Smartphone
    • IoT → Smart Appliances, Supply-Chain Sensors
    • Smart Health Care → Personal Health Record Keeping, Access Control, Health-Care Management, Insurance Processing
    • Smart Government → Electronic Passport, Birth/Wedding Certificates, Personal Identification, Smart Community

IDM Based on Blockchain

An Identity Management System based on Blockchain:

  • Supports authentication
  • Retains authorization rules
  • Retains activities

Traditional vs Decentralized IDM

  • Traditional IDM is managed through a centralized database → security bottleneck
  • Decentralized IDM based on Blockchain → prevents data modification

Question: How to manage multiple IDs in an efficient manner?

Blockchain-Based Identity Management (Architecture)

  • Use Cases (Smart Things): Smart Power Grid, Smart Transportation, Smart Homes, Smart Networking, Smart Cities
  • Management and governance layer:
    • Identity Management Protocol: Registration (DID Issuance, DID Revocation), Authentication (DID confirmation, Certificate Verification), Certificate Issuance/Revocation
    • Consortium Membership Management: Certificate Authority Revocation/Issuance, Admin/nodes/consensus/Ordering service/communication channels
  • Data layer (Off-Chain): Revoked Certificates Repository ↔ Issued Certificates Repository
  • Blockchain layer (On-Chain): Smart Contracts deployed on Blockchain, Digital identities Registry, Entity Ownership & Credentials Registry
  • Connects out to IoT Applications and Users

Ref: Bouras, M.A.; Lu, Q.; Dhelim, S.; Ning, H. "A Lightweight Blockchain-Based IoT Identity Management Approach." Future Internet 2021, 13, 24.

Blockchain and Healthcare Industry

  • Blockchain can make a breakthrough in the health ecosystem when healthcare management can adequately validate the results

Enablers of Blockchain Implementation in Healthcare Services

"Reviewing Healthcare Sphere with Blockchain Aspects" — four enabling themes, each with example companies:

  • Securing Patients Data — BurstIQ, Factom, Medical Chain, Guardtime
  • Streamline Care and Prevent Costly Mistakes — Simply Vital, Coral Health Research, Robomed
  • Breakthrough in Genomics — Nebula Genomics, Encrypgen, Doc.AI
  • Medical SCM and Drug Traceability & Safety — Chronicled, BlockPharma, Tierion

Ref: Abid Haleem et al., "Blockchain technology applications in healthcare: An overview," International Journal of Intelligent Networks, Vol. 2, pp. 130–139, 2021

Benefits of Leveraging Blockchain for Healthcare Data Management

  • Health Data Accuracy — pieces of patients' data split across multiple facilities can be integrated automatically; enables providers to have a complete picture of patients' medical history
  • Health Data Interoperability — all EHR/EMR stored on the blockchain system follow a standardized data code
  • Health Data Security — eliminates the risk of data theft or mishandling; health data stored on blockchain is secure from damage stemming from natural disasters
  • Health Data Handling Costs — medical companies can easily access complete patients' data without going to multiple locations
  • Global Health Data Sharing — offers global access and traceability features to medical institutions
  • Improved Healthcare Data Audit — enables auditors to easily verify transactions; keeps institutions compliant with legal requirements/regulations; helps avoid unnecessary data redundancies

Ref: Yaqoob, I., Salah, K., Jayaraman, R. et al. "Blockchain for healthcare data management: opportunities, challenges, and future recommendations." Neural Comput & Applic (2021)

Simplified Example of Blockchain-based Patient Record Management

  • Various healthcare actors interact through a central Blockchain hub: Pharmacist (valid prescription), Patient, Health Advice, Disease Diagnosis, X-ray Technician, Clinical Decision Support, Doctor, Healthcare Policy Maker (government policies/rules/regulations), Data Analyst Officer (data collection and analytics)
  • Right-side architecture: Cloud Storage and a Distributed Ledger, connected to three smart contracts — Patient History SC, Treatment/Procedure SC, and Lab Results SC

Claims System

  • Current Prior Authorization/Claims System (traditional flow): Patient visits physician → Prescriber (Sends Prescription, Submits PA Request, Transmits Prescription) → Payer (Determines PA Status/Criteria, Compiles PA Clinical Rules, Processes PA Requests, Processes Drug Claims) → Pharmacy (Dispenses Drugs, Files Drug Claims)
  • Blockchain Prior Authorization/Claims System: Uses a Smart Contract to automatically process insurance payment based on smart contract and insurer's discharge code in patient blockchain data; clinical data is stored in the health IT system, with each transaction stored on the blockchain (containing the patient's public/pseudo-identifiable ID); patient data view/transfer/discharge codes are also validated via the patient's private key

Recent Case Studies

  • Patientory (USA) developed a DApp for secure sharing of EHR (Electronic Health Records) via blockchain among different medical facilities
  • In 2016, the Estonian government initiated a blockchain-based project to secure the health records and system access logs of its 1.3 million residents
  • The Ministry of Health and Prevention (MoHAP) of the UAE launched a blockchain-based platform for storing healthcare data (healthcare facilities, medical practitioners, medications)
  • Swiss hospitals devised a blockchain-based system for efficient, trustful tracking of medical devices

Retinal Photograph-Based Deep Learning + Blockchain for AI Medical Research

  • Study: "Retinal photograph-based deep learning algorithms for myopia and a blockchain platform to facilitate artificial intelligence medical research: a retrospective multicohort study"
  • The blockchain platform regulates four main steps in developing/testing the deep learning algorithm for myopic macular degeneration:
    1. Sharing data — transfer of the primary dataset from the clinical data owners (SERI, Singapore) to the AI technical team (IHPC, A*STAR, Singapore)
    2. Releasing model — release of the trained model, with validation results, by the AI technical team
    3. Sharing model — sharing and transfer of the encrypted model through an external testing party (PUMCH, China) via Amazon Web Services S3 cloud storage
    4. Testing model — on-chain reporting of model diagnostic performance on the external test dataset by the external testing party (PUMCH, China)
  • They also tested the platform's ability to withstand a malicious data modification attempt
  • Architecture: Local FTP server (encrypted dataset) → Blockchain network → Data and model metadata/interaction records/model accuracy → Amazon S3 (encrypted model); connects Primary dataset owner (SERI, Singapore), AI technical team (IHPC, A*STAR, Singapore) with training/validation datasets, and External testing party (PUMCH, Beijing, China) with a testing dataset

Source: www.thelancet.com/digital-health, Vol 3, May 2021

Healthcare Coins

  • Medicalchain — MED tokens, based in UK
  • Patientory — PYCO, based in USA
  • Simply Vital Health — Health Nexus, ERC20
    • Casper
    • Ethereum-fork
    • HIPAA compliant
    • Protocol / Insurance payments / care coordination
    • Not storing data on the chain
    • Several projects on plate
    • Revenue generating blockchain product
  • EHF
  • SRCOIN
  • WELL
  • Docademic | MTC
  • Linnia

Summary

  • Blockchain technology has caught the imagination of the investing public
  • Hashing and public key encryption are the core technologies for blockchain
  • Merkle trees are used to structure the blockchain and provide efficient transaction search through the network
  • Blockchains can be created through PoW or PoS by means of miners
  • People have started participating in crypto-coin initiatives and the associated blockchain networks
  • There is a need to streamline the process and educate the public about proper behavior and precautions on these networks
  • More industries tend to employ blockchains to support data sharing and access control mechanisms