Instructor: Roger Royse, Founder of Royse Law Firm
Course Title: The Business Basics of Blockchain, Cryptocurrencies, and Tokens
Location: Stanford Continuing Studies
Week: 2 (of 7)
The second class will describe the underlying blockchain technology and explain key concepts such as block, hash, blockchain, mode, nonce, distributed and decentralized ledgers, mining, tokens, proof of work, and proof of stake. We will discuss how the technology works and the ways that block chain solutions verifies transactions.
1. Week 2. Blockchain and Cryptocurrencies:
Key Technical (and Historical) Concepts
Roger Royse
rroyse@rroyselaw.com
www.rroyselaw.com
Research Assistant: Justin Sher
Stanford Continuing Studies FALL 2018 BUS 35
The Business Basics of Blockchain, Crypto Currencies, and Tokens
Week 2 July 1, 2019
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
1
2. Recap Week 1
1. Evolution of the Trust Protocol
• Double entry accounting, Financial Crisis and cryptocurrencies, Ether and
Dapps
2. Problems Blockchain solves
• Private, Anonymous, Immutable, Transparent, Secure, Immediate, Frictionless
• Cost of verification, networking
3. How Blockchain works
4. Dark Side of Crypto
5. Types of Crytpo Funding: ICOs/IEOs/DICOs/STOs
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
2
3. Week 2: Technical Concepts
1. Two Factor Cryptography: Public and Private
2. Peer to Peer
3. Verification: Proof of Work vs. Proof of Stake
4. Digital Currency
5. Permissioned v. Permissionless Blockchain
6. Ethereum, Smart Contracts and Dapps
7. More Centralized Blockchains: EOS, Steem and Tron
8. Web 3.0: Blockchain and AI
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
3
5. Early Cryptography
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
5
• Public private key (PPK) cryptography introduced at Stanford in
1976
• Before then, a message would be encrypted (scrambled) into a
string of text and sent over insecure channels
• Recipient would decode the text user a cipher or “key” – like a
password
• Keys had to be agreed upon and could be compromised
• PPK solved the problem by not requiring a shared key
• Each party has public key and private key
• First combine public and private key of one party, then combing the
outcome with the private key of another party
6. Two-Factor Cryptography
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
6
• Public-key cryptography: a cryptographic algorithm which
requires two separate keys
• Public key: encrypt plaintext or to verify a digital signature
• Private key: decrypt ciphertext or to create a digital signature
• Two parts of key pair are mathematically linked
7. Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
7
Paired Keys serve two functions:
Authentication: public key verifies that a holder of the paired
private key sent the message
Encryption: only the paired private key holder can decrypt the
message encrypted with the public key.
8. Private Public-key cryptography
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
8
• Shared secret key
• Sender combines sender’s public key and recipient’s private key
• Example: Sender encrypts message with parties’ public keys
• Only the recipient’s private key can decode the message
• Keys mathematically linked
• Useful for digital signatures
• Combine the message with sender’s private key to ensure authenticity
• Then decode the message
10. Peer to Peer
Intranet to Internet
DARPAnet and the client server model – information sent from client
to server
Centralized servers – information flowed from server to client
P2P networks- each participant (peer or “node”) could send and
receive information
Nodes are both suppliers and consumers of information
Applications:
Napster and music sharing
BitTorrent and file sharing
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
10
12. Digital Currency
• Digital currency is a money balance recorded electronically
• Digicash: 1994-1998, digital currency, a central clearinghouse and a
client server model
• Cryptocurrency uses strong cryptography to secure financial
transactions, control the supply, and verify transactions
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
12
13. Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
13
Modern crypto currency must:
Control the supply of currency
Keep a record of transactions
Be decentralized
14. BITCOIN (BTC)
• Introduced in 2008 by Satoshi Nakamoto
• Combined cryptography, P2P networks and digital signatures to
create a shared database
• Network of computers validates and maintains a record of
transactions
• Software controls the supply and coordinates validation
• Open protocol, anyone can cerate a pseudonymous account and can
send and receive Bitcoin
• Wallet: help manage accounts.
• Cold wallets are offline
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
14
15. Bitcoin Transaction
• Alice has a Bitcoin wallet with addresses, each of which refer to a
balance of Bitcoin
• Bob creates a new Bitcoin address for Alice to send bitcoin to
• Alice tells her Bitcoin client to transfer 3 BTC to Bob. The client signs
her request with Alice’s private key. The message is broadcast to the
Bitcoin network and eventually included in a block.
• Anyone on the network can use Alice’s public key to see that the
request is from Alice (pseudonymous).
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
15
16. BTC Transactions
• BTC transactions are verified by the nodes
• They then sit in the Memory pool or “Mem Pool” until….
• “Miners” bundle the transactions of the past ten minutes
into a block
• If user has enough BTC, and the transaction fee given to the miner is high
enough, the transaction will be deemed valid and bundled.
• If the user does not have enough BTC, the transaction will be rejected
• If the transaction fee is not high enough and the blockchain is congested, the
transaction will be delayed until there is less congestion.
• Video https://youtu.be/adDTkjffN1U
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
16
17. The Block, or Record of Transactions
• Transactions are grouped together in “blocks”
• Each block links together to create a sequential timestamped chain
• Each block contain information about transfers (and any other data)
• Block has a “header” to organize the data base. The Header contains
• A “hash” or unique fingerprint of data in the block
• Timestamp
• A hash of the previous block
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
17
18. Verification of New Blocks
• In a centralized system, a trusted authority would verify transactions
and create and store the “blocks”
• In a distributed system, the collective must verify
• How can we trust the block? Who is allowed to store information on
the chain?
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
18
19. Verification (Bitcoin)
• Miners bundle data into a block and create a hash
• A hash function maps data of arbitrary size to data of fixed size.
• values returned by a hash function are called hash values, hash codes, hash sums, or hashes.
• Bitcoin uses “nonces” to create different hash values from the same data
• A “nonce” is a random number added to data in the block prior to hashing
• The new hash value is based on the previous hash value, the new transaction block and a
nonce.
• Each hash must have a certain number of leading zeros
• Miners must create many nonces until they produce a hash with leading zeros
• Requires expensive, difficult trial and error calculations (“mining”)
• The high cost of mining prevents fraud
• Solving the puzzle is “Proof of Work”
• Miners awarded BTC for solving the puzzle (reward)
• The hash is broadcast and other nodes verify that the hash meets the requirements
(consensus)
• State updated every ten minutes (calculates balances)
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
19
22. Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
22
https://youtu.be/V6gLY-1G4Mc
What is the merkle tree in Bitcoin?
23. Proof of Work
• Artificially makes it computationally costly for network users to
validate transactions
• The benefit of making it costly to validate transactions is that validation can
not be influenced by the number of network identities someone controls, but
only by the total computational power they have
• Rewards them for trying to help validate transactions
• Block reward and transaction fees for every valid hash
• Reward is used so that people on the network will try to help validate
transactions
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
23
24. Integrity of the Blockchain
• Any change in data will change the hash and break the chain
• The 51% Attack: 51% of the miners could theoretically collude to
make it possible to double spend BTC, but no one has that much
computational power. As more blocks are added to the chain it
becomes even more computationally expensive to unwind
transactions and double spend tokens from earlier blocks.
• Creating extra nodes to mine is expensive and uses significant energy
resources.
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
24
25. Consensus Algorithms: verified by miners
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
25
•Proof of work
• The most utilized consensus
algorithm for a blockchain
• Every computer (node)
competes to solve a
mathematical puzzle
• Winning node earns the right to
write the next block and
receives an incentive for that
work
• Energy and cost: requires a
large amount of computing
power
•Proof of Stake
• An alternative consensus
algorithm for a blockchain yield
• Instead of mathematical
contest, miners put up a stake
in return for the right to
validate the network
• Stake as a non-revocable
security deposit against fraud or
inaccuracy
26. Proof of Stake (PoS) Algorithms
• Delegated PoS
• Consensus determined by elected delegates. Promotes centralization.
• https://youtu.be/_rLObP6ZkCA
• Micali’s Algorand
• Lottery system that randomly selects writers of the block from among users
• https://www.algorand.com/resources/news/algorand-publicly-opens-testnet/
• Ethereum’s Casper (Currently in Testing)
• Distributed proof of stake algorithm. Uses penalties against nodes backing losing
forks to mitigate “nothing at stake” problem that has prevented distributed PoS from
successful implementation.
• https://blog.bitmex.com/complete-guide-to-proof-of-stake-ethereums-latest-
proposal-vitalik-buterin-interview/?vtk
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
26
27. Forks and Double Spend
• Suppose Alice transfers the same bitcoin to 2 different people?
• And the nodes verify them both?
• Who wins?
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
27
28. Double Spending Problems
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
28
The double spend problem:
Preventing someone making a purchase
with digital cash from reusing the same
token to purchase again
Source: an image from Steemit website where they describe the
double spend problem
29. Forks and Double Spend
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
29
30. Consensus when the BC forks
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
30
Miners will pick the longest chain
31. Permissioned and Permissionless networks
Source: Blockchainhub website where they describe blockchain & distributed ledger technologies
Permissioned Permissionless
Faster Slower
Managed upkeep Public Ownership
Private Membership Open & Transparent
Trusted Trust-free
Legal Allegal
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
31
32. Ripple – Permissioned Blockchain
• Protocol to facilitate the exchange of currencies and other stores of
value
• Consensus through trusted subnetwork
• Speed
• Trust and security
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
32
33. Ethereum
• Free and open source, peer to peer
• Native digital currency is Ether
• Uses Proof of Work
• Richer functionality
• Solidity, a Turing complete programming language
• Allows anyone to write a smart contract and deploy a dApp
• Faster (12 seconds vs 10 minutes)
• Can run smart contracts
• Can support dApps
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
33
34. Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
34
Source: Coinweez website where they describe
decentralized applications
dApps
35. Smart Contracts
• Smart Contract/Ethereum allows the users to codify significant parts
of a workflow process, agreement, or task
• In smart contract, when a transaction occurs, the software
automatically executes an action according to the specification
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
35
36. Ethereum – accounts
• Externally owned account
• Public private keys
• Can send Ether
• Contract Account
• Public address, no private key
• Stores data and runs smart contracts
• Collects Ether
• Ethereum, Virtual Machine (EVM)
• Runs smart contracts
• Charge a fee (“gas”) for each computational step
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
36
37. LibraCoin – Centralized Blockchain
• Run by the Libra Foundation in Switzerland started by Facebook. Currently
in testing. Won’t be released till at least 2020.
• Membership in the foundation costs $10 million and permits a member to
run a validator node. Participation is governance is determined by
ownership of a separate Libra Investment Token that is distinct from the
Libra cryptocurrency.
• Account based like Ethereum.
• Provides a smart contract platform that is similar to Ethereum, but based
on the “Move” programming language. Like Ethereum, the system requires
gas for user’s computation on the network.
• Does not use blocks like other cryptocurrencies. Transactions are added to
the ledger and their scripts executed one at a time in sequence.
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
37
38. LibraCoin – Centralized Blockchain
• The consensus algorithm is optimized for speed providing >1000 transactions a second.
Less than 100 validator nodes are likely to serve the entire network. Uses leader election
algorithm suitable for blockchains where peers trust each other instead of proof of work
or stake.
• There will likely be millions of clients.
• Validators run client’s smart contracts. These scripts are sent with each transaction and
their computation must be paid for by Libra cryptocurrency.
• Validators add and remove Libra supply from the system based on currency reserves.
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
38
39. Last Mile Problem
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
39
• The last mile problem is the disconnect between online and offline
activities
• The last mile is a phrase widely used in the telecommunication industry to refer
to the final leg of the networks that deliver services to retail end-users
• Typically the speed bottleneck in networks: its bandwidth limits the bandwidth
of data that can be delivered to the customer
• The most expensive part of the system and the most difficult to upgrade to new
technology
• Solving the last mile problem means connecting offline events to a
digital recording of those events during the verification of a transaction
43. Week 3: Business Economics of Blockchain
• Questions to be addressed
1. How blockchain technology will shape innovation in different
industries.
2. Evaluate blockchain’s value in short-term and long-term perspective
3. How can companies determine if there is strategic value in
blockchain?
4. How companies take a structured approach in developing
blockchain strategies?
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
43
44. ROYSE LAW FIRM, PC
For questions , Contact
PALO ALTO
1717 Embarcadero Road
Palo Alto, CA 94303
LOS ANGELES
11150 Santa Monica Blvd.
Suite 1200
Los Angeles, CA 90025
SAN FRANCISCO
135 Main Street
12th Floor
San Francisco, CA 94105
Palo Alto Office: 650-813-9700
CONTACT US
www.rroyselaw.co
m
@RoyseLaw
MENLO PARK
149 Commonwealth Drive,
Suite 1001
Menlo Park, CA 94025
SANTA MONICA
520 Broadway
Suite 200
Santa Monica, CA 90401
SAN FRANCISCO
135 Main Street
12th Floor
San Francisco, CA 94105
Menlo Park Office: 650-813-9700
CONTACT US
www.rroyselaw.com
@RoyseLaw
ORANGE COUNTY
135 S. State College Blvd
Suite 200
Brea, CA 92821
Research Assistant: Natalie Ryang
nryang@rroyselaw.com
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
44