SlideShare una empresa de Scribd logo
1 de 32
Descargar para leer sin conexión
Ride the Lightning
Intro to Lightning Network
Scaling Problems
Scaling options
● On-chain
○ Bigger blocks
○ Sidechains
○ Magic tricks (SegWit)
○ Sharding
● Off-chain
○ LN (in a way LN is a sidechain with only 2 participants)
State channels
● Multi-party record of a specific state
● Off-chain
● Private
● Pre-determined (between the parties) life-span
● Most often two-party
Payment Channels
● 2-party state channels, but for
balance (money)
● Another way: 2 party ledger
Time Alice Bob
T0 10 0
T1 9 1
T2 7 3
T3 8 2
Key LN enablers
● Payment channels (LN is a network of Payment channels)
● TOR
● HTLC
History
● Joseph Poon & Thaddeus Dryja
● Original paper in Feb-2015
● Updated since https://lightning.network/lightning-network-paper.pdf
● Transformed into BOLT RFC
https://github.com/lightningnetwork/lightning-rfc
● All implementations follow the BOLT specs
Current status
BOLT
1. Messaging
2. Peer-protocol
3. Transactions
4. Onion routing
5. On-chain transactions
7. Routing gossip (Node/channel
discovery)
8. Encrypted and Authenticated
Transport
9. Assigned feature flags
10. DNS bootstrap
11. Payment encoding
Key LN concepts
● Peer
● Channel
● Funding Tx
● Closing Tx
○ Mutual close
○ Unilateral close
● Hops
● Preimage (and ZKCP)
● Oh ...and msat
Anatomy
Funding TX Closing TX
Off-chain
On-chain
Time
How it works
● Each channel balance change means a new set of transactions are
exchanged but not broadcasted (the whole point of being off-chain)
● Old transactions are invalidated (how they do that: keys are provided to the
other party)
● Unilateral close is CSV guarded (locked for 144* blocks)
● Bad behaviour (publishing an old transaction) is punished (cheater is
wiped out)
● The balance changes can go forever (there’s a theoretical limit of
281,474,976,710,655 changes, though)
Payment Routing
● Routing schema is based on the Sphinx
● Path is determined / calculated by the sender
○ Creates a shared secret (using ECDH) for each intermediate node, based on pubkey(ID)
● Different least cost path algorithms (e.g. lnd - Dijkstra, c-lightning
Bellman-Ford)
● Nodes forwarding the message can verify the integrity, but can’t
○ learn which other nodes, except for previous and next, are part of the route
○ learn the length of the route
○ or learn their position in the route
● Max length is 20 hops.
Good to know
● Channel balance cannot decrease below a certain threshold on each end
(both nodes need to have SITG)
● Upon opening a channel the balance tends* to be on one side
○ Thus opener MUST pay before being able to be paid
● Operating a LN node can bring profits (unlike operating a “classic” bitcoin
node), by routing payments for others base_fee + fee%
Node Implementations
● LND (in Go) by Lightning Labs
● C-Lightning (in C) by Blockstream
● Eclair (in Scala) by ACINQ
● Lit (in Go) by MIT DCI
● Ptarmigan (in C++) by Nayuta
● Plasma (in node.js) by bcoin
● Thunder (in Java) by Blockchain.com
Wallet implementations
● Mobile
○ Eclair (by Acinq)
○ Lightning Wallet (by A. Kumaigorodski)
○ CoinClip (by Valcour Games)
● Desktop
○ Zap (by Jack Mallers)
○ Lightning App (by Lightning Labs)
○ Presto
● Web
○ Htlc.me (by Alex Bosworth)
● And … CLI for the brave: lncli, lightning-cli, eclair
Ecosystem - Explorers
● Mainnet
○ #recksplorer (https://github.com/chemicstry/recksplorer ) @
https://lnmainnet.gaben.win/
○ https://p2sh.info/dashboard/db/lightning-network (not really node graph, but network
info)
○ https://1ml.com/
○ https://bl.ocks.org/tyzbit/d1c83732d2767bb955125d41f5921888 (VR ready!)
○ https://bitcoinexchangerate.org/lightning
○ https://graph.lndexplorer.com/
● Testnet
○ https://1ml.com/testnet
○ https://explorer.acinq.co/
DevTools & ready made apps
● Lightning-Charge https://github.com/ElementsProject/lightning-charge
(REST API for c-lightning)
● LN-Service (REST API for lnd) https://github.com/alexbosworth/ln-service
● https://github.com/cdecker/kugelblitz (UI for c-lightning)
● LApps
○ Woocommerce LN plugin
https://github.com/ElementsProject/woocommerce-gateway-lightning
○ Jukebox https://github.com/ElementsProject/lightning-jukebox
● Directories of tools and apps
○ https://github.com/bcongdon/awesome-lightning-network
○ https://gist.github.com/bretton/798ec38165ffabc719d91e0f4f67552d
Use cases
● Instant transactions
● Exchange Arbitration
● Micropayments
● Financial Escrow and Smart Contracts
● Cross chain payments and atomic swaps (both chains need to support
HTLC)
Enhancements & Add-ons
Atomic Multi Path
A
B
D
C
E
F
2
3
4
3 4
3
AMP
● Split big payment into smaller ones
● Can only be settled all-or-none
● It’s independent of the intermediate nodes, only the sender and the
received need to be aware
● Further enhance privacy
AMP
● Implements a basic secret-share mechanism
● Employs Extra Onion Blobs
Splice-in / Splice-out
● Splicing - modify the live balance of the channel
○ Send tx from channel balance to regular BTC address
○ Top-up channel balance
● Works by adding a UTXO or splitting the funding TX into 2 UTXO
Watch Towers
● Let other nodes claim funds on your behalf
● Will (most likely) mean additional fees
● Implementation proposal using Encrypted Blobs
○ Use half of the current commitment txid as hint and the the other half as encryption key
○ Assemble revocation tx, encrypt with key and give to WT
● Comes with privacy implications
Submarine swaps
● Main idea: swap liquidity in LN for ‘classical’ BTC liquidity
● Send regular BTC tx to pay LN invoice (e.g. no LN wallet)
● Or the other way around (pay LN, receive BTC)
● Might come useful to balance channels (splicing notwithstanding)
● See in this respect
○ https://lightningconductor.net/
○ https://submarineswaps.org/
Other considerations
● Since some of those use constructions based on LN, they could be
considered L3
● BOLT’s are (largely) coin neutral => any (more-accurate: most) blockchain
that supports time-locked contracts can implement it
○ LTC
○ ETH (Raiden/µRaiden)
○ ZCash (see proposed BOLT https://blog.z.cash/bolt-private-payment-channels/)
● To watch: Lumino and LTCP on RSK (BTC sidechain with EVM)
Timelocks primer
Time Lock Location Targeting Metric Type Signal
nLocktime Txn Absolute Blocks/Seconds Seconds if >=500000000
nSequence Input Relative Blocks/Seconds Seconds if type flag set
OP_CLTV Script Absolute Blocks/Seconds Seconds if >=500000000
OP_CSV Script Relative Blocks/Seconds Seconds if type flag set
Ride the lightning
● Second album by Metallica
● Released Jul 27, 1984
● 8 Tracks
….

Más contenido relacionado

La actualidad más candente

Blockchain and Cryptocurrencies
Blockchain and CryptocurrenciesBlockchain and Cryptocurrencies
Blockchain and CryptocurrenciesnimeshQ
 
Bitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & BlockchainBitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & BlockchainJitendra Chittoda
 
Blockchain sharding
Blockchain shardingBlockchain sharding
Blockchain sharding제호 송
 
Hibernate performance tuning
Hibernate performance tuningHibernate performance tuning
Hibernate performance tuningMikalai Alimenkou
 
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018Svetlin Nakov
 
Basics of Bitcoin & Mining
Basics of Bitcoin & MiningBasics of Bitcoin & Mining
Basics of Bitcoin & MiningAkhilesh Arora
 
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...Simplilearn
 
Basic introduction in blockchain, smart contracts, permissioned ledgers
Basic introduction in blockchain, smart contracts, permissioned ledgersBasic introduction in blockchain, smart contracts, permissioned ledgers
Basic introduction in blockchain, smart contracts, permissioned ledgersKoen Vingerhoets
 
Hyperledger Overview - 20181024
Hyperledger Overview - 20181024Hyperledger Overview - 20181024
Hyperledger Overview - 20181024Arnaud Le Hors
 
Understanding private blockchains
Understanding private blockchainsUnderstanding private blockchains
Understanding private blockchainsCoin Sciences Ltd
 
Crypto Wallet Types Explained
Crypto Wallet Types ExplainedCrypto Wallet Types Explained
Crypto Wallet Types Explained101 Blockchains
 
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsUnderstanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsGautam Anand
 
Introduction to Lightning Network
Introduction to Lightning NetworkIntroduction to Lightning Network
Introduction to Lightning NetworkAlan Carbery
 
Bitcoin Final Year Seminar Report
Bitcoin Final Year Seminar ReportBitcoin Final Year Seminar Report
Bitcoin Final Year Seminar ReportShantanu Singh
 
Understanding Cryptocurrency
Understanding CryptocurrencyUnderstanding Cryptocurrency
Understanding CryptocurrencyKapil Gupta
 
Ethereum Mining How To
Ethereum Mining How ToEthereum Mining How To
Ethereum Mining How ToNugroho Gito
 
CBDC (Central Bank Digital Currencies) Report
CBDC (Central Bank Digital Currencies) Report CBDC (Central Bank Digital Currencies) Report
CBDC (Central Bank Digital Currencies) Report Rein Mahatma
 

La actualidad más candente (20)

Cryptocurrency
CryptocurrencyCryptocurrency
Cryptocurrency
 
Blockchain and Cryptocurrencies
Blockchain and CryptocurrenciesBlockchain and Cryptocurrencies
Blockchain and Cryptocurrencies
 
All about Bitcoins!
All about Bitcoins!All about Bitcoins!
All about Bitcoins!
 
Bitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & BlockchainBitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & Blockchain
 
Blockchain sharding
Blockchain shardingBlockchain sharding
Blockchain sharding
 
Hibernate performance tuning
Hibernate performance tuningHibernate performance tuning
Hibernate performance tuning
 
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
 
Basics of Bitcoin & Mining
Basics of Bitcoin & MiningBasics of Bitcoin & Mining
Basics of Bitcoin & Mining
 
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
 
Basic introduction in blockchain, smart contracts, permissioned ledgers
Basic introduction in blockchain, smart contracts, permissioned ledgersBasic introduction in blockchain, smart contracts, permissioned ledgers
Basic introduction in blockchain, smart contracts, permissioned ledgers
 
Hyperledger Overview - 20181024
Hyperledger Overview - 20181024Hyperledger Overview - 20181024
Hyperledger Overview - 20181024
 
Understanding private blockchains
Understanding private blockchainsUnderstanding private blockchains
Understanding private blockchains
 
Crypto Wallet Types Explained
Crypto Wallet Types ExplainedCrypto Wallet Types Explained
Crypto Wallet Types Explained
 
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsUnderstanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
 
Introduction to Lightning Network
Introduction to Lightning NetworkIntroduction to Lightning Network
Introduction to Lightning Network
 
Bitcoin Final Year Seminar Report
Bitcoin Final Year Seminar ReportBitcoin Final Year Seminar Report
Bitcoin Final Year Seminar Report
 
Understanding Cryptocurrency
Understanding CryptocurrencyUnderstanding Cryptocurrency
Understanding Cryptocurrency
 
Ethereum Mining How To
Ethereum Mining How ToEthereum Mining How To
Ethereum Mining How To
 
CBDC (Central Bank Digital Currencies) Report
CBDC (Central Bank Digital Currencies) Report CBDC (Central Bank Digital Currencies) Report
CBDC (Central Bank Digital Currencies) Report
 
BITCOIN
BITCOINBITCOIN
BITCOIN
 

Similar a Lightning Network

Blockchan For Developers
Blockchan For DevelopersBlockchan For Developers
Blockchan For DevelopersAlex Chepurnoy
 
The Emergent Layer 2
The Emergent Layer 2The Emergent Layer 2
The Emergent Layer 2Chris Priest
 
Bitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodGalin Dinkov
 
Crypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroCrypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroTal Shmueli
 
Fredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slidesFredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slidesAlex Akselrod
 
Blockchain For Developers
Blockchain For DevelopersBlockchain For Developers
Blockchain For DevelopersAlex Chepurnoy
 
Intro to Blockchain Slides
Intro to Blockchain SlidesIntro to Blockchain Slides
Intro to Blockchain SlidesShannon Wells
 
Introduction to Bitcoin for programmers
Introduction to Bitcoin for programmersIntroduction to Bitcoin for programmers
Introduction to Bitcoin for programmersWojciech Langiewicz
 
State of Ethereum, and Mining
State of Ethereum, and MiningState of Ethereum, and Mining
State of Ethereum, and MiningMediabistro
 
Some Open Problems in Blockchains
Some Open Problems in BlockchainsSome Open Problems in Blockchains
Some Open Problems in BlockchainsAlex Chepurnoy
 
Network LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikNetwork LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikGLC Networks
 
Bitcoin - Beyond the basics
Bitcoin - Beyond the basicsBitcoin - Beyond the basics
Bitcoin - Beyond the basicsChris DeRose
 
Brief history of blockchain
Brief history of blockchainBrief history of blockchain
Brief history of blockchainBlockChainJam
 
Using Mikrotik Switch Features to Improve Your Network
Using Mikrotik Switch Features to Improve Your Network Using Mikrotik Switch Features to Improve Your Network
Using Mikrotik Switch Features to Improve Your Network GLC Networks
 
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)Alex Chepurnoy
 
Blockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationBlockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationPaperchain
 
Zero Cost Onboarding to Lightning Network through exchanges
Zero Cost Onboarding to Lightning Network through exchangesZero Cost Onboarding to Lightning Network through exchanges
Zero Cost Onboarding to Lightning Network through exchangesJonathan Underwood
 
Total privacy of transactions, Mimblewimble and Grin
Total privacy of transactions, Mimblewimble and GrinTotal privacy of transactions, Mimblewimble and Grin
Total privacy of transactions, Mimblewimble and GrinEugene Pavlenko
 
Mikrotik Bridge Deep Dive
Mikrotik Bridge Deep DiveMikrotik Bridge Deep Dive
Mikrotik Bridge Deep DiveGLC Networks
 

Similar a Lightning Network (20)

Blockchan For Developers
Blockchan For DevelopersBlockchan For Developers
Blockchan For Developers
 
The Emergent Layer 2
The Emergent Layer 2The Emergent Layer 2
The Emergent Layer 2
 
Ethereum overview
Ethereum overviewEthereum overview
Ethereum overview
 
Bitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the Hood
 
Crypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroCrypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies Intro
 
Fredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slidesFredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slides
 
Blockchain For Developers
Blockchain For DevelopersBlockchain For Developers
Blockchain For Developers
 
Intro to Blockchain Slides
Intro to Blockchain SlidesIntro to Blockchain Slides
Intro to Blockchain Slides
 
Introduction to Bitcoin for programmers
Introduction to Bitcoin for programmersIntroduction to Bitcoin for programmers
Introduction to Bitcoin for programmers
 
State of Ethereum, and Mining
State of Ethereum, and MiningState of Ethereum, and Mining
State of Ethereum, and Mining
 
Some Open Problems in Blockchains
Some Open Problems in BlockchainsSome Open Problems in Blockchains
Some Open Problems in Blockchains
 
Network LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with MikrotikNetwork LACP/Bonding/Teaming with Mikrotik
Network LACP/Bonding/Teaming with Mikrotik
 
Bitcoin - Beyond the basics
Bitcoin - Beyond the basicsBitcoin - Beyond the basics
Bitcoin - Beyond the basics
 
Brief history of blockchain
Brief history of blockchainBrief history of blockchain
Brief history of blockchain
 
Using Mikrotik Switch Features to Improve Your Network
Using Mikrotik Switch Features to Improve Your Network Using Mikrotik Switch Features to Improve Your Network
Using Mikrotik Switch Features to Improve Your Network
 
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
 
Blockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationBlockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentation
 
Zero Cost Onboarding to Lightning Network through exchanges
Zero Cost Onboarding to Lightning Network through exchangesZero Cost Onboarding to Lightning Network through exchanges
Zero Cost Onboarding to Lightning Network through exchanges
 
Total privacy of transactions, Mimblewimble and Grin
Total privacy of transactions, Mimblewimble and GrinTotal privacy of transactions, Mimblewimble and Grin
Total privacy of transactions, Mimblewimble and Grin
 
Mikrotik Bridge Deep Dive
Mikrotik Bridge Deep DiveMikrotik Bridge Deep Dive
Mikrotik Bridge Deep Dive
 

Más de Felix Crisan

Big data uservices
Big data uservicesBig data uservices
Big data uservicesFelix Crisan
 
BigData in BlockChains
BigData in BlockChainsBigData in BlockChains
BigData in BlockChainsFelix Crisan
 
Smart contracts using web3.js
Smart contracts using web3.jsSmart contracts using web3.js
Smart contracts using web3.jsFelix Crisan
 
Smart contracts in Solidity
Smart contracts in SoliditySmart contracts in Solidity
Smart contracts in SolidityFelix Crisan
 
Big(data) in block(chains)
Big(data) in block(chains)Big(data) in block(chains)
Big(data) in block(chains)Felix Crisan
 
Enablers for o commerce
Enablers for o commerceEnablers for o commerce
Enablers for o commerceFelix Crisan
 
Deconstructing Lambda architectures
Deconstructing Lambda architecturesDeconstructing Lambda architectures
Deconstructing Lambda architecturesFelix Crisan
 
Presentation for the first Bucharest Big data meetup
Presentation for the first Bucharest Big data meetupPresentation for the first Bucharest Big data meetup
Presentation for the first Bucharest Big data meetupFelix Crisan
 
Data analysis with Pandas and Spark
Data analysis with Pandas and SparkData analysis with Pandas and Spark
Data analysis with Pandas and SparkFelix Crisan
 

Más de Felix Crisan (15)

Big data uservices
Big data uservicesBig data uservices
Big data uservices
 
Bitcoin:Next
Bitcoin:NextBitcoin:Next
Bitcoin:Next
 
BigData in BlockChains
BigData in BlockChainsBigData in BlockChains
BigData in BlockChains
 
Smart contracts using web3.js
Smart contracts using web3.jsSmart contracts using web3.js
Smart contracts using web3.js
 
Smart contracts in Solidity
Smart contracts in SoliditySmart contracts in Solidity
Smart contracts in Solidity
 
Mashing the data
Mashing the dataMashing the data
Mashing the data
 
Big(data) in block(chains)
Big(data) in block(chains)Big(data) in block(chains)
Big(data) in block(chains)
 
Enablers for o commerce
Enablers for o commerceEnablers for o commerce
Enablers for o commerce
 
mcommad
mcommadmcommad
mcommad
 
NoSQL solutions
NoSQL solutionsNoSQL solutions
NoSQL solutions
 
Deconstructing Lambda architectures
Deconstructing Lambda architecturesDeconstructing Lambda architectures
Deconstructing Lambda architectures
 
402 @ Mobile next
402 @ Mobile next402 @ Mobile next
402 @ Mobile next
 
Presentation for the first Bucharest Big data meetup
Presentation for the first Bucharest Big data meetupPresentation for the first Bucharest Big data meetup
Presentation for the first Bucharest Big data meetup
 
Data analysis with Pandas and Spark
Data analysis with Pandas and SparkData analysis with Pandas and Spark
Data analysis with Pandas and Spark
 
TCP/IP of money
TCP/IP of moneyTCP/IP of money
TCP/IP of money
 

Último

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Último (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Lightning Network

  • 2.
  • 5. Scaling options ● On-chain ○ Bigger blocks ○ Sidechains ○ Magic tricks (SegWit) ○ Sharding ● Off-chain ○ LN (in a way LN is a sidechain with only 2 participants)
  • 6. State channels ● Multi-party record of a specific state ● Off-chain ● Private ● Pre-determined (between the parties) life-span ● Most often two-party
  • 7. Payment Channels ● 2-party state channels, but for balance (money) ● Another way: 2 party ledger Time Alice Bob T0 10 0 T1 9 1 T2 7 3 T3 8 2
  • 8. Key LN enablers ● Payment channels (LN is a network of Payment channels) ● TOR ● HTLC
  • 9. History ● Joseph Poon & Thaddeus Dryja ● Original paper in Feb-2015 ● Updated since https://lightning.network/lightning-network-paper.pdf ● Transformed into BOLT RFC https://github.com/lightningnetwork/lightning-rfc ● All implementations follow the BOLT specs
  • 11. BOLT 1. Messaging 2. Peer-protocol 3. Transactions 4. Onion routing 5. On-chain transactions 7. Routing gossip (Node/channel discovery) 8. Encrypted and Authenticated Transport 9. Assigned feature flags 10. DNS bootstrap 11. Payment encoding
  • 12. Key LN concepts ● Peer ● Channel ● Funding Tx ● Closing Tx ○ Mutual close ○ Unilateral close ● Hops ● Preimage (and ZKCP) ● Oh ...and msat
  • 13. Anatomy Funding TX Closing TX Off-chain On-chain Time
  • 14. How it works ● Each channel balance change means a new set of transactions are exchanged but not broadcasted (the whole point of being off-chain) ● Old transactions are invalidated (how they do that: keys are provided to the other party) ● Unilateral close is CSV guarded (locked for 144* blocks) ● Bad behaviour (publishing an old transaction) is punished (cheater is wiped out) ● The balance changes can go forever (there’s a theoretical limit of 281,474,976,710,655 changes, though)
  • 15. Payment Routing ● Routing schema is based on the Sphinx ● Path is determined / calculated by the sender ○ Creates a shared secret (using ECDH) for each intermediate node, based on pubkey(ID) ● Different least cost path algorithms (e.g. lnd - Dijkstra, c-lightning Bellman-Ford) ● Nodes forwarding the message can verify the integrity, but can’t ○ learn which other nodes, except for previous and next, are part of the route ○ learn the length of the route ○ or learn their position in the route ● Max length is 20 hops.
  • 16. Good to know ● Channel balance cannot decrease below a certain threshold on each end (both nodes need to have SITG) ● Upon opening a channel the balance tends* to be on one side ○ Thus opener MUST pay before being able to be paid ● Operating a LN node can bring profits (unlike operating a “classic” bitcoin node), by routing payments for others base_fee + fee%
  • 17. Node Implementations ● LND (in Go) by Lightning Labs ● C-Lightning (in C) by Blockstream ● Eclair (in Scala) by ACINQ ● Lit (in Go) by MIT DCI ● Ptarmigan (in C++) by Nayuta ● Plasma (in node.js) by bcoin ● Thunder (in Java) by Blockchain.com
  • 18. Wallet implementations ● Mobile ○ Eclair (by Acinq) ○ Lightning Wallet (by A. Kumaigorodski) ○ CoinClip (by Valcour Games) ● Desktop ○ Zap (by Jack Mallers) ○ Lightning App (by Lightning Labs) ○ Presto ● Web ○ Htlc.me (by Alex Bosworth) ● And … CLI for the brave: lncli, lightning-cli, eclair
  • 19. Ecosystem - Explorers ● Mainnet ○ #recksplorer (https://github.com/chemicstry/recksplorer ) @ https://lnmainnet.gaben.win/ ○ https://p2sh.info/dashboard/db/lightning-network (not really node graph, but network info) ○ https://1ml.com/ ○ https://bl.ocks.org/tyzbit/d1c83732d2767bb955125d41f5921888 (VR ready!) ○ https://bitcoinexchangerate.org/lightning ○ https://graph.lndexplorer.com/ ● Testnet ○ https://1ml.com/testnet ○ https://explorer.acinq.co/
  • 20. DevTools & ready made apps ● Lightning-Charge https://github.com/ElementsProject/lightning-charge (REST API for c-lightning) ● LN-Service (REST API for lnd) https://github.com/alexbosworth/ln-service ● https://github.com/cdecker/kugelblitz (UI for c-lightning) ● LApps ○ Woocommerce LN plugin https://github.com/ElementsProject/woocommerce-gateway-lightning ○ Jukebox https://github.com/ElementsProject/lightning-jukebox ● Directories of tools and apps ○ https://github.com/bcongdon/awesome-lightning-network ○ https://gist.github.com/bretton/798ec38165ffabc719d91e0f4f67552d
  • 21. Use cases ● Instant transactions ● Exchange Arbitration ● Micropayments ● Financial Escrow and Smart Contracts ● Cross chain payments and atomic swaps (both chains need to support HTLC)
  • 24. AMP ● Split big payment into smaller ones ● Can only be settled all-or-none ● It’s independent of the intermediate nodes, only the sender and the received need to be aware ● Further enhance privacy
  • 25. AMP ● Implements a basic secret-share mechanism ● Employs Extra Onion Blobs
  • 26. Splice-in / Splice-out ● Splicing - modify the live balance of the channel ○ Send tx from channel balance to regular BTC address ○ Top-up channel balance ● Works by adding a UTXO or splitting the funding TX into 2 UTXO
  • 27. Watch Towers ● Let other nodes claim funds on your behalf ● Will (most likely) mean additional fees ● Implementation proposal using Encrypted Blobs ○ Use half of the current commitment txid as hint and the the other half as encryption key ○ Assemble revocation tx, encrypt with key and give to WT ● Comes with privacy implications
  • 28. Submarine swaps ● Main idea: swap liquidity in LN for ‘classical’ BTC liquidity ● Send regular BTC tx to pay LN invoice (e.g. no LN wallet) ● Or the other way around (pay LN, receive BTC) ● Might come useful to balance channels (splicing notwithstanding) ● See in this respect ○ https://lightningconductor.net/ ○ https://submarineswaps.org/
  • 29. Other considerations ● Since some of those use constructions based on LN, they could be considered L3 ● BOLT’s are (largely) coin neutral => any (more-accurate: most) blockchain that supports time-locked contracts can implement it ○ LTC ○ ETH (Raiden/µRaiden) ○ ZCash (see proposed BOLT https://blog.z.cash/bolt-private-payment-channels/) ● To watch: Lumino and LTCP on RSK (BTC sidechain with EVM)
  • 30.
  • 31. Timelocks primer Time Lock Location Targeting Metric Type Signal nLocktime Txn Absolute Blocks/Seconds Seconds if >=500000000 nSequence Input Relative Blocks/Seconds Seconds if type flag set OP_CLTV Script Absolute Blocks/Seconds Seconds if >=500000000 OP_CSV Script Relative Blocks/Seconds Seconds if type flag set
  • 32. Ride the lightning ● Second album by Metallica ● Released Jul 27, 1984 ● 8 Tracks ….