lightning network overview - chaincode · transfer layer (bolt 02) off-chain case: - collaborative...
TRANSCRIPT
![Page 1: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/1.jpg)
Lightning Network OverviewDr. Christian Decker
Core Tech Engineer
![Page 2: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/2.jpg)
The Lightning Stack
![Page 3: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/3.jpg)
Layers1
![Page 4: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/4.jpg)
Transport Layer (BOLT 08)
Goals
- Authenticate Node Identity
- Fingerprint Resistant
- Setup Transport Encryption
- Confidentiality
- Authentication
- Integrity
Implementation
- Persistent Identities (Node ID)
- Noise Protocol Framework (Noise_XK)
- SHA256
- ChaCha20
- Poly1305
![Page 5: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/5.jpg)
Message Framing (BOLT 08)
![Page 6: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/6.jpg)
Control Messages (BOLT 01)
init
- type: 16 (init)- data:
- [2:gflen]- [gflen:globalfeatures]- [2:lflen]- [lflen:localfeatures]
error
- type: 17 (error)- data:
- [32:channel_id]- [2:len]- [len:data]
![Page 7: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/7.jpg)
User Balance
Alice 5
Bob 5
Carol 5
55 4
6 19 6
4
6
4
Update Layer (BOLT 02)
![Page 8: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/8.jpg)
Transfer Layer (BOLT 02)
Off-Chain Case:- Collaborative success
Recipient presents sender with the hash preimage, and both update state to remove the HTLC output.
- Uncollaborative successRecipient shows sender hash, but sender refuses to remove the HTLC output. Drop to chain to enforce success using the HTLC-success transaction before timeout expires
- TimeoutDrop to chain and eventually use HTLC-Timeout transaction, before upstream timeout expires, to avoid being out of pocket.
On-Chain Case:- Collaborative success
Too late, we’re already on-chain, HTLC output was created.
- Uncollaborative successEnforce success using the HTLC-success transaction before timeout expires.
- TimeoutUse HTLC-Timeout transaction, before upstream timeout expires, to avoid being out of pocket.
![Page 9: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/9.jpg)
Transfer Layer (BOLT 02)
# To remote node with revocation key
OP_DUP OP_HASH160 <RIPEMD160(SHA256(revocationpubkey))> OP_EQUAL
OP_IF
OP_CHECKSIG
OP_ELSE
<remote_htlcpubkey> OP_SWAP OP_SIZE 32 OP_EQUAL
OP_NOTIF
# To local node via HTLC-timeout transaction (timelocked).
OP_DROP 2 OP_SWAP <local_htlcpubkey> 2 OP_CHECKMULTISIG
OP_ELSE
# To remote node with preimage.
OP_HASH160 <RIPEMD160(payment_hash)> OP_EQUALVERIFY
OP_CHECKSIG
OP_ENDIFOP_ENDIF
![Page 10: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/10.jpg)
A B C D E
Multihop Layer (BOLT 04)
B C D E T
![Page 11: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/11.jpg)
Gossip Layer (BOLT 07)
![Page 12: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/12.jpg)
Bits and Pieces2
![Page 13: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/13.jpg)
Bits and Pieces
DNS Bootstrap (BOLT 10) Invoices (BOLT 11)
Please send 0.0025 BTC for a cup of nonsense (ナン
センス 1杯) to the same peer, within one minute
lnbc2500u1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0xqzpuyk0sg5g70me25alkluzd2x62aysf2pyy8edtjeevuv4p2d5p76r4zkmneet7uvyakky2zr4cusd45tftc9c5fh0nnqpnl2jfll544esqchsrny
![Page 14: Lightning Network Overview - Chaincode · Transfer Layer (BOLT 02) Off-Chain Case: - Collaborative success Recipient presents sender with the hash preimage, and both update state](https://reader033.vdocuments.us/reader033/viewer/2022041721/5e4ef595b853a067af2c54f2/html5/thumbnails/14.jpg)
Thank You
Blockstream.com
@Snyke
@Blockstream