FIT5214: Blockchain
Lecture 12: Payment Channels Lecturer:
https://dowsley.net
Copyright By PowCoder代写 加微信 powcoder
Unit Structure
• Lecture 1: Introduction to Blockchain
• Lecture 2: Bitcoin
• Lecture 3: Ethereum and Smart Contracts
• Lecture 4: Proof-of-Work (PoW)
• Lecture 5: Attacks on Blockchains
• Lecture 6: Class Test/Alternatives to PoW
• Lecture 7: Proof-of-Stake (PoS)
• Lecture 8: Privacy
• Lecture 9: Byzantine Agreement
• Lecture 10: Algorand
• Lecture 11: Blockchain Network
• Lecture 12: Payment Channels
Unit Structure
• Lecture 1: Introduction to Blockchain
• Lecture 2: Bitcoin
• Lecture 3: Ethereum and Smart Contracts
• Lecture 4: Proof-of-Work (PoW)
• Lecture 5: Attacks on Blockchains
• Lecture 6: Class Test/Alternatives to PoW
• Lecture 7: Proof-of-Stake (PoS)
• Lecture 8: Privacy
• Lecture 9: Byzantine Agreement
• Lecture 10: Algorand
• Lecture 11: Blockchain Network
• Lecture 12: Payment Channels
Learning outcome:
Have basic understandings on how to use layer-2 protocols to scale blockchain.
I will also talk about the exam, give a recap and answer your questions.
Last Reminder
Your feedback is extremely important to us! You have a chance to provide:
(1) formal feedback about your learning experience
SETU: Go directly to https://monash.bluera.com/monash or follow the link from Moodle sidebar/Moodle page of Week 12
(2) your recognition to a teaching staff/unit
Teaching Award Nomination: https://www.intranet.monash/it/ education/ed-quality/awards
Problem – scalability
Bitcoin does not scale: it can only processe 7 tx per second
Improving scalability
Database partitioning e.g. sharding
New data structure
e.g. Directed Acyclic Graph
Off-chain payment e.g. Lightning network
Layers of blockchain
Layer 2: Off-chain Payment
Layer 1: Blockchain
Layer 0: Network
Layer-2 protocol
Alice and Bob can trade without having to go through the blockchain.
They only need to record a settlement (a summary of their transactions) on the chain.
Threshold signature
K out of N parties need to work together to create a valid signature.
Example application:
– Jointly owned Bitcoin account
– Two-factor authentication wallet – Backup of keys
Payment channel (basic idea)
Blockchain
locked Fund
Jiangshan: 5 BTC
Rafael: 3 BTC (signed by both Jiangshan and me)
Payment channel (basic idea)
Blockchain
Channel state
J: 5 BTC R: 3 BTC
locked Fund
Jiangshan: 5 BTC
Rafael: 3 BTC (signed by both Jiangshan and me)
Payment channel (basic idea)
Blockchain
Channel state
J: 5 BTC R: 3 BTC
State 1: Transfer 1 BTC to R (channel state signed by J)
locked Fund
Jiangshan: 5 BTC
Rafael: 3 BTC (signed by both Jiangshan and me)
Payment channel (basic idea)
Blockchain
Channel state
J: 5 BTC R: 3 BTC
J: 4 BTC R: 4 BTC
locked Fund
Jiangshan: 5 BTC
Rafael: 3 BTC (signed by both Jiangshan and me)
State 1: Transfer 1 BTC to R (channel state signed by J)
Payment channel (basic idea)
Blockchain
Channel state
J: 5 BTC R: 3 BTC
J: 4 BTC R: 4 BTC
locked Fund
Jiangshan: 5 BTC
Rafael: 3 BTC (signed by both Jiangshan and me)
State 1: Transfer 1 BTC to R (channel state signed by J) State 2: Transfer 0.5 BTC to R (channel state signed by J)
Payment channel (basic idea)
Blockchain
Channel state Channel state
J: 5 BTC J: 5 BTC
R: 3 BTC R: 3 BTC
J: 3.5 BTC R: 4.5 BTC
locked Fund
Jiangshan: 5 BTC
Rafael: 3 BTC (signed by both Jiangshan and me)
State 1: Transfer 1 BTC to R (channel state signed by J) State 2: Transfer 0.5 BTC to R (channel state signed by J)
Payment channel (basic idea)
Blockchain
Channel state Channel state
J: 5 BTC J: 5 BTC
R: 3 BTC R: 3 BTC
J: 3.5 BTC R: 4.5 BTC
locked Fund
Jiangshan: 5 BTC
Rafael: 3 BTC (signed by both Jiangshan and me)
Channel State 2 additionally signed by R
State 1: Transfer 1 BTC to R (channel state signed by J) State 2: Transfer 0.5 BTC to R (channel state signed by J)
Payment channel (basic idea)
Blockchain
Channel state Channel state
J: 5 BTC J: 5 BTC
R: 3 BTC R: 3 BTC
J: 3.5 BTC R: 4.5 BTC
locked Fund
Jiangshan: 5 BTC
Rafael: 3 BTC (signed by both Jiangshan and me)
Channel State 2 additionally signed by R
State 1: Transfer 1 BTC to R (channel state signed by J) State 2: Transfer 0.5 BTC to R (channel state signed by J)
Jiangshan: 3.5 BTC
Rafael: 4.5 BTC
(signed by both Jiangshan and me)
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
I want to send money to Maxime, but just once. I don’t want to open a channel as it requires operations on blockchain.
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
How to transfer the money without the need of trusting R or L?
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
Group discussion:
How to reduce the risk?
How to transfer the money without the need of trusting R or L?
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
I want to send 10 BTC to Maxime.
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
0.000001 BTC
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
0.000001 BTC
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
0.000001 BTC
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
Repeat it 10 Million times
0.000001 BTC
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
Repeat it 10 Million times
At most 0.000001 BTC is lost.
0.000001 BTC
Payment channel (basic idea)
Every transaction to a new recipient require a new channel, and it may only be used once.
Repeat it 10 Million times
At most 0.000001 BTC is lost.
This reduces the potential damage, but not efficient.
0.000001 BTC
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
Random r h=H(r)
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
r is the proof of successfully sent money to M.
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
10 BTC to R if you know r, within time t
r is the proof of successfully sent money to M.
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
10 BTC to R if you know r, within time t
10 BTC to L if you know r, within time t
r is the proof of successfully sent money to M.
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
10 BTC to R if you know r, within time t
10 BTC to M if you know r, within time t
10 BTC to L if you know r, within time t
r is the proof of successfully sent money to M.
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
10 BTC to R if you know r, within time t
10 BTC to M if you know r, within time t
Release r and get 10 BTC
10 BTC to L if you know r, within time t
r is the proof of successfully sent money to M.
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
Group discussion: What can go wrong?
10 BTC to R if you know r, within time t
10 BTC to M if you know r, within time t
10 BTC to L if you know r, within time t
r is the proof of successfully sent money to M.
Release r and get 10 BTC
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
10 BTC to R if you know r, within time t
10 BTC to M if you know r, within time t
Release r and get 10 BTC
Random r h=H(r)
10 BTC to L if you know r, within time t
r is the proof of successfully sent money to M.
M may release r right before the time t finishes. R and L have no time to get money!
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
10 BTC to R if you know r, within time t
10 BTC to M if you know r, within time t
Release r and get 10 BTC
Random r h=H(r)
10 BTC to L if you know r, within time t
r is the proof of successfully sent money to M.
M may release r right before the time t finishes. R and L have no time to get money!
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
Random r h=H(r)
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
r is the proof of successfully sent money to M.
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
10 BTC to R if you know r, within X blocks
r is the proof of successfully sent money to M.
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
10 BTC to R if you know r, within X blocks
10 BTC to L if you know r, within X’ blocks
r is the proof of successfully sent money to M.
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
10 BTC to R if you know r, within X blocks
10 BTC to M if you know r, within X’’ blocks
10 BTC to L if you know r, within X’ blocks
r is the proof of successfully sent money to M.
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
10 BTC to R if you know r, within X blocks
10 BTC to M if you know r, within X’’ blocks
Release r and get 10 BTC
10 BTC to L if you know r, within X’ blocks
r is the proof of successfully sent money to M.
Hash time locked contract
Every transaction to a new recipient require a new channel, and it may only be used once.
10 BTC to R if you know r, within X blocks
10 BTC to M if you know r, within X’’ blocks
Release r and get 10 BTC
10 BTC to L if you know r, within X’ blocks
r is the proof of successfully sent money to M.
Time of generating Min(X-X’, X’-X’’) blocks >> the time to run the protocol
★ 50marksintotal
★ 14questionsintotal
★ 10multiplechoicequestionswithmultipleanswers(3 marks each).
★ 4shortanswersquestions(5markseach). ★ CoveringtopicsfromWeek1toWeek12.
★ Multiplechoicequestionswithmultipleanswers:
Which of the following protocols use Proof-of-Work? • Algorand
• Ethereum
★ Multiplechoicequestionswithmultipleanswers:
Which of the following protocols use Proof-of-Work? • Algorand
• Ethereum
Every right answer that is selected will give positive marks, every wrong answer that is selected will deduct marks (overall the grade of each question is between 0.0 and 3.0).
★ Shortanswersquestions:
A standard ETH transfer requires a gas limit of _____
units of gas? (Just type the numerical answer)
• Lecture 1: Introduction to Blockchain • Basic concepts about blockchain
• Lecture 2: Bitcoin
• Crypto primitives (hash functions, birthday attack, Merkle trees, signature
• How Bitcoin works
• Hard/soft forks
• Blocks, transactions, fees
• Lecture 3: Ethereum and Smart Contracts
• Ethereum and smart contracts
• Ethereum consensus, uncle blocks, different rewards
• EVM, solidity, etc.
• Ether, Gas, transactions, etc.
• Different attacks
• Lecture 4: Proof-of-Work
• Bitcoin consensus
• Design flaws and simple attacks
• Formal properties of PoW consensus
• Lecture 5: Attacks on Blockchains
• Selfish mining attack
• Eclipse attack
• 51% attack
• Lecture 6: Alternatives to PoW • Proof-of-Elapsed-Time
• Proof-of-Capacity
• Proof-of-Personhood
• Lecture 7: Proof-of-Stake
• Basics of PoS
• Attacks on PoS
• Key-Evolving Signature Schemes
• Verifiable Random Function
• Lecture 8: Privacy
• Privacy properties
• Bitcoin privacy
• (Linkable) Ring signature
• CryptoNote/Monero
• 0-mixin attack
• Passive/active inference attacks
• Lecture 9: Byzantine Agreement
• Byzantine generals problem
• Different network conditions
• PBFT and quorum
• Lecture 10: Algorand
• Lecture 11: Blockchain Network
• How to discover new peers
• How to connect to new peers
• Different P2P protocols
• Lecture 12: Payment Channels
Questions?
Questions?
Best wishes in your exam!
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com