SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Downloaden Sie, um offline zu lesen
STATE
CHANNELS
BLOCKCHAIN SCALABILITY VIA STATE
CHANNELS
PROBLEMS ADDRESSED
BY STATE CHANNELS
Scalability - Tens of thousands transactions per second
possible
Privacy - None public transaction possible
Confirmation delay: instant transaction confirmation possible
-> Still trustless/ without counter party risk
BITCOIN - PAYMENT
CHANNEL
Alice wants to charge a E-car and pay Bob every second
A locks money in a multisig address (2 out of 2)
100mBTC in multisig:



1) Alice signs transaction with two outputs 1mBTC to Bob, 99 to Alice
2) Alice signs transaction with two outputs 2mBTC to Bob, 98 to Alice
3) Alice signs transaction with two outputs 3mBTC to Bob, 97 to Alice
….
Only Bob can submit transactions because his signature is missing
Bob would only submit the latest transaction
BITCOIN - PAYMENT
CHANNEL
Limitations: Payments only in one direction
Next step: Lightning network - invalidate older transactions by punishment
transaction

1) Alice signs transaction with two outputs 1mBTC to Bob, 99 to Alice
2) Alice signs transaction with two outputs 2mBTC to Bob, 98 to Alice
3) Alice signs transaction with two outputs 3mBTC to Bob, 97 to Alice
Bob signs a transaction that would spend the 3mBTC


With Ethereum: Much simpler and in a general way possible
SEQUENCE OF STATE
CHANNELS
1. two (or more) people lock up some tokens or any state description
they totally control.
2. this state can only be updated on the blockchain with a signed
message of all group members
3. the members of the group can internally do transactions by creating a
new state and letting it sign by everyone. The new state also has a
nonce (sequence number)
4. if members of the group stop cooperating the latest state can always
be written on the blockchain
5. to write the state on the blockchain anyone can submit a signed state
and a small security deposit - this will trigger a challenge period. During
this period a newer state (higher nonce) can be submitted, in this case
the first submitter would lose its deposit.
6. If a state remains unchallenged it will be written on the regular
blockchain
EXAMPLE -
PREDICTION MARKET
Alice and Bob wants to bet against each other.
1. Lock money
2. First transaction: Alice bets on Hillary, Bob on Sanders
(could sign the transaction or just the resulting state)
seq. nr. 0 | (A:50ETH/B:50ETH) |
seq. nr. 1 | (A:40ETH, 20 Hillary shares/B:
40ETH 20 Sanders shares) | signatures
EXAMPLE -
PREDICTION MARKET
3. Second transaction: Alice makes another bet on Hillary
seq. nr. 2 | (A:25ETH, 40 Hillary shares/B:
35ETH 40 Sanders shares) | signatures
seq. nr. 1 | (A:40ETH, 20 Hillary shares/B:
40ETH 20 Sanders shares) | signatures
4. Sanders wins
4a. If they cooperate they can just update the off-chain state to:
seq. nr. 3 | (A:25ETH,/B:75ETH) | signatures
4b. If Alice does not cooperate Bob can settle state 2
(submit it to the blockchain)
4c. Alice could try to cheat and settle state 0 or 1 - > Bob can
challenge this by submitting state 2 during the challenge period
HASHLOCK - (1/2)
TRANSITIVE TRANSACTIONS
Alices - Bob Bob - Charly
seq. nr. 0 | (A:50ETH/B:50ETH) | seq. nr. 0 | (B:50ETH/C:50ETH) |
Alice wants to send Charly 10 ETH but hasn't locked money
with him.
seq. nr. 1 | (A:40ETH/B:60ETH
) | signatures | HASHLOCK (only
known by Alice)
Solution - Alices sends 10 ETH to Bob in channel 1 and Bob
sends 10 to Charly in channel 2
Problem - Who makes the first transaction? -> Hashlock
seq. nr. 1 | (B:40ETH/C:60ETH
) | signatures | SAME HASHLOCK
(only known by Alice)
Alice can publish the HASH-LOCK
HASHLOCK - (2/2)
TRANSITIVE TRANSACTIONS
seq. nr. 1 | (A:40ETH/B:60ETH
) | signatures | HASHLOCK (only
known by Alice)
seq. nr. 1 | (B:40ETH/C:60ETH
) | signatures | SAME HASHLOCK
(only known by Alice)
What if
a) Alice creates the transaction to Bob but Bob does not create the

transaction to Charly

-> than Alice does not reveal the Secret
b) Alice reveals the secret of the transaction only to Charly?
-> as soon as Charly puts the secrete on the Blockchain Bob knows it
as well
c) What if Alices does not reveal the secret at all?

-> there needs to be an expiry date where funds are freed anyway
Alices - Bob Bob - Charly
CODE REVIEW
FINAL THOUGHTS
- more money locked than necessary
- make a bid - revoke the bid






mini - side chain




The court
READ MORE
Off chain trading on Gnosis
http://forum.groupgnosis.com/t/how-offchain-trading-will-
work/63/13
Intro to state channels
http://www.jeffcoleman.ca/state-channels/
Universal Payment Channels
https://gist.github.com/jtremback/058daafe1116435b6a2e
Bitcoin Lightning Network
https://lightning.network

Weitere ähnliche Inhalte

Mehr von Martin Köppelmann

Mehr von Martin Köppelmann (7)

Daoist history - By Joel Dietz
Daoist history - By Joel DietzDaoist history - By Joel Dietz
Daoist history - By Joel Dietz
 
Circles - Brandbook
Circles - BrandbookCircles - Brandbook
Circles - Brandbook
 
Gnosis platform - NYC 2016
Gnosis platform - NYC 2016Gnosis platform - NYC 2016
Gnosis platform - NYC 2016
 
Build dapps 1:3 dev tools
Build dapps 1:3 dev toolsBuild dapps 1:3 dev tools
Build dapps 1:3 dev tools
 
Cirlces berlin
Cirlces berlinCirlces berlin
Cirlces berlin
 
Circles - Universal Basic Income
Circles - Universal Basic IncomeCircles - Universal Basic Income
Circles - Universal Basic Income
 
51% Attacks - Pools and Game Theory
51% Attacks - Pools and Game Theory51% Attacks - Pools and Game Theory
51% Attacks - Pools and Game Theory
 

Kürzlich hochgeladen

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 

Kürzlich hochgeladen (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 

State channels and scalability

  • 2. PROBLEMS ADDRESSED BY STATE CHANNELS Scalability - Tens of thousands transactions per second possible Privacy - None public transaction possible Confirmation delay: instant transaction confirmation possible -> Still trustless/ without counter party risk
  • 3. BITCOIN - PAYMENT CHANNEL Alice wants to charge a E-car and pay Bob every second A locks money in a multisig address (2 out of 2) 100mBTC in multisig:
 
 1) Alice signs transaction with two outputs 1mBTC to Bob, 99 to Alice 2) Alice signs transaction with two outputs 2mBTC to Bob, 98 to Alice 3) Alice signs transaction with two outputs 3mBTC to Bob, 97 to Alice …. Only Bob can submit transactions because his signature is missing Bob would only submit the latest transaction
  • 4. BITCOIN - PAYMENT CHANNEL Limitations: Payments only in one direction Next step: Lightning network - invalidate older transactions by punishment transaction
 1) Alice signs transaction with two outputs 1mBTC to Bob, 99 to Alice 2) Alice signs transaction with two outputs 2mBTC to Bob, 98 to Alice 3) Alice signs transaction with two outputs 3mBTC to Bob, 97 to Alice Bob signs a transaction that would spend the 3mBTC 
 With Ethereum: Much simpler and in a general way possible
  • 5. SEQUENCE OF STATE CHANNELS 1. two (or more) people lock up some tokens or any state description they totally control. 2. this state can only be updated on the blockchain with a signed message of all group members 3. the members of the group can internally do transactions by creating a new state and letting it sign by everyone. The new state also has a nonce (sequence number) 4. if members of the group stop cooperating the latest state can always be written on the blockchain 5. to write the state on the blockchain anyone can submit a signed state and a small security deposit - this will trigger a challenge period. During this period a newer state (higher nonce) can be submitted, in this case the first submitter would lose its deposit. 6. If a state remains unchallenged it will be written on the regular blockchain
  • 6. EXAMPLE - PREDICTION MARKET Alice and Bob wants to bet against each other. 1. Lock money 2. First transaction: Alice bets on Hillary, Bob on Sanders (could sign the transaction or just the resulting state) seq. nr. 0 | (A:50ETH/B:50ETH) | seq. nr. 1 | (A:40ETH, 20 Hillary shares/B: 40ETH 20 Sanders shares) | signatures
  • 7. EXAMPLE - PREDICTION MARKET 3. Second transaction: Alice makes another bet on Hillary seq. nr. 2 | (A:25ETH, 40 Hillary shares/B: 35ETH 40 Sanders shares) | signatures seq. nr. 1 | (A:40ETH, 20 Hillary shares/B: 40ETH 20 Sanders shares) | signatures 4. Sanders wins 4a. If they cooperate they can just update the off-chain state to: seq. nr. 3 | (A:25ETH,/B:75ETH) | signatures 4b. If Alice does not cooperate Bob can settle state 2 (submit it to the blockchain) 4c. Alice could try to cheat and settle state 0 or 1 - > Bob can challenge this by submitting state 2 during the challenge period
  • 8. HASHLOCK - (1/2) TRANSITIVE TRANSACTIONS Alices - Bob Bob - Charly seq. nr. 0 | (A:50ETH/B:50ETH) | seq. nr. 0 | (B:50ETH/C:50ETH) | Alice wants to send Charly 10 ETH but hasn't locked money with him. seq. nr. 1 | (A:40ETH/B:60ETH ) | signatures | HASHLOCK (only known by Alice) Solution - Alices sends 10 ETH to Bob in channel 1 and Bob sends 10 to Charly in channel 2 Problem - Who makes the first transaction? -> Hashlock seq. nr. 1 | (B:40ETH/C:60ETH ) | signatures | SAME HASHLOCK (only known by Alice) Alice can publish the HASH-LOCK
  • 9. HASHLOCK - (2/2) TRANSITIVE TRANSACTIONS seq. nr. 1 | (A:40ETH/B:60ETH ) | signatures | HASHLOCK (only known by Alice) seq. nr. 1 | (B:40ETH/C:60ETH ) | signatures | SAME HASHLOCK (only known by Alice) What if a) Alice creates the transaction to Bob but Bob does not create the
 transaction to Charly
 -> than Alice does not reveal the Secret b) Alice reveals the secret of the transaction only to Charly? -> as soon as Charly puts the secrete on the Blockchain Bob knows it as well c) What if Alices does not reveal the secret at all?
 -> there needs to be an expiry date where funds are freed anyway Alices - Bob Bob - Charly
  • 11. FINAL THOUGHTS - more money locked than necessary - make a bid - revoke the bid 
 
 
 mini - side chain 
 
 The court
  • 12. READ MORE Off chain trading on Gnosis http://forum.groupgnosis.com/t/how-offchain-trading-will- work/63/13 Intro to state channels http://www.jeffcoleman.ca/state-channels/ Universal Payment Channels https://gist.github.com/jtremback/058daafe1116435b6a2e Bitcoin Lightning Network https://lightning.network