2. •Motivating example
–Foundational building blocks
•Smart contracts and DApps
•Application and use cases
–Digital assets (tokens)
–Identity and applications
•Demo
Introduction
Outline
fstream.io
3. • A network
– Could be open (public) or private
•Distributed ledger technology
–A database that can allow for global
read/write access
• Consensus driven validation/maintenance
mechanism
Introduction
Blockchain Overview
fstream.io
5. •Alice banks at Bank A
•Bob banks at Bank B
•Alice wants to send Bob $100
Motivating Example
Intermediation & Frictional Costs
fstream.io
6. Correspondent
Banks
Debit Credit
Tx Amt Tx Amt
balance $200
Transfer $100 balance $100
Alice’s bank Bob’s
bank
Bank A
Debit Credit
Tx Am
t
Tx Amt
balance $100
Transfer $100
balance $200
Transactions
Tx Amt
Debit Bank A’s account $100
Credit Bank B’s account $100
Interbank
Settlement
source: Gleenbrook
Motivating Example
What it looks like today:
Bank B
Bo
b
Alic
e
7. • Trust & integrity
• Established
processes and
procedures
• Centralized
• Intermediation
‒ Cost, efficiency
• Centralized
‒ Counterparty risk
‒ Single point of
failure
Benefits Drawbacks
Motivating Example
What’s wrong with status quo?
fstream.io
8. We want something that .
. .
Motivating Example
Opportunity and Challenge
● Is decentralized ➡ peer-to-peer
● Is open ➡ anyone can participate
● Has integrity ➡ cannot be modified fstream.io
9. • Need a few guarantees:
–Verification of identities
–Anonymity
–Only valid transactions are written to the
ledger
–Ledger is tamper-proof
• Cannot edit / erase valid records
Transfer of Value
Blockchain
fstream.io
13. Blockchai
n
Trustless peers
Bank
X
Custome
r 1
Custome
r 4
Custome
r 3
Custome
r 2
Bank
Z
Custome
r 1
Custome
r 4
Custome
r 3
Custome
r 2
Bank
F
Custome
r 1
Custome
r 4
Custome
r 3
Custome
r 2
Bank
M
Custome
r 1
Custome
r 4
Custome
r 3
Custome
r 2
Customer
1
Customer
2
Customer
3
Customer
4
Decentralized Trust
Blockchain
Traditional
Trusted third
parties
fstream.io
14. Secure communication and ledger
maintenance
Arbitrary length Some function Fixed length
message ➡ f(message) ➡ digest
“baiju” ➡ f(“baiju”) ➡ “bu”
Cryptographic hash additional properties:
1. Computation efficient
2. Low collision rate
3. Non-reversible
1. Easy to generate
2. Produce unique outputs
3. Hard to guess
Cryptography
Blockchain
Hashing
:
Exampl
e:
fstream.io
15. Tamper-proof Transmission
Blockchain
I will pay
$500
I will pay
$500
Alice
Bob
Alice’s Private Key
Alice’s Public Key
Sign / Encrypt
Verify /
Decrypt
0xBEFC1A2...
fstream.io
16. • A consequence of decentralization
• Allows for disintermediation
• Not a new problem in computer science
– Byzantine fault tolerance
• Different algorithms/methods:
– Proof-of-work
– Proof-of-stake
– And more
Need for Consensus
Blockchain
fstream.io
17. • Proof that you have engaged in significant amount of
computational work e.g. solved a really hard puzzle
• The puzzle should have the following properties
– Hard to solve ➡ no smarts, only guessing
– Solution easy to verify
Hash
“challenge” “proof”
“0000…00xxx…xxx”
Only way to
find this proof
is by brute
force
Proof of Work
Blockchain
fstream.io
18. Alice
(VKA)
Bob
(VKB)
Shared ledger
From To BTC
Kate Alice 50
Fred Alice 50
Alice Bob 100
(VKA, 100, VKB)
[(VKK,50),
(VKF,50)]
transfer
Proof of
ownership
tx
Broadcast to everyone
Alice signs tx with private key
x miner z minerminer
TX4
TX5
TX2
TX3
Participants on the network
who take part in transaction
and state validations
Transactions
Blockchain
Mining
fstream.io
19. Shared ledger
From To BTC
Kate Alice 50
Fred Alice 50
Alice Bob 100
TX3TX1 TX2 TX4 TX5
. . .
A transaction block (think of it as a page in the
ledger)
TX6
Hash
F(x)
Hash
F(x)
Hash
F(x)
Genesis
block
Block newBlock 3Block 2Block 1 . . .
Incorporates prev block
~ 10 mins
Proof of
work
Genesis
block
Block 3Block 2Block 1 Block new. . .
00xxx … xxx 0000xxx … xxx 000xxx … xxx 0000xxx … xxx 00000xxx … xxx
Proof-of-work
1. No one miner controls what
transactions get accepted and
in what order
2. If more than one miner mines
the block then voting to award
block to longest chain
3. A “bad” miner would need to
create a larger chain than
everyone else (gets harder
and harder)
Verification and Mining
Blockchain
fstream.io
21. A mechanism by which there is a
shared writable database that is:
1. Distributed (non-centralized)
2. Fully transparent yet anonymous
3. Trustless but with integrity
4. Efficient
So that’s the Blockchain
Blockchain
Network
Database
Cryptography
Compute
+
+
+
fstream.io
22. • So far we have described a public
blockchain
–Open internet based and P2P
–Requires a higher standard for achieving
consensus and security
–Trustless
Public & Private Blockchains
Blockchain
fstream.io
23. Public & Private Blockchains
Blockchain
Public Private
Access Open read/write
Permissioned read
and/or write
Speed Slower Faster
Security
Based on consensus
algo
Pre-approved
participants
Identity Anonymous Known identities
Examples
Bitcoin, Ethereum,
Hyperledger
Ripple,
Blockstream,
Multichain fstream.io
25. Blockchain is simply a shared writable database
➡ Other types of information can be stored.
– Remittances and payments (we saw this)
– Other asset ownership & transfer
• Securities (clearing & settlement)
• Title deeds, ...
– Other information
• Health records, ...
Beyond Payments
Blockchain Generalization
fstream.io
26. Imagine applications that are not dependent on
central servers but run on these distributed networks
A
B
+ C
But let’s abstract even more
Blockchain Generalization
State
Instructions
Execution
+
+
fstream.io
27. Instructions and state stored on blockchain
– Tamper-proof
– Executed without centralization
Use cases
– Financial exchange + other marketplace
– Escrow accounts
– Crowd-funding
– Smart meters trading energy credits
Decentralized Compute
Blockchain Generalization
fstream.io
29. What is it?
Smart Contracts
A computer program that
directly controls the transfer
of digital assets between
parties under certain
conditions.
“
”fstream.io
30. • Defines rules around an agreement
• Enforces these obligations / penalties
• Executes actions required by clauses
• Autonomous without ownership
• Secure
What are some properties?
Smart Contracts
fstream.io
31. What is it made of?
Smart Contracts
• Address (identity)
• Balance (value)
• Fields (data)
• Methods (behavior)
• Events (publish)
fstream.io
32. • Written in a high-level programming
language called Solidity
How do I write one?
Smart Contracts
contract HelloWorld {
function sayHi (string name)
returns (string greeting) {
return “Hello” + name;
}
}
Contract
definition
fstream.io
33. • Compiled down to low-level instructions
called bytecode
• Executed on the Ethereum Virtual
Machine
How do I run it?
Smart Contracts
Solidity
Bytecode
Ethereum VM
Compiles to:
Executed by:
contract { · · · }
PUSH1 0x60; MSTORE; EXP
01010101010101101011...
fstream.io
34. • Stored in the blockchain
• Runs on all nodes in the network
• Executes inside Ethereum Virtual
Machine
Where does it run?
Smart Contracts
EVM
1 + 1 = 2
Node
1
EVM
1 + 1 = 2
Node
2
EVM
1 + 1 = 2
Node
3
EVM
1 + 1 = 2
Node
n
Network
. .
.
fstream.io
35. • What if there is a rogue node?
• What checks and balances are in place?
What about consensus?
Smart Contracts
EVM
1 + 1 = 2
Node
1
EVM
1 + 1 = 3
Node
2
EVM
1 + 1 = 2
Node
3
EVM
1 + 1 = 2
Node
n
Network
. .
.
fstream.io
36. • By default, no one!
–Basis for decentralized entities (e.g. DAO)
• However, special privileges can be
coded into the contract by owner
Who owns it?
Smart Contracts
fstream.io
37. • There are two types of accounts:
–Normal or externally controlled accounts
–Contracts, i.e., snippets of code
• Unlike external accounts, contracts are
reactive, and require external stimulus
Who is it?
Smart Contracts
fstream.io
38. • Users of the contract need to pay gas
fee to run the contract
–Makes costs transparent
–Brings economic incentive to participants
–Protects against malicious users
–Makes the network more secure
Who pays for it?
Smart Contracts
fstream.io
39. • Blockchain
– Relatively expensive
– Used for computation
• Logs
– Cheap
– Not accessible to contract
Where does it store data?
Smart Contracts
Cost
fstream.io
40. • Can form complex interactions
• Communicate with each other via
messages
• Enables reuse
Message calls
How do contracts interact?
Smart Contracts
fstream.io
41. • Invoke it programmatically
–Need to have access to the ABI
(interface)
• Use a DApp
–Provides a user interface
How do I interact with it?
Smart Contracts
fstream.io
43. • Decentralized Application
• Consists of two parts
– Frontend - UI
– Backend - Business logic
• Both run on a decentralized peer-to-peer
network
Overview
DApps
fstream.io
44. • Frontend makes calls to backend
–Written in any language
–Hosted on decentralized storage
• Users interact with web page
–Send actions to contract
–Receive messages from contract
Mechanics
DApps
fstream.io
47. • How are identities represented on the
blockchain?
• How are they secured?
• How do you represent assets?
• What are some examples?
Topics
Applications & Use Cases
fstream.io
49. • Accounts represent identities of external
agents
• Every account is defined by a public-
private keypair
• Use public key cryptography to sign every
transaction made by the account
• Tied to an address (0x02142589…)
Accounts
Identities
fstream.io
50. 1.Randomly generate a private key
2.From your private key generate a public
key
3.From your public key your address is
derived
This address is now your identity in the
context of the blockchain.
Account Creation
Identities
fstream.io
51. The exact mechanism is explicitly defined
the Ethereum yellow paper:
?
Account Creation
Identities
fstream.io
52. • Anonymous
• Cannot be confiscated
• Authentication is:
–Immediate
–Based on immutable & irrefutable private
keys
Powerful Properties
Identities
fstream.io
53. Beyond Addresses & Keys
•Can empower real world identity.
•Imagine storing your encrypted
fingerprint in some decentralized
storage or blockchain:
–Tie fingerprint based identity verification
with other services
–Don’t reveal your real identity
Identities
fstream.io
54. Zero-knowledge Proofs
• Where one party can prove to another,
knowledge of a secret, without giving up
any information
Identities
Verifier
Prover
?
true / false
Smart
Contract fstream.io
56. • Sound principles behind blockchain
technologies
• End users must protect private keys
• Real world cases of systems
compromised
Securing of Accounts & Keys
Assets and Tokenization
fstream.io
59. Transferable Fungibles:
• Being something (such as money or a
commodity) of such a nature that one part
or quantity may be replaced by another
equal part or quantity in paying a debt or
settling an account
• Capable of mutual substitution
Source: Merriam-Webster
Tokens
Assets and Tokenization
fstream.io
60. • We can define and express tokens
through the use of smart contracts.
• The very first example of a smart contract
by the Ethereum Project is the “minting” of
your own currency.
Tokens and Smart Contracts
Assets and Tokenization
fstream.io
61. Tokens Standardization
Assets and Tokenization
Tokens are such an important use case that
there are standards and specifications as
well as reference implementations:
• ERC#20 - Token Standard
• ERC#22 - Token Registries
Registries:
• Allow listing and searching of tokens
• Can serve as connector
fstream.io
62. Minimal Viable Token Contract
Assets and Tokenization
contract MyToken {
mapping (address => uint256) public balanceOf;
function MyToken(uint256 initialSupply) {
balanceOf[msg.sender] = initialSupply;
}
function transfer(address _to, uint256 _value) {
if (balanceOf[msg.sender] < _value) throw;
if (balanceOf[_to] + _value < balanceOf[_to]) throw;
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
}
}
Contract
definition
fstream.io
63. Some important use cases:
• Securities
• Smart Property
How can we apply this?
Assets and Tokenization
fstream.io
64. • Can be expressed directly as tokens
• Best suited for private blockchains
• Allows for:
–Faster settlement
–Lower transaction costs
–Risk mitigation
Securities
Assets and Tokenization
fstream.io
65. Australian Securities Exchange
• Moving the clearing and settlement part of
its platform to Blockchain technology
• Near real-time settlement of equity
transactions
Real World Examples
Assets and Tokenization
Benefit:
fstream.io
66. Overstock.com first publicly traded
company to issue stock on a blockchain
• Issued $500 million in stock
• Greenlit by the SEC
• Transparency, efficiency, accessibility
Real World Examples
Assets and Tokenization
Benefit:
fstream.io
67. • Represent ownership of physical assets
on a blockchain
• Paired with smartphone and IoT
(Internet of Things) technologies
• Bridges gap between physical and digital
• Zero downtime, fault tolerant
Smart Property
Assets and Tokenization
Benefit:
fstream.io
68. Smart Property
Assets and Tokenization
User requests
access to Smart
Property
Send funds to address Smart Contract grants access
Smart
Property
acknowledges
Access granted!
fstream.io
70. • Large number of problems in current
electronic voting machines.
• Resistance to Internet based voting.
Digital Democracy
Beyond Assets
fstream.io
71. • DLTs offer a solution
• Votes can be represented as tokens
• Outcome conditions described in Smart
Contracts
Votes cast Outcom
e
Digital Democracy
Beyond Assets
Smart
Contract
fstream.io
72. • Identities and accounts benefit from
public-private key protection
• Additional precautions needed to tie in
physical ownership
–Out of band information and secrets
–Zero-knowledge proofs of identity
Securing Stakeholder IDs
Beyond Assets
fstream.io
73. Honduras Land Title Registry
• Records title transfers on the blockchain
• Stalled/Failed due to political climate
• Other countries are now starting to
consider pilot projects
Interesting Failures
Beyond Assets
fstream.io
74. •Scalability in the very long term
–A proposal to handle this with “sharding”
•Friction, especially from those who stand to
lose
–Mediators
–Rent seekers
–etc.
Other Problems
Beyond Assets
fstream.io
75. Other Problems
Beyond Assets
•Bleeding edge (immature)
•Standards (lack of)
•Bridging the gap between digital and
physical
•Existing complexity
fstream.io
76. Which begs the question...
Beyond Assets
Why blockchains?
fstream.io
77. Why design new a system that is:
● Secured with strong cryptography
● Can handle the settlement of payments
● Has zero downtime
● Is fault tolerant
● Is part of a secure network
● Can communicate securely with other
systems,
● Low maintenance requirements
Don’t reinvent the wheel!
Beyond Assets
… when there is blockchainfstream.io
proof-of-concept but hasn’t impacted us yet
fast moving : business models & technology
useful for calling out BS
Make sure you highlight we are talking specifically about Ethereum
ledger maintenance : immutability + validation
Should mention that henceforth we are talking about Ethereum, hence the logo!
Thank Gowling, summarize the outline of this section, foreshadow Dusan’s talk. Tie in reference to Baiju’s/Dusan’s points throughout
Highlight this is program
Pare this slide down and practice more
Have the potential to disintermediate the legal and financial fields, in particular, simplifying and automating routine and repetitive processes for which people currently pay lawyers and banks sizable fees to perform
Don’t linger too much on this slide. Just describe it and move on
Key: Same computation
On the computers in this network of distributed ledgers receive the code, they each come to an individual agreement on the results of the code execution (. The network would then update the distributed ledgers to record the execution of the contract, and then monitor for compliance with the terms of the smart contract. In this type of system, single party manipulation is overted because control over the execution of the smart contract is no longer possible because execution is no longer in the hands of a single party.
This about consensus
Don’t say tax. Say “cost” or “fee”
Can securely link it. Main point is cost. When creating smart contracts, need to be very cognizant of storage because of cost.
We have blockchains, and smart contracts, now what can we do with those?
Talk and phrase questions in a more natural way.
Tie back to accounts talked to by Bob.
Address is identity in the context of blockchain, but your ownership of that identity is bestowed by your knowledge of the private key.
Might want to grab some nuggets from https://github.com/ethereum/wiki/wiki/Glossary#economics
cryptocurrencies & securitization of general assets
no middle men
pros of doing this with t0
Slock.it is a company currently at the forefront of smart property.
Working on solutions for renting apartments, provisioning access to physical storage, or disable an asset.
Slock.it is a company currently at the forefront of smart property.
Working on solutions for renting apartments, provisioning access to physical storage, or disable an asset.