SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Downloaden Sie, um offline zu lesen
Intro. to Lightning Network
TM Lee, co-founder at
Github: @tmlee | Blockchain Developers Malaysia, Sep 6th, 2017
https://www.coingecko.com
Bitcoin Situation
Bitcoin
SegWit (Segregated Witness)
2MB Block (Later this year)
Bitcoin Cash
No SegWit
BIG Blocks
Hardfork
Scaling Debate
What is the Lightning Network (LN) ?
- Proposed by Joseph Poon & Thaddeus Dryja
(https://lightning.network/lightning-network-paper.pdf)
- Specifications for a Payment Channel on top of the bitcoin/litecoin blockchain
- Layer 2
- “Decentralized”, Trustless, High Volume, Instant Micropayment
Implementations of the LN Specs
=> Follow the BOLTs spec https://github.com/lightningnetwork/lightning-rfc
1. LND (GoLang) by Lightning
2. Eclair (Scala) by ACINQ
3. Lightning-C (C) by Blockstream
4. Thunder (Java) by Blockchain.com
Applications
1. Micropayments
○ Send satoshis with small transaction fees
2. Payment Streaming
○ Sending small amount of money frequently (ie. secondly, minutely, hourly)
○ Eg. pay per second when watching video on Youtube
3. Machine-to-Machine Payments
○ Bandwidth, data, storage, cpu times, data, can be traded
○ API endpoints usages
4. There could be more...
Bitcoin Transaction
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
MultiSig
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
CheckLockTimeVerify (CLTV)
- Specific time
- Eg. at Block N, specific date/time
Time-Lock
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
CheckSequenceVerify (CSV)
- Relative time
- N blocks from now, time from now
Typical on-chain bitcoin transaction
ALICE BOB
Transaction in a lightning network
ALICE BOB
Open
Channel TX
Payment Channel Remains Open….
microTX
10m฿
microTX
10m฿
microTX
10m฿
Close
Channel TX
1. Alice opens payment channel with
Bob
2. Bob opens payment channel with
Alice
3. Alice & Bob both stake 5 BTC each
to a multisig address
4. TX broadcast and mined into
Blockchain
5. Once the TX is confirmed, the
payment channel is now OPEN!
Open Payment Channel
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
1. Alice sends 1 BTC to Bob via payment
channel
2. Alice creates a TX
a. Input from Open TX Multisig
b. Outputs
i. 4 BTC to herself
ii. 6 BTC to a New Special
Multisig
c. Creates a key1
d. Alice signs the TX
3. Instead of broadcast, Alice hands TX
directly to Bob
4. Bob does the same, creates a TX
a. Input from Open TX Multisig
b. Outputs
i. 6 BTC to himself
ii. 4 BTC to a New Special
Multisig
c. Creates a key1
d. Bob signs the TX
5. Instead of broadcast, Bob hands TX
directly to Alice
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
1. Bob sends 1 BTC to Alice via payment
channel
2. Bob creates a new TX
a. Input from Open TX Multisig
b. Outputs
i. 5 BTC to himself
ii. 5 BTC to a New Special
Multisig
c. Creates a new key2
d. Bob signs the TX
3. Instead of broadcast, Bob hands TX
directly to Alice & key1
4. Alice does the same, creates a TX
a. Input from Open TX Multisig
b. Outputs
i. 5 BTC to herself
ii. 5 BTC to a New Special
Multisig
c. Creates a new key2
d. Alice signs the TX
5. Instead of broadcast, Alice hands TX
directly to Bob & key1
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
Microtransactions
Over Lightning...
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
Close Payment Channel (Usual Case)
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
#1 “Double Spend” Problem
tn
tn+1
Alice sends 1 BTC to Bob Bob sends 1 BTC to Alice
Bob buys
a Car from
Alice
Previous
Event
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
#1 “Double Spend” Problem
tn
tn+1
Alice sends 1 BTC to Bob Bob sends 1 BTC to Alice
Bob buys
a Car from
Alice
Previous
Event
Bob Signs
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
Time-locks
- Locks spending this UTXO to a later time
Bob Signs
Bob Signs
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
Bob Signs
Bob Signs
If Bob cheats...
Alice gets to sweep all the funds!
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
#2 Payment Network
ALICE CAROL
Open Channel...
ALICE BOB
Open Channel...
#2 Payment Network
ALICE BOB CAROL
Open Channel... Open Channel...
1. Alice wants to send 1 BTC to Carol via Bob
2. Alice pays 1 BTC to Bob, Bob pays 1 BTC
to Carol
Things that may go wrong here...
- Alice does not trust Bob or Carol
- Alice can pay Bob, Bob can choose not to
pay Carol
- Bob can pay Carol, but Carol can claim that
she did not receive the funds
#2 Payment Network Alice wants to send 1 BTC to Carol
1. Carol needs to create an Invoice consists of
a. Vrandom
& hash(Vrandom
)
b. Carol sends the hash(Vrandom
) to Alice
Alice tells Carol to receive 1 BTC from
Bob
2. Alice tells Bob that she will pay him 1 BTC if
he can produce hash(Vrandom
), Bob needs
Vrandom
3. Bob gives 1 BTC to Carol
Carol gives the Vrandom
to Bob
4. Bob gives the Vrandom
to Alice as a proof
Alice gives 1 BTC to Bob
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-creating-the-network-1465326903/
- Decentralized, Instant, Off-chain transfer of Bitcoin without Trust
- 1 On-Chain TX to Open Channel, 1 On-Chain TX to Close Channel
- Bitcoin can be transferred between parties, without broadcasting to network
- New TX replaces Old TX locally within the parties, as long as Channel is
Open
To Summarize...
ALICE BOB CAROL
Open Channel (on-chain)
Close Channel (on-chain)
Open Channel (on-chain)
Close Channel (on-chain)
Transfer Funds (off-chain) Transfer Funds (off-chain)
Things you can do as a developer
1. Spin up a Lightning Network node
2. Full node to watch blockchain for Lightning users
3. Build hardware/apps that transacts off-chain
4. Implement authentication & paywall using Lightning
5. Contribute to the Lightning implementations
○ Ie. LND, Eclair, Lightning-C, Thunder
6. List of resources https://github.com/tmlee/awesome-lightning-network
To Summarize...
➔ Is Lightning a new coin?
◆ No, LN is a play on the way transaction works; uses the bitcoin or litecoin blockchain
➔ Custodian Risk? Trust 3rd Party?
◆ No, LN is designed to not require that; using MultiSig & Hash Time Lock Contracts
➔ Will Lightning lock up my fund?
◆ Yes, you will not be able spend the fund on-chain while the channel is open
◆ No, you will be able to participate in the LN network and send zero confirmation tx
➔ Will there be a block explorer for Lightning?
◆ No, all tx records are stored locally between the 2 parties
◆ Blockchain only records the transaction to Open and Close a channel
➔ Is there mining required?
◆ No, LN transactions are instant
◆ When open/closing the channel, needs to be mined. In this case by bitcoin/litecoin miners
➔ Who collects the fees in the LN?
◆ Middlemen facilitating LN tx between parties
Appendix
Hash Time-Lock Contract
1. Bob generates Vrandom
and produces
2. Bob creates and signs a TX
a. Input
i. MultiSig
b. Outputs
i. 5 BTC to Bob (himself)
ii. 4 BTC to New Multisig
iii. 1 BTC to HTLC Multisig
3. Bob hands the TX to Alice
4. Alice creates and signs a TX
a. Input
i. MultiSig
b. Outputs
i. 4 BTC to Alice (herself)
ii. 5 BTC to New Multisig
iii. 1 BTC to HTLC Multisig
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-completing-the-puzzle-and-closing-the-channel-1466178980/
Time-locks
- Allows locking of spending UTXO to a later
point in time
- CheckLockTimeVerify (CLTV)
- Specific time
- At Block N, On Date
Hash Time-Lock Contract
Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-completing-the-puzzle-and-closing-the-channel-1466178980/
Source: https://lightning.network/lightning-network.pdf
Source: https://lightning.network/lightning-network.pdf
Source: https://lightning.network/lightning-network.pdf
Source: https://lightning.network/lightning-network.pdf
Source: https://lightning.network/lightning-network.pdf

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to BlockchainJordan Harris
 
Cryptocurrencies - A Serious Introduction
Cryptocurrencies - A Serious IntroductionCryptocurrencies - A Serious Introduction
Cryptocurrencies - A Serious IntroductionDrake Emko
 
Bitcoin Startup Malaysia
Bitcoin Startup MalaysiaBitcoin Startup Malaysia
Bitcoin Startup MalaysiaArsyan Ismail
 
Bitcoin A Peer-to-Peer Electronic Cash System
Bitcoin A Peer-to-Peer Electronic Cash SystemBitcoin A Peer-to-Peer Electronic Cash System
Bitcoin A Peer-to-Peer Electronic Cash SystemFlavio Vit
 
Crypto currencies presentation by Dr. Andre Gholam
Crypto currencies presentation by Dr. Andre GholamCrypto currencies presentation by Dr. Andre Gholam
Crypto currencies presentation by Dr. Andre GholamPMILebanonChapter
 
c13n - Lightning Network - Greek Bitcoin Meetup.pdf
c13n - Lightning Network - Greek Bitcoin Meetup.pdfc13n - Lightning Network - Greek Bitcoin Meetup.pdf
c13n - Lightning Network - Greek Bitcoin Meetup.pdfdimitrist
 
Crypto currency presentation
Crypto currency presentationCrypto currency presentation
Crypto currency presentationobaid r
 
An Overview on Bitcoin
An Overview  on Bitcoin         An Overview  on Bitcoin
An Overview on Bitcoin Touroxy
 
Bitcoin and Blockchain Technology Explained: Not just Cryptocurrencies, Econo...
Bitcoin and Blockchain Technology Explained: Not just Cryptocurrencies, Econo...Bitcoin and Blockchain Technology Explained: Not just Cryptocurrencies, Econo...
Bitcoin and Blockchain Technology Explained: Not just Cryptocurrencies, Econo...Melanie Swan
 
Global Future of Blockchain
Global Future of Blockchain Global Future of Blockchain
Global Future of Blockchain Melanie Swan
 

Was ist angesagt? (20)

Bitcoin
BitcoinBitcoin
Bitcoin
 
Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to Blockchain
 
BITCOIN EXPLAINED
BITCOIN EXPLAINEDBITCOIN EXPLAINED
BITCOIN EXPLAINED
 
Cryptocurrencies - A Serious Introduction
Cryptocurrencies - A Serious IntroductionCryptocurrencies - A Serious Introduction
Cryptocurrencies - A Serious Introduction
 
Bitcoin Startup Malaysia
Bitcoin Startup MalaysiaBitcoin Startup Malaysia
Bitcoin Startup Malaysia
 
Lightning Network
Lightning  NetworkLightning  Network
Lightning Network
 
What's cryptocurrency ?
What's cryptocurrency ?What's cryptocurrency ?
What's cryptocurrency ?
 
Bitcoin A Peer-to-Peer Electronic Cash System
Bitcoin A Peer-to-Peer Electronic Cash SystemBitcoin A Peer-to-Peer Electronic Cash System
Bitcoin A Peer-to-Peer Electronic Cash System
 
Crypto currencies presentation by Dr. Andre Gholam
Crypto currencies presentation by Dr. Andre GholamCrypto currencies presentation by Dr. Andre Gholam
Crypto currencies presentation by Dr. Andre Gholam
 
Introduction Bitcoin
Introduction BitcoinIntroduction Bitcoin
Introduction Bitcoin
 
Cryptocurrency
Cryptocurrency  Cryptocurrency
Cryptocurrency
 
c13n - Lightning Network - Greek Bitcoin Meetup.pdf
c13n - Lightning Network - Greek Bitcoin Meetup.pdfc13n - Lightning Network - Greek Bitcoin Meetup.pdf
c13n - Lightning Network - Greek Bitcoin Meetup.pdf
 
Crypto currency presentation
Crypto currency presentationCrypto currency presentation
Crypto currency presentation
 
Blockchain
BlockchainBlockchain
Blockchain
 
Blockchain concepts
Blockchain conceptsBlockchain concepts
Blockchain concepts
 
An Overview on Bitcoin
An Overview  on Bitcoin         An Overview  on Bitcoin
An Overview on Bitcoin
 
Blockchain
BlockchainBlockchain
Blockchain
 
Bitcoin and Blockchain Technology Explained: Not just Cryptocurrencies, Econo...
Bitcoin and Blockchain Technology Explained: Not just Cryptocurrencies, Econo...Bitcoin and Blockchain Technology Explained: Not just Cryptocurrencies, Econo...
Bitcoin and Blockchain Technology Explained: Not just Cryptocurrencies, Econo...
 
Global Future of Blockchain
Global Future of Blockchain Global Future of Blockchain
Global Future of Blockchain
 
Bitcoin
BitcoinBitcoin
Bitcoin
 

Ähnlich wie Intro. to Lightning Network (Bitcoin/Litecoin) - Blockchain Developers Malaysia

BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes ZwengBlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes ZwengBlockchainHub Graz
 
Technology of Lightning Network in Tel Aviv, Israel
Technology of Lightning Network in Tel Aviv, IsraelTechnology of Lightning Network in Tel Aviv, Israel
Technology of Lightning Network in Tel Aviv, Israeltakayaimai
 
Bitcoin - Understanding and Assessing potential Opportunities
Bitcoin - Understanding and Assessing potential OpportunitiesBitcoin - Understanding and Assessing potential Opportunities
Bitcoin - Understanding and Assessing potential OpportunitiesQuasarVentures
 
Cryptocurrency-Bitcoin
Cryptocurrency-BitcoinCryptocurrency-Bitcoin
Cryptocurrency-BitcoinSatwikaHotwani
 
The Bitcoin blockchain (en)
The Bitcoin blockchain (en)The Bitcoin blockchain (en)
The Bitcoin blockchain (en)Davide Carboni
 
Bitcoin and the Rise of the Block Chains
Bitcoin and the Rise of the Block ChainsBitcoin and the Rise of the Block Chains
Bitcoin and the Rise of the Block ChainsDallas Kennedy
 
Smart contracts and applications part I
Smart contracts and applications   part ISmart contracts and applications   part I
Smart contracts and applications part Ivpnmentor
 
Bitcoin and the future of cryptocurrency
Bitcoin and the future of cryptocurrencyBitcoin and the future of cryptocurrency
Bitcoin and the future of cryptocurrencyBen Hall
 
Blockchain for Business Yale School of Management Dr John Maheswaran
Blockchain for Business Yale School of Management Dr John MaheswaranBlockchain for Business Yale School of Management Dr John Maheswaran
Blockchain for Business Yale School of Management Dr John MaheswaranJohn M.
 
A primer on Bitcoin Technology
A primer on Bitcoin TechnologyA primer on Bitcoin Technology
A primer on Bitcoin TechnologySebin Benjamin
 
Every thing bitcoin in baby language
Every thing bitcoin in baby languageEvery thing bitcoin in baby language
Every thing bitcoin in baby languageOssai Nduka
 
Introduction into blockchains and cryptocurrencies
Introduction into blockchains and cryptocurrenciesIntroduction into blockchains and cryptocurrencies
Introduction into blockchains and cryptocurrenciesSergey Ivliev
 
All you ever needed to know on bitcoin and blockchain
All you ever needed to know on bitcoin and blockchainAll you ever needed to know on bitcoin and blockchain
All you ever needed to know on bitcoin and blockchainMarco Hauff
 
Introduction to Blockchains
Introduction to BlockchainsIntroduction to Blockchains
Introduction to BlockchainsRamesh Nair
 
Lightning Network Economics: Channels
Lightning Network Economics: ChannelsLightning Network Economics: Channels
Lightning Network Economics: Channelsguasoni
 
Bitcoin : A fierce decentralized crypto currency - Report
Bitcoin : A fierce decentralized crypto currency - ReportBitcoin : A fierce decentralized crypto currency - Report
Bitcoin : A fierce decentralized crypto currency - ReportShivek Khurana
 
Bitcoin in general - presentation
Bitcoin in general - presentationBitcoin in general - presentation
Bitcoin in general - presentationMichal Cisárik
 
Blockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchainsBlockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchainsBrett Colbert
 

Ähnlich wie Intro. to Lightning Network (Bitcoin/Litecoin) - Blockchain Developers Malaysia (20)

BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes ZwengBlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
 
Technology of Lightning Network in Tel Aviv, Israel
Technology of Lightning Network in Tel Aviv, IsraelTechnology of Lightning Network in Tel Aviv, Israel
Technology of Lightning Network in Tel Aviv, Israel
 
Bitcoin - Understanding and Assessing potential Opportunities
Bitcoin - Understanding and Assessing potential OpportunitiesBitcoin - Understanding and Assessing potential Opportunities
Bitcoin - Understanding and Assessing potential Opportunities
 
Cryptocurrency-Bitcoin
Cryptocurrency-BitcoinCryptocurrency-Bitcoin
Cryptocurrency-Bitcoin
 
The Bitcoin blockchain (en)
The Bitcoin blockchain (en)The Bitcoin blockchain (en)
The Bitcoin blockchain (en)
 
Bitcoin and the Rise of the Block Chains
Bitcoin and the Rise of the Block ChainsBitcoin and the Rise of the Block Chains
Bitcoin and the Rise of the Block Chains
 
Smart contracts and applications part I
Smart contracts and applications   part ISmart contracts and applications   part I
Smart contracts and applications part I
 
Study on Bitcoin
Study on Bitcoin Study on Bitcoin
Study on Bitcoin
 
Bitcoin and the future of cryptocurrency
Bitcoin and the future of cryptocurrencyBitcoin and the future of cryptocurrency
Bitcoin and the future of cryptocurrency
 
Blockchain for Business Yale School of Management Dr John Maheswaran
Blockchain for Business Yale School of Management Dr John MaheswaranBlockchain for Business Yale School of Management Dr John Maheswaran
Blockchain for Business Yale School of Management Dr John Maheswaran
 
A primer on Bitcoin Technology
A primer on Bitcoin TechnologyA primer on Bitcoin Technology
A primer on Bitcoin Technology
 
Every thing bitcoin in baby language
Every thing bitcoin in baby languageEvery thing bitcoin in baby language
Every thing bitcoin in baby language
 
Introduction into blockchains and cryptocurrencies
Introduction into blockchains and cryptocurrenciesIntroduction into blockchains and cryptocurrencies
Introduction into blockchains and cryptocurrencies
 
All you ever needed to know on bitcoin and blockchain
All you ever needed to know on bitcoin and blockchainAll you ever needed to know on bitcoin and blockchain
All you ever needed to know on bitcoin and blockchain
 
Bitcoin
BitcoinBitcoin
Bitcoin
 
Introduction to Blockchains
Introduction to BlockchainsIntroduction to Blockchains
Introduction to Blockchains
 
Lightning Network Economics: Channels
Lightning Network Economics: ChannelsLightning Network Economics: Channels
Lightning Network Economics: Channels
 
Bitcoin : A fierce decentralized crypto currency - Report
Bitcoin : A fierce decentralized crypto currency - ReportBitcoin : A fierce decentralized crypto currency - Report
Bitcoin : A fierce decentralized crypto currency - Report
 
Bitcoin in general - presentation
Bitcoin in general - presentationBitcoin in general - presentation
Bitcoin in general - presentation
 
Blockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchainsBlockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchains
 

Kürzlich hochgeladen

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 

Kürzlich hochgeladen (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 

Intro. to Lightning Network (Bitcoin/Litecoin) - Blockchain Developers Malaysia

  • 1. Intro. to Lightning Network TM Lee, co-founder at Github: @tmlee | Blockchain Developers Malaysia, Sep 6th, 2017
  • 3. Bitcoin Situation Bitcoin SegWit (Segregated Witness) 2MB Block (Later this year) Bitcoin Cash No SegWit BIG Blocks Hardfork Scaling Debate
  • 4. What is the Lightning Network (LN) ? - Proposed by Joseph Poon & Thaddeus Dryja (https://lightning.network/lightning-network-paper.pdf) - Specifications for a Payment Channel on top of the bitcoin/litecoin blockchain - Layer 2 - “Decentralized”, Trustless, High Volume, Instant Micropayment
  • 5. Implementations of the LN Specs => Follow the BOLTs spec https://github.com/lightningnetwork/lightning-rfc 1. LND (GoLang) by Lightning 2. Eclair (Scala) by ACINQ 3. Lightning-C (C) by Blockstream 4. Thunder (Java) by Blockchain.com
  • 6. Applications 1. Micropayments ○ Send satoshis with small transaction fees 2. Payment Streaming ○ Sending small amount of money frequently (ie. secondly, minutely, hourly) ○ Eg. pay per second when watching video on Youtube 3. Machine-to-Machine Payments ○ Bandwidth, data, storage, cpu times, data, can be traded ○ API endpoints usages 4. There could be more...
  • 9. CheckLockTimeVerify (CLTV) - Specific time - Eg. at Block N, specific date/time Time-Lock Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/ CheckSequenceVerify (CSV) - Relative time - N blocks from now, time from now
  • 10. Typical on-chain bitcoin transaction ALICE BOB
  • 11. Transaction in a lightning network ALICE BOB Open Channel TX Payment Channel Remains Open…. microTX 10m฿ microTX 10m฿ microTX 10m฿ Close Channel TX
  • 12. 1. Alice opens payment channel with Bob 2. Bob opens payment channel with Alice 3. Alice & Bob both stake 5 BTC each to a multisig address 4. TX broadcast and mined into Blockchain 5. Once the TX is confirmed, the payment channel is now OPEN! Open Payment Channel Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
  • 13. 1. Alice sends 1 BTC to Bob via payment channel 2. Alice creates a TX a. Input from Open TX Multisig b. Outputs i. 4 BTC to herself ii. 6 BTC to a New Special Multisig c. Creates a key1 d. Alice signs the TX 3. Instead of broadcast, Alice hands TX directly to Bob 4. Bob does the same, creates a TX a. Input from Open TX Multisig b. Outputs i. 6 BTC to himself ii. 4 BTC to a New Special Multisig c. Creates a key1 d. Bob signs the TX 5. Instead of broadcast, Bob hands TX directly to Alice Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
  • 14. 1. Bob sends 1 BTC to Alice via payment channel 2. Bob creates a new TX a. Input from Open TX Multisig b. Outputs i. 5 BTC to himself ii. 5 BTC to a New Special Multisig c. Creates a new key2 d. Bob signs the TX 3. Instead of broadcast, Bob hands TX directly to Alice & key1 4. Alice does the same, creates a TX a. Input from Open TX Multisig b. Outputs i. 5 BTC to herself ii. 5 BTC to a New Special Multisig c. Creates a new key2 d. Alice signs the TX 5. Instead of broadcast, Alice hands TX directly to Bob & key1 Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
  • 16. Close Payment Channel (Usual Case) Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
  • 17. #1 “Double Spend” Problem tn tn+1 Alice sends 1 BTC to Bob Bob sends 1 BTC to Alice Bob buys a Car from Alice Previous Event Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
  • 18. #1 “Double Spend” Problem tn tn+1 Alice sends 1 BTC to Bob Bob sends 1 BTC to Alice Bob buys a Car from Alice Previous Event Bob Signs Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
  • 19. Time-locks - Locks spending this UTXO to a later time Bob Signs Bob Signs Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
  • 20. Bob Signs Bob Signs If Bob cheats... Alice gets to sweep all the funds! Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791/
  • 21. #2 Payment Network ALICE CAROL Open Channel... ALICE BOB Open Channel...
  • 22. #2 Payment Network ALICE BOB CAROL Open Channel... Open Channel... 1. Alice wants to send 1 BTC to Carol via Bob 2. Alice pays 1 BTC to Bob, Bob pays 1 BTC to Carol Things that may go wrong here... - Alice does not trust Bob or Carol - Alice can pay Bob, Bob can choose not to pay Carol - Bob can pay Carol, but Carol can claim that she did not receive the funds
  • 23. #2 Payment Network Alice wants to send 1 BTC to Carol 1. Carol needs to create an Invoice consists of a. Vrandom & hash(Vrandom ) b. Carol sends the hash(Vrandom ) to Alice Alice tells Carol to receive 1 BTC from Bob 2. Alice tells Bob that she will pay him 1 BTC if he can produce hash(Vrandom ), Bob needs Vrandom 3. Bob gives 1 BTC to Carol Carol gives the Vrandom to Bob 4. Bob gives the Vrandom to Alice as a proof Alice gives 1 BTC to Bob Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-creating-the-network-1465326903/
  • 24. - Decentralized, Instant, Off-chain transfer of Bitcoin without Trust - 1 On-Chain TX to Open Channel, 1 On-Chain TX to Close Channel - Bitcoin can be transferred between parties, without broadcasting to network - New TX replaces Old TX locally within the parties, as long as Channel is Open To Summarize... ALICE BOB CAROL Open Channel (on-chain) Close Channel (on-chain) Open Channel (on-chain) Close Channel (on-chain) Transfer Funds (off-chain) Transfer Funds (off-chain)
  • 25. Things you can do as a developer 1. Spin up a Lightning Network node 2. Full node to watch blockchain for Lightning users 3. Build hardware/apps that transacts off-chain 4. Implement authentication & paywall using Lightning 5. Contribute to the Lightning implementations ○ Ie. LND, Eclair, Lightning-C, Thunder 6. List of resources https://github.com/tmlee/awesome-lightning-network
  • 26. To Summarize... ➔ Is Lightning a new coin? ◆ No, LN is a play on the way transaction works; uses the bitcoin or litecoin blockchain ➔ Custodian Risk? Trust 3rd Party? ◆ No, LN is designed to not require that; using MultiSig & Hash Time Lock Contracts ➔ Will Lightning lock up my fund? ◆ Yes, you will not be able spend the fund on-chain while the channel is open ◆ No, you will be able to participate in the LN network and send zero confirmation tx ➔ Will there be a block explorer for Lightning? ◆ No, all tx records are stored locally between the 2 parties ◆ Blockchain only records the transaction to Open and Close a channel ➔ Is there mining required? ◆ No, LN transactions are instant ◆ When open/closing the channel, needs to be mined. In this case by bitcoin/litecoin miners ➔ Who collects the fees in the LN? ◆ Middlemen facilitating LN tx between parties
  • 28. Hash Time-Lock Contract 1. Bob generates Vrandom and produces 2. Bob creates and signs a TX a. Input i. MultiSig b. Outputs i. 5 BTC to Bob (himself) ii. 4 BTC to New Multisig iii. 1 BTC to HTLC Multisig 3. Bob hands the TX to Alice 4. Alice creates and signs a TX a. Input i. MultiSig b. Outputs i. 4 BTC to Alice (herself) ii. 5 BTC to New Multisig iii. 1 BTC to HTLC Multisig Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-completing-the-puzzle-and-closing-the-channel-1466178980/
  • 29. Time-locks - Allows locking of spending UTXO to a later point in time - CheckLockTimeVerify (CLTV) - Specific time - At Block N, On Date Hash Time-Lock Contract Source: https://bitcoinmagazine.com/articles/understanding-the-lightning-network-part-completing-the-puzzle-and-closing-the-channel-1466178980/