Instructor: Roger Royse, Founder of Royse Law Firm
Course Title: The Business Basics of Blockchain, Cryptocurrencies, and Tokens
Location: Stanford Continuing Studies
Week: 4 (of 7)
This class will shift will focus on the promise of smart contracts to provide cheap verification, reduce costs and automate many routine transactions. We will explain what a smart contract is (and what it is not), how it works and discuss where it can be implemented to the current economy. We will discuss the use of distributed applications built on the block chain and examine how Ethereum allows dApps to run. We will also look in depth at several dApps including Cryptokitties, Augur and Local Ethereum.
A Beginners Guide to Building a RAG App Using Open Source Milvus
Week 4 - DApps, Smart Contracts, and Decentralized Incentive Systems
1. Week 4. DApps, Smart Contracts, and
Decentralized Incentive Systems
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 4 July 15, 2019
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
1
2. Recap Week 3: Cryptocurrencies
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
2
• Financial Crisis: a rise of bitcoin
• Problems with Cryptocurrency: bad actors
• Legal Frameworks: KYC, AML, and BSA
• Zero Knowledge Proof
• Top 10 cryptocurrencies, exchanges, and market share
• Future authoritarian government crypto currencies
3. Early Alternative Applications
• Eric Voorhees and Satoshi Dice
• https://www.forbes.com/sites/michaeldelcastillo/2019/01/03/bitcoins-last-gunslinger/#200e89c240bb
• Altcoin: After Bitcoin
• Namecoin: Bitcoin fork for DNS
• Colored coin: transform real assets into digital e.g. gold, equity
• Mastercoin and the rise of the ICO
• https://www.forbes.com/sites/laurashin/2017/09/21/heres-the-man-who-created-icos-and-this-is-the-new-token-hes-
backing/#57919ba41183
• Many platforms tried and failed at being the Blockchain 2.0 platform
• https://bitcointalk.org/index.php?topic=1153740.0
• Jed McCaleb: Ripple, Stellar
• https://www.coindesk.com/coindesk-most-influential-blockchain-2018-jed-mccaleb
• Mike Hearn and Smart Property
• https://en.bitcoin.it/wiki/Smart_Property
• Vitalik Buterin and Ethereum: Miami conference in 2014
• https://www.youtube.com/watch?v=l9dpjN3Mwps
4. Lack of Turing Completeness
• Bitcoin is not “turing complete”
• Turing complete: a program language is generally enough to emulate all
others and equivalent in terms of computations
• You can’t tell whether a program will halt or forever without running
the code to check for yourself
• Ethereum is turing complete
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
4
5. What are smart contracts?
• A smart contract is a program that, for a fee paid in the blockchain’s
cryptocurrency, can be placed by anyone permanently on the
blockchain.
• Each smart contract is executed by every node in the network and has
its data stored on every node in the network.
• Anyone with the blockchain’s cryptocurrency may interact with the
smart contract subject to its rules.
• Smart contracts can transfer the blockchain’s cryptocurrency, store
and retrieve data, and call other smart contracts based on the
programs rules.
6. What are the limitations of Ethereum smart
contracts?
• Every data storage or computation operation in a smart contract costs
cryptocurrency. Costs are astronomical compared to non-crypto
computation processing and storage. No operations are free.
• All data in the Ethereum blockchain is public. The Ethereum team has
acknowledged that there is no practical way to hide information contained
in a smart contract.
• Because all data on the Ethereum blockchain is public, any secure
credentials must be maintained in another system. This leads to a weak
notion of identity inside of Ethereum.
• Ethereum is relatively slow in its processing. Peak transaction volumes
globally for the system as a whole max out at about 15 per second as
opposed to 45,000 a second processed by Visa.
7. What can you do with Ethereum Smart
Contracts?
• Start your own cryptocurrency.
• Easy to do. Thousands have been created.
• Sell digital assets that may be traded anonymously.
• Cryptokitties – Unique virtual kittens that breed with each other to produce
new virtual kittens. Cryptokitties can be transferred and thus bought and sold.
• Start a anonymous decentralized crypto exchange.
• Local Ethereum – Meet people and trade Etherum with them in person for
cash.
• Start a decentralized prediction market
• Augur – Bet with people around the world about the outcome to various
questions.
8. So what makes Ethereum a good fit for your
application?
• Your application prefers participants to be anonymous.
• You want to make all your money in cryptocurrency.
• You have very small amounts of data to store.
• Your program logic is simple.
• You trust no one you’re dealing with.
• You are fine with your application data and smart contract code being
public.
• You don’t need to process more than 15 transactions per second.
• If any of these limitations are a dealbreaker, you probably want to consider
using a private blockchain instead.
9. ERC-20 Tokens: DIY Cryptocurrency
• https://en.wikipedia.org/wiki/ERC-20
• ERC-20 Tokens are a Smart Contract Program with 5 operations
• What is the total supply of tokens?
• How many tokens does an account own?
• Distribute tokens from the creator’s account to another account.
• Over $3 million dollars lost from mistakenly sending tokens to smart contracts instead of wallets!
(https://www.investinblockchain.com/what-are-ethereum-tokens/)
• Transfer tokens from one account to another.
• Allow a spender to withdraw from your account as many times as needed up to a specified value limit.
• Check the spender’s remaining balance.
• Who creates the money? You do! Just specify a total number of tokens in the smart contract and
send it to the blockchain. Given them out to anyone till they’re all gone. In order to create the
contract and give out the tokens you’ll have to pay some Ethereum cryptocurrency.
• You can make your own cryptocurrency in under a half an hour.
• https://medium.com/bitfwd/how-to-issue-your-own-token-on-ethereum-in-less-than-20-minutes-
ac1f8f022793
• Get it right the first time because you will never be able to change it.
10. Traditional SAAS Business Architecture
SAAS Company
Administrators
Cloud
Database
Web
Application
Developers
Deploy Code
Administrative
Actions
Payment System
Bank API
Secure Wire
Service
ACH/FedWire
Customers
11. Traditional SAAS Business + Crypto Payments
Architecture
SAAS Company
Administrators
Cloud
Database
Web
Application
Developers
Deploy Code
Administrative
Actions
Customers
Any Blockchain
SAAS
Crypto
Account
Customer
Crypto
Account
12. Basic Attention Token: SAAS + Native App That
Makes Crypto Payments with ERC-20 tokens
• https://basicattentiontoken.org/BasicAttentionTokenWhitePaper-4.pdf
• Advertisers pay for targeted ads with BAT ERC-20 Token.
• Publishers show ads.
• Users browse web sites with Brave browser.
• The user’s browser automatically reports anonymized ad viewing statistics
to Brave’s servers and are paid ERC-20 tokens.
• Tokens are shared with publishers after visits to publisher’s site.
• Brave does not endorse trading of ERC-20 tokens for regulatory reasons,
but they are sold on many exchanges anyway. No smart contracts are
used.
14. ERC-20 Example: Gemini Dollar Stablecoin
• https://gemini.com/wp-content/themes/gemini/assets/img/dollar/gemini-
dollar-whitepaper.pdf
• Aims to mirror fiat currency 1 to 1.
• Backed by audited reserves which mirror the supply of tokens.
• Token supply will be decreased or increased as reserves are redeemed or
deposited.
• Contract is updateable to
• Resolve vulnerabilities
• Extend the system
• Improve the system
• Pause, block or reverse token transfers in response to security incident or if legally
obligated or compelled to do so by a court of law or other government body.
15. Gemini Dollar Stablecoin Architecture
Impl contract can be switched out for updates of how the contract functions.
Certain high risk operations, like transferring large amounts of tokens or issuing new tokens, must consult
a custodian contract which requires approval from a user with access to offline cryptographic keys.
16. ERC-223 Tokens: Bug fix for ERC-20 Token
• Mainly fixes issues in ERC-20
• Allows for transfer of tokens to smart contracts instead of causing
their permanent loss.
• Uses less Ethereum to transfer tokens.
• Backwards compatible.
• Limited adoption due to wallets not supporting it yet.
17. Cryptokitties are examples of ERC-721 tokens. Each one is unique. They are even viewable inside
of Ethereum blockchain debugging tools. ERC-721 tokens can be used to represent the ownership
of other unique assets like rare works of art or antiques.
https://etherscan.io/token/0x06012c8cf97bead5deae237070f9587f8e7a266d?a=1611461#inventory
ERC-721 Tokens: Non-fungible assets
18. ERC-721 Tokens: New Business Models
• Cryptokitties
• Sell 50,000 cats for Ethereum. 1 every 15 minutes in a descending clock auction.
• Sellers choose high opening bid, a minimum closing bid, and a timeframe for which they’d like
their auction to run.
• First buyer wins
• Auctions are done this way because otherwise buyers would have to pay Ethereum
transaction costs for every bid.
• Let users breed cats
• There is a similar process for breeding cats. Owners who want to breed and sire new cats
place their maximum and minimum closing bid and timeframe.
• Receive 3.75% of each trade of a cat.
• All this is processed automatically on the Ethereum block chain. The developers
don’t have to do anything except promote the collectibles and make art depicting
them.
19. ERC-721: Digital Collectible Benefits
• No central issuing authority
• There is no way for the issuer to make more of a popular collectible.
• No provider dependency
• Unlike other digital collectibles, the existence of the collectible is not
dependent on the existence of the provider
• Functional
• Smart contracts can have unique functions unavailable in most collectibles.
For example, Cryptokitties can reproduce and make completely new
Cryptokitties.
20. Cryptokitties Fans and Skeptics
• Blockchain has unlocked the magic of digital scarcity, and combining that with the power of making the digital goods persistent
gives them a potential value that is only limited by how much prestige a wealthy person might place on ownership of the item.
• -- Justin Poirier
• Nobody wants to pay $300 for a hexadecimal string. That's LITERALLY all you’re buying. All the website does is display a picture of a
cat. You're paying hundreds of dollars for a picture of a cat. Let that sink in.
• This was a modern tulip bubble. You were buying hex strings that tied to the picture of a cat. People were paying 10-20-30 ETH for
a cat picture. 10 ETH was around $4000? For a cat picture. Yeah...
• -- CryptoKitties
• “By now everyone has heard of CryptoKitties, a cute game that went viral to the point of overloading the whole Ethereum
network. This is the inside story behind how we made $107K investing in CryptoKitties and briefly set the record for the largest
sale ever (currently second-largest). Later, we made ~$8K running an automated arbitrage bot. While playing the speculation
game at the height of the mania was exciting, the bot was fairly technically involved and will be interesting to people who want
to learn blockchain engineering in general.”
• https://hackernoon.com/how-we-made-100k-trading-cryptokitties-2d69aebe715b
• https://kittysales.herokuapp.com/
• Total Sales: 577,446
• Total Unique Kittens Sold: 465,071
• Total USD Sold: $27,458,376.84
Average Sale Price: $47.55
Median Sale Price: $12.26
21. Augur – a decentralized prediction market
• https://github.com/AugurProject/whitepaper/blob/master/english/whitepaper.pdf
• Allows anyone to bet on a future outcome.
• Different outcomes are matched with each other so that losers pay winners.
• Outcome reporters and successful disputers are also compensated for their service.
• There are bonds posted to provide for penalties in the case of a default by any party and automatic
contingency procedures to provide for smooth operation of the market in case of any party defaulting.
• Robustly designed outcome reporting and dispute resolution
• The outcome is reported by a designated reporter but can be disputed by those posting a bond in REP, the reputation
currency of Augur. If they successfully overturn the result, they make a fixed 50% return.
• Any reported results that are overturned result in the loss of all REP staked by any person staking their REP to the overturned
result.
• If 2.5% or greater of the REP currency is involved in a outcome dispute, a condition known as a “Fork” is created and users
may choose a side and be compensated for joining the winning side. Those who choose the losing side will lose all their REP.
• Is it legal? Isn’t this essentially gambling?
• https://www.technologyreview.com/s/611757/this-new-ethereum-based-assassination-market-platform-could-cause-
napster-size-legal/
23. Augur Architecture
• Pre-Reporting
• Question registered on blockchain and bond posted by registrant to ensure question validity and that the designated reporter will post an
outcome promptly after the prediction deadline. The bids of those supporting different question outcomes are matched to each other so the
winner will take the loser’s bid.
• Designated Reporting
• After the prediction deadline passes the designated reporter has 3 days to post the outcome. The reporter must stake his REP cryptocurrency
to an outcome and will lose it all if the prediction is overturned.
• Open Reporting
• If the designated reporter fails to show, the first person to post an outcome receives the no-show bond.
• Waiting for Next Fee Window to Begin
• The market is on hold until the fee window begins. This is usually every seven days
• Dispute Round
• If a dispute bond is posted, the funds are held in escrow and a chance for someone else to post a bigger dispute bond ensues. If the bond
reaches 2.5% of all REP then a Fork ensues. If not then the disputer wins the crypto of the person he disputed.
• Fork
• All trading is shut down and all users can optionally stake to an answer. The answer with the most staked REP wins and those who staked to
the other answer lose all their REP. Users cannot reverse their stake once committed.
• Finalized
• The answer is finalized and rewards are paid out to winning bidders.
24. Hybrid SAAS/Blockchain Business
SAAS Company
Administrators
Cloud
Database
Web
Application
Developers
Deploy Code
Administrative
Actions
Customers
Ethereum Blockchain
Smart
Contracts
Company
Crypto
Account
Customer
Crypto
Account
Crytpo Fees for each call
25. Local Ethereum: Hybrid Decentralized Cash to
Crypto
• https://whitepaper.localethereum.com/
• Lets people buy and sell crypto online or offline.
• Users of the system never give up their private keys to Local Ethereum or
transfer Ethereum to Local Ethereum
• Escrow of funds occurs on the blockchain. The company never gets custody of the
cryptocurrency.
• In case of a dispute, either buyer or seller ask Local Ethereum to arbitrate their
dispute. Local Ethereum can only release it to the buyer or seller and can’t transfer it
to itself.
• Hybrid Architecture
• Deals are arranged on a centralized server.
• Encryption keys are maintained on users browsers.
• Because users are completely identified by their cryptographic ids, there is no way to
recover passwords or recover from account takeovers.
26. Alternative Public Smart Contract Blockchains
• Ethereum’s transaction throughput and transaction fees are its main
weakness.
• EOS
• High scalability: 4,000 transactions per second, delegated proof of stake consensus
• Highly centralized: Only 21 Main Nodes, Low Transaction Fees
• Regularly freezes accounts: https://www.coindesk.com/eos-blockchain-arbitrator-
orders-freeze-of-27-accounts
• Tron
• High Scalability: 2,000 transactions per second, delegated proof of stake, lower
transaction fees. Compatible with Ethereum smart contracts.
• Aims to be decentralized but there are allegations of high centralization.
• https://cointelegraph.com/news/tron-co-founder-and-cto-leaves-project-alleging-
excessive-centralization
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
26
27. Looking at alternative public blockchains
• Evaluate the requirements of your application in light of the
capabilities of the blockchain (e.g., high transaction throughput,
irreversibility of transactions)
• Evaluate the governance model of the blockchain
• Evaluate the community’s confidence in the blockchain’s
cryptocurrency
• Evaluate the fee structure of the blockchain
• Evaluate the maturity of the blockchain’s development ecosystem.
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
27
28. Key Points
• Technology review: limitation of bitcoin
• Four Types of dApps (Though there are more)
• Stable Coins
• Escrow Exchanges
• Collectibles
• Prediction Markets
• Ad Exchanges
• Three architectures
• Crypto Payments Only
• Fully distributed
• Hybrid
• Biggest differences between blockchain and traditional apps
• Smart contracts are very simple due to the high cost of computation and storage.
• Smart contracts use largely anonymous identities.
• Little server infrastructure to maintain for a fully decentralized apps
• Development is tricky because bugs can cause huge loses and are difficult to fix.
• Alternative public blockchains
29. Week 5. Blockchain Economics: Strategic
Value in Private Blockchain
• Questions to be addressed
• How blockchain technology will shape innovation in different industries
• How can companies determine if there is strategic value in blockchain?
• How can we evaluate blockchain’s value in short-term and long-term perspective?
• How do companies take a structured approach in developing blockchain
strategies.
Stanford Continuing Studies BUS 35: Business Basics of
Blockchain, Crypto Currencies, and Tokens
29
30. 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
30