off chain
play

Off-chain Tejaswi Nadahalli ETH Zurich Distributed Computing Group - PowerPoint PPT Presentation

Off-chain Tejaswi Nadahalli ETH Zurich Distributed Computing Group www.disco.ethz.ch ETH Zurich Distributed Computing www.disco.ethz.ch Layer-1 Blockchains have low throughput Bitcoin ~ 7 tps Ethereum ~ 15 tps Off-chain Hubs


  1. Off-chain Tejaswi Nadahalli ETH Zurich – Distributed Computing Group – www.disco.ethz.ch ETH Zurich – Distributed Computing – www.disco.ethz.ch

  2. Layer-1 Blockchains have low throughput Bitcoin ~ 7 tps Ethereum ~ 15 tps

  3. Off-chain Hubs Channels Layer 1.5 Layer 2 Layer 2 State Channels ZK Rollups Nocust Plasma Lightning Network Optimistic Rollups

  4. Layer-2: Payment channels • Bitcoin - constrained smart contracts Payment Channels (and Networks) • Duplex Micropayment Channels (ETH contribution) • Lightning Channels • Eltoo Channels (ETH alumni)

  5. Lighting Network ~3000 nodes, ~30000 channels, ~843 BTC

  6. Lighting Network in Production • BOLT - a specification for the Lightning Network (https://github.com/lightningnetwork/lightning-rfc) • Implementations – LND (golang) – C-Lightning (C) – Eclair (Scala)

  7. Bitcoin Primitives • UTXO - Unspent Transaction Output • Cryptographic Hash Function • Timelocks Hashed Timelocked Contracts

  8. Alice ⇒ Carol • Alice open a channel to any other node, say Bob. • Carol gives Alice an invoice • Alice pays Carol through Bob and the Network stick figures: XKCD

  9. Chained Payments H(s) (hash of a secret) H(s) H(s) H(s) HTLC s s HTLC stick figures: XKCD

  10. Lightning Channels

  11. Lightning Channels Bitcoin Transactions - 010000000111744 … ..b0488ac00000000 • Opening/Funding Transaction • Commitment Transaction(s) • Bilateral Closure • Delivery • Revocable Delivery • Breach Remedy

  12. Lightning Channels (the good) • (Once) Opening/Funding Transaction ($$$$) • (Many) Commitment Transaction(s) ($) • (Once) Bilateral Closure ($$$$) • Delivery • Revocable Delivery • Breach Remedy

  13. Lightning Channels (the bad) • (Once) Opening/Funding Transaction ($$$$) • (Many) Commitment Transaction(s) + Unilateral Closure ($) ($$$$) • Bilateral Closure • (Once) Delivery ($$$$) • (Once) Revocable Delivery ($$$$) • Breach Remedy

  14. Lightning Channels (the ugly) • (Once) Opening/Funding Transaction • (Many) Commitment Transaction(s) + Cheating transaction ($) ($$$$) • Bilateral Closure • (Once) Delivery ($$$$) • Revocable Delivery • (Once) Breach Remedy ($$$$)

  15. Lightning Channel UTXO_a UTXO controlled by Alice UTXO_a UTXO_b topen topen Opening Transaction UTXO_ab UTXO_ab UTXO controlled by Alice and Bob Commitment Transaction broadcastable ctx_a ctx_b ctx_a by Alice (a+t) (b+t) (a+t) Alice UTXO controlled by Alice and a timelock Bob OR OR OR OR Bob with a secret (b+s b ) (a+s a ) (b+s b ) UTXO_b UTXO_a

  16. Lightning Channel Bilateral Closure UTXO_a UTXO_b UTXO_ab topen closure UTXO_ab UTXO_a UTXO_b ctx_a ctx_b (a+t) (b+t) OR OR (b+s b ) (a+s a ) UTXO_b UTXO_a

  17. Lightning Channel Unilateral Closure UTXO_a UTXO_b UTXO_ab topen ctx_a current (a+t) UTXO_ab OR UTXO_b (b+s b ) after time “t” ctx_a ctx_b sweep_a (a+t) (b+t) OR OR UTXO_a (b+s b ) (a+s a ) UTXO_b UTXO_a

  18. Lightning Channel Cheating Closure UTXO_a UTXO_b UTXO_ab topen ctx_a previous (a+t) UTXO_ab OR UTXO_b (b+s b ) after time “t” ctx_a ctx_b sweep_a (a+t) (b+t) OR OR UTXO_a (b+s b ) (a+s a ) UTXO_b UTXO_a

  19. Lightning Channel Justice Transaction UTXO_a UTXO_b UTXO_ab topen ctx_a previous (a+t) UTXO_ab OR UTXO_b (b+s b ) ctx_a ctx_b s b + sweep_b (a+t) (b+t) OR OR UTXO_b (b+s b ) (a+s a ) UTXO_b UTXO_a

  20. Code # 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 secret. OP_HASH160 <RIPEMD160(payment_hash)> OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF OP_ENDIF

  21. Offline … Watchtower

  22. Watchtower Open Close stick figures: XKCD

  23. Justice Kit (a+t) ctx_a previous OR (b+s b ) b’s mirror s b + sweep_b UTXO_b ctx_a_TXID_suffix AES-128 eJTX ctx_a_TXID_prefix ( 🔓🔓🔓🔓🔓🔓🔓🔓🔓 )

  24. Watchtower 🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓 e3b0c44298... 🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓 6e340b9cff... 🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓 96a296d224... 🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓 709e80c884... 🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓 df3f619804... 🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓🔓 8855508aad... ... ... ... ... ... ...

  25. How much does it cost? (Size of Encrypted Blob + Size of Key) (350 + 32) X Number of Updates (1M) X Number of Channels (30000) = 11 TB (always online server, watching the blockchain)

  26. Observations Cheater has to store cheating CTX(s) Every CTX has a corresponding JTX CTX has to be published on the blockchain Store the corresponding JTX inside this CTX?

  27. Can we store JTX inside CTX? UTXO_ab ctx_a previous (a+t) (a+t) OR UTXO_b OR (b+s b ) (b+s b ) s b + sweep_b b s b + sweep_b UTXO_b UTXO_b OP_RETURN

  28. TXID UTXO_ab ctx_a previous (a+t) (a+t) OR UTXO_b OR (b+s b ) (b+s b ) double - SHA256 b s b + sweep_b UTXO_b TXID OP_RETURN

  29. TXID makes it self-referential UTXO_ab ctx_a previous (a+t) (a+t) OR UTXO_b OR (b+s b ) (b+s b ) double - SHA256 b s b + sweep_b UTXO_b TXID OP_RETURN

  30. Outpost

  31. Outpost UTXO_a UTXO_b topen UTXO_ab ctx 1 _a UTXO_ab (balance) b’s mirror UTXO_b UTXO_ab ( ε )

  32. Outpost Justice Transaction UTXO_a UTXO_b UTXO_ab topen (balance_a) UTXO_ab jtx_b ctx 1 _a UTXO_b UTXO_ab (balance_a) b’s mirror UTXO_b UTXO_ab ( ε )

  33. Outpost Encrypted Justice Transaction UTXO_a UTXO_b UTXO_ab topen (balance_a) UTXO_ab b’s mirror jtx_b UTXO_b ctx 1 _a UTXO_ab (balance_a) AES-128 b’s mirror UTXO_b eJTX UTXO_ab ( ε )

  34. Outpost Auxiliary Transaction UTXO_ab UTXO_a UTXO_b ( ε ) topen aux_ctx_a UTXO_ab UTXO_ab ( ε ) ctx 1 _a UTXO_ab OP_RETURN (balance_a) eJTX b’s mirror UTXO_b eJTX UTXO_ab ( ε )

  35. Outpost Commitment Transaction-2 UTXO UTXO_ab UTXO_a UTXO_b after time “t” ( ε ) (balance_a) topen UTXO_ab ctx 2 _a UTXO_ab ( ε ) ctx 1 _a aux_ctx_a UTXO_a UTXO_ab (balance_a) UTXO_ab ( ε ) b’s mirror UTXO_b OP_RETURN UTXO_ab eJTX ( ε )

  36. The money slide Classic Lightning Per channel, with N updates 30k channels, 1M updates Known Channel N·size(ejtx) + 1·size(txid) 10.00 TB Unknown Channel N·size(ejtx) + N·size(txid)) 11.45 TB Outpost Known Channel size(key) + size(txid) 1.44 MB (WTF) Unknown Channel N·size(key) + N·size(txid) 1.44 TB Note: size(key) << size(ejtx) i.e. 16 << 350

  37. Outpost keeps Lightning’s key features Unilateral closure: broadcaster has to wait ● ○ Not cheating ○ Cheating Exchange revocation keys vs. AES-128 decryption keys ●

  38. Limitations OP_RETURN limited to 80 bytes. ● IsStandard ಠ _ ಠ ○ ○ Split aux_ctx into 2; P2SH Data-hash across them Bloat ● ○ Not on the blockchain (happy case) ○ On the blockchain, 3 txns vs 1 txn But ● ○ No changes to Bitcoin, whatsoever.

  39. Off-chain Hubs Channels Layer 1.5 Layer 2 Layer 2 State Channels (network limit) Nocust Plasma ZK Rollups (network (Network (2000) Lightning limit) limit) Network (network limit) Optimistic Rollups (500)

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend