SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
Bridging with StarkNet
February 2022
1
StarkNet edu team
https://github.com/starknet-edu | @starkwareltd
Cross Chain Communication
2
@starkwareltd
● Today used for bridging assets:
○ Tokens/NFTs L1 <> L2
○ Tokens/NFTs L1 <> L1
Cross Chain Communication
3
● Tomorrow can we build more bridges?
○ Bridge permissions?
○ Bridge computation?
○ Bridge instructions?
@starkwareltd
Cross Chain Communication
4
● Can we build less bridges?
○ Let users pass data instead of assets
○ Let developers build their own bridges
@starkwareltd
Talking to Ethereum
L2 -> L1 Messaging
Status Description
Submit Tx L2 Client sends TX
‘send_message_to_
l1’
TX initializes L2 Contract syscall to send
message to L1 Contract
Proof L2 TX including message included in Proof
and verified on L1
State Update Message attached to state update, Core
Contract increases counter, and
‘LogMessageToL1’ event emit
Message Cleared L1 Recipient Contract can consume message
in L1 TX via ‘consumeMessageFromL2’. Upon
valid msg params counter decrement and
message considered handled
1. Submit Tx
7
@starkwareltd
2. send_message_to_l1
8
● Message is an array of felts, to a Recipient
● Recipient is a L1 account
@starkwareltd
3. Message registered
9
● Message registered by StarkNet OS
● Message indexed by it’s hash
@starkwareltd
Withdrawal Call Flow
10
@starkwareltd
4. Message received on L1
11
● StarkNet’s state is updated on Ethereum all ‘sent’
messages are updated as ‘pending’
● Core Contracts increment message counter
● All message data can be retrieved for later use
@starkwareltd
4. Message consumed
12
● Recipient should be calling StarkNet contract directly, but
trigger can be arbitrary
● Counter decremented by 1
● Full payload needs to be sent as calldata
@starkwareltd
Delays
13
● Messages are transmitted with proofs
● Proof verification frequency is currently every 2h on testnet
● This means your L2 -> L1 messages will be slow to debug!
● As usage of StarkNet picks up, this frequency may lower
@starkwareltd
Talking to StarkNet
L1 -> L2 Messaging
Status Description
‘sendMessageL2’ L1 Contract initiates a message w/
destination address. Core Contract
hashes msg params + increases counter
‘l1_handler’ L2 Contract’s corresponding message
handler is invoked
Proof Handled message attached to proof of
relevant state update
State Update Message Consumption by L2 Contract
included in State Update
Message Cleared Initial counter is decrement and message
considered handled
1. sendMessageL2
16
● Call the `sendMessageToL2` selector on the CCs
● Message is indexed and counter is incremented
● Specify the L2 recipient, as well as the function selector to
call
@starkwareltd
2. l1_handler
17
● After 10 block confs, your message is confed on StarkNet
● StarkNet initiates the corresponding L2 tx defined by the
contracts ‘l1_handler’
@starkwareltd
3. Prove it
18
● The execution that takes place in the ‘l1_handler’ is
added to the proof written back to L1
@starkwareltd
4. State Update
19
● The state is updated with the included ‘l1_handler’
execution
@starkwareltd
5. Message cleared
20
● Message is now cleared from the Core Contracts
storage
● Message is considered handled
@starkwareltd
Why this is cool
Blockchains talking natively
22
● No element of trust in the mechanism
● Ethereum has certainty of what happened on StarkNet
● Ethereum has mathematical proof that a message was sent
@starkwareltd
Design your own protocol
23
● No assumption about the payload sent (i.e. ‘payload_size=X’)
● Smart contracts on both sides can act upon data sent by L2 to move assets
● Assets can sit on any smart contract using the bridge
○ Tired of liquidity waiting in a bridge?
○ Design a bridge that has liquidity sitting on AAVE
○ Afraid of the security?
○ Implement a time lock on your bridge and select your own security
@starkwareltd
Tight L1 integration
24
● Full remote control: Send to a L1/L2 contract instructions for an arbitrary call
○ Recipient
○ Function selector
● L1 liquidity is StarkNet liquidity
○ You can use directly L1 assets in your applications
@starkwareltd
Mooorrr Resoruces
Docs:
https://docs.starknet.io/documentation/develop/L1-L2_Communication
Exercise:
https://github.com/starknet-edu/starknet-messaging-bridge
Message Viewer:
https://starkscan.co/messagelogs
Thanks!
January 2022
26
@starkwareltd
StarkNet edu team

Weitere ähnliche Inhalte

Ähnlich wie Bridging with StarkNet

Encode x StarkNet Autumn Hackathon: Aave Ethereum / StarkNet Bridge
Encode x StarkNet Autumn Hackathon: Aave Ethereum / StarkNet BridgeEncode x StarkNet Autumn Hackathon: Aave Ethereum / StarkNet Bridge
Encode x StarkNet Autumn Hackathon: Aave Ethereum / StarkNet BridgeMarta Encode
 
Scaling blockchain poart II: Rollups by Dan Boneh
Scaling blockchain poart II: Rollups by Dan BonehScaling blockchain poart II: Rollups by Dan Boneh
Scaling blockchain poart II: Rollups by Dan Bonehr1tretyakov
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer ProtocolsZahouAmel1
 
Interledger Protocol Stack Deep Dive @ Boston Interledger Meetup
Interledger Protocol Stack Deep Dive @ Boston Interledger MeetupInterledger Protocol Stack Deep Dive @ Boston Interledger Meetup
Interledger Protocol Stack Deep Dive @ Boston Interledger MeetupInterledger
 
Fluent destry saul
Fluent destry saulFluent destry saul
Fluent destry saulDestry Saul
 
OOP Lecture 24-Network Programming-Part1.pptx
OOP Lecture 24-Network Programming-Part1.pptxOOP Lecture 24-Network Programming-Part1.pptx
OOP Lecture 24-Network Programming-Part1.pptxTanzila Kehkashan
 
Processing IoT Data with Apache Kafka
Processing IoT Data with Apache KafkaProcessing IoT Data with Apache Kafka
Processing IoT Data with Apache KafkaMatthew Howlett
 
Reliable data transfer CN - prashant odhavani- 160920107003
Reliable data transfer   CN - prashant odhavani- 160920107003Reliable data transfer   CN - prashant odhavani- 160920107003
Reliable data transfer CN - prashant odhavani- 160920107003Prashant odhavani
 
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer ProtocolUjjayanta Bhaumik
 
Introduction of tcp, ip & udp
Introduction of tcp, ip & udpIntroduction of tcp, ip & udp
Introduction of tcp, ip & udprahul kundu
 

Ähnlich wie Bridging with StarkNet (20)

Encode x StarkNet Autumn Hackathon: Aave Ethereum / StarkNet Bridge
Encode x StarkNet Autumn Hackathon: Aave Ethereum / StarkNet BridgeEncode x StarkNet Autumn Hackathon: Aave Ethereum / StarkNet Bridge
Encode x StarkNet Autumn Hackathon: Aave Ethereum / StarkNet Bridge
 
Scaling blockchain poart II: Rollups by Dan Boneh
Scaling blockchain poart II: Rollups by Dan BonehScaling blockchain poart II: Rollups by Dan Boneh
Scaling blockchain poart II: Rollups by Dan Boneh
 
Week4 lec1-bscs1
Week4 lec1-bscs1Week4 lec1-bscs1
Week4 lec1-bscs1
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
 
Real time-embedded-system-lec-06
Real time-embedded-system-lec-06Real time-embedded-system-lec-06
Real time-embedded-system-lec-06
 
01 packet
01 packet01 packet
01 packet
 
Interledger Protocol Stack Deep Dive @ Boston Interledger Meetup
Interledger Protocol Stack Deep Dive @ Boston Interledger MeetupInterledger Protocol Stack Deep Dive @ Boston Interledger Meetup
Interledger Protocol Stack Deep Dive @ Boston Interledger Meetup
 
SSL And TLS
SSL And TLS SSL And TLS
SSL And TLS
 
Fluent destry saul
Fluent destry saulFluent destry saul
Fluent destry saul
 
L2tp1
L2tp1L2tp1
L2tp1
 
OOP Lecture 24-Network Programming-Part1.pptx
OOP Lecture 24-Network Programming-Part1.pptxOOP Lecture 24-Network Programming-Part1.pptx
OOP Lecture 24-Network Programming-Part1.pptx
 
Telnet
TelnetTelnet
Telnet
 
Transport layer.pptx
Transport layer.pptxTransport layer.pptx
Transport layer.pptx
 
L2 tp
L2 tpL2 tp
L2 tp
 
L2 tp
L2 tpL2 tp
L2 tp
 
Ekiden
EkidenEkiden
Ekiden
 
Processing IoT Data with Apache Kafka
Processing IoT Data with Apache KafkaProcessing IoT Data with Apache Kafka
Processing IoT Data with Apache Kafka
 
Reliable data transfer CN - prashant odhavani- 160920107003
Reliable data transfer   CN - prashant odhavani- 160920107003Reliable data transfer   CN - prashant odhavani- 160920107003
Reliable data transfer CN - prashant odhavani- 160920107003
 
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer Protocol
 
Introduction of tcp, ip & udp
Introduction of tcp, ip & udpIntroduction of tcp, ip & udp
Introduction of tcp, ip & udp
 

Mehr von TinaBregovi

Building LSD Use Cases on Bifrost
Building LSD Use Cases on BifrostBuilding LSD Use Cases on Bifrost
Building LSD Use Cases on BifrostTinaBregovi
 
Urbit Launch Event
Urbit Launch EventUrbit Launch Event
Urbit Launch EventTinaBregovi
 
Layer Hack: Boba Network: Understanding Hybrid Compute
Layer Hack: Boba Network: Understanding Hybrid ComputeLayer Hack: Boba Network: Understanding Hybrid Compute
Layer Hack: Boba Network: Understanding Hybrid ComputeTinaBregovi
 
Layer Hack: zkSync - Intro to zkEVM
Layer Hack: zkSync - Intro to zkEVMLayer Hack: zkSync - Intro to zkEVM
Layer Hack: zkSync - Intro to zkEVMTinaBregovi
 
Rollup-as-a-service and why it matters to the next-gen of dApps
Rollup-as-a-service and why it matters to the next-gen of dAppsRollup-as-a-service and why it matters to the next-gen of dApps
Rollup-as-a-service and why it matters to the next-gen of dAppsTinaBregovi
 
Layer Hack: AltLayer Workshop
Layer Hack: AltLayer WorkshopLayer Hack: AltLayer Workshop
Layer Hack: AltLayer WorkshopTinaBregovi
 
Layer Hack Launch Event
Layer Hack Launch EventLayer Hack Launch Event
Layer Hack Launch EventTinaBregovi
 
How To Build Better NFTs with Briq
How To Build Better NFTs with BriqHow To Build Better NFTs with Briq
How To Build Better NFTs with BriqTinaBregovi
 
NFTs on StarkNet
NFTs on StarkNetNFTs on StarkNet
NFTs on StarkNetTinaBregovi
 
Braavos Wallet Workshop.pdf
Braavos Wallet Workshop.pdfBraavos Wallet Workshop.pdf
Braavos Wallet Workshop.pdfTinaBregovi
 
StarkNet Autumn Hackathon Launch Event.pptx
StarkNet Autumn Hackathon Launch Event.pptxStarkNet Autumn Hackathon Launch Event.pptx
StarkNet Autumn Hackathon Launch Event.pptxTinaBregovi
 
Harmony Marketplace SDK.pptx
Harmony Marketplace SDK.pptxHarmony Marketplace SDK.pptx
Harmony Marketplace SDK.pptxTinaBregovi
 
Get Ready for Coinbase Node
Get Ready for Coinbase NodeGet Ready for Coinbase Node
Get Ready for Coinbase NodeTinaBregovi
 
MANIFOLD MEV Bounty Competition
MANIFOLD MEV Bounty CompetitionMANIFOLD MEV Bounty Competition
MANIFOLD MEV Bounty CompetitionTinaBregovi
 
Public SP Meeting
Public SP MeetingPublic SP Meeting
Public SP MeetingTinaBregovi
 
Welcome to the Web 3.0
Welcome to the Web 3.0Welcome to the Web 3.0
Welcome to the Web 3.0TinaBregovi
 
Introduction to IPFS & Filecoin - longer version
Introduction to IPFS & Filecoin - longer versionIntroduction to IPFS & Filecoin - longer version
Introduction to IPFS & Filecoin - longer versionTinaBregovi
 
Introduction to IPFS & Filecoin
Introduction to IPFS & FilecoinIntroduction to IPFS & Filecoin
Introduction to IPFS & FilecoinTinaBregovi
 

Mehr von TinaBregovi (20)

Building LSD Use Cases on Bifrost
Building LSD Use Cases on BifrostBuilding LSD Use Cases on Bifrost
Building LSD Use Cases on Bifrost
 
Urbit Launch Event
Urbit Launch EventUrbit Launch Event
Urbit Launch Event
 
Layer Hack: Boba Network: Understanding Hybrid Compute
Layer Hack: Boba Network: Understanding Hybrid ComputeLayer Hack: Boba Network: Understanding Hybrid Compute
Layer Hack: Boba Network: Understanding Hybrid Compute
 
Layer Hack: zkSync - Intro to zkEVM
Layer Hack: zkSync - Intro to zkEVMLayer Hack: zkSync - Intro to zkEVM
Layer Hack: zkSync - Intro to zkEVM
 
Rollup-as-a-service and why it matters to the next-gen of dApps
Rollup-as-a-service and why it matters to the next-gen of dAppsRollup-as-a-service and why it matters to the next-gen of dApps
Rollup-as-a-service and why it matters to the next-gen of dApps
 
Layer Hack: AltLayer Workshop
Layer Hack: AltLayer WorkshopLayer Hack: AltLayer Workshop
Layer Hack: AltLayer Workshop
 
Layer Hack Launch Event
Layer Hack Launch EventLayer Hack Launch Event
Layer Hack Launch Event
 
How To Build Better NFTs with Briq
How To Build Better NFTs with BriqHow To Build Better NFTs with Briq
How To Build Better NFTs with Briq
 
NFTs on StarkNet
NFTs on StarkNetNFTs on StarkNet
NFTs on StarkNet
 
Braavos Wallet Workshop.pdf
Braavos Wallet Workshop.pdfBraavos Wallet Workshop.pdf
Braavos Wallet Workshop.pdf
 
StarkNet Autumn Hackathon Launch Event.pptx
StarkNet Autumn Hackathon Launch Event.pptxStarkNet Autumn Hackathon Launch Event.pptx
StarkNet Autumn Hackathon Launch Event.pptx
 
Harmony Marketplace SDK.pptx
Harmony Marketplace SDK.pptxHarmony Marketplace SDK.pptx
Harmony Marketplace SDK.pptx
 
Coinbase Node
Coinbase NodeCoinbase Node
Coinbase Node
 
Get Ready for Coinbase Node
Get Ready for Coinbase NodeGet Ready for Coinbase Node
Get Ready for Coinbase Node
 
MANIFOLD MEV Bounty Competition
MANIFOLD MEV Bounty CompetitionMANIFOLD MEV Bounty Competition
MANIFOLD MEV Bounty Competition
 
Public SP Meeting
Public SP MeetingPublic SP Meeting
Public SP Meeting
 
Ecosystem WG
Ecosystem WGEcosystem WG
Ecosystem WG
 
Welcome to the Web 3.0
Welcome to the Web 3.0Welcome to the Web 3.0
Welcome to the Web 3.0
 
Introduction to IPFS & Filecoin - longer version
Introduction to IPFS & Filecoin - longer versionIntroduction to IPFS & Filecoin - longer version
Introduction to IPFS & Filecoin - longer version
 
Introduction to IPFS & Filecoin
Introduction to IPFS & FilecoinIntroduction to IPFS & Filecoin
Introduction to IPFS & Filecoin
 

Kürzlich hochgeladen

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Kürzlich hochgeladen (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Bridging with StarkNet

  • 1. Bridging with StarkNet February 2022 1 StarkNet edu team https://github.com/starknet-edu | @starkwareltd
  • 2. Cross Chain Communication 2 @starkwareltd ● Today used for bridging assets: ○ Tokens/NFTs L1 <> L2 ○ Tokens/NFTs L1 <> L1
  • 3. Cross Chain Communication 3 ● Tomorrow can we build more bridges? ○ Bridge permissions? ○ Bridge computation? ○ Bridge instructions? @starkwareltd
  • 4. Cross Chain Communication 4 ● Can we build less bridges? ○ Let users pass data instead of assets ○ Let developers build their own bridges @starkwareltd
  • 6. L2 -> L1 Messaging Status Description Submit Tx L2 Client sends TX ‘send_message_to_ l1’ TX initializes L2 Contract syscall to send message to L1 Contract Proof L2 TX including message included in Proof and verified on L1 State Update Message attached to state update, Core Contract increases counter, and ‘LogMessageToL1’ event emit Message Cleared L1 Recipient Contract can consume message in L1 TX via ‘consumeMessageFromL2’. Upon valid msg params counter decrement and message considered handled
  • 8. 2. send_message_to_l1 8 ● Message is an array of felts, to a Recipient ● Recipient is a L1 account @starkwareltd
  • 9. 3. Message registered 9 ● Message registered by StarkNet OS ● Message indexed by it’s hash @starkwareltd
  • 11. 4. Message received on L1 11 ● StarkNet’s state is updated on Ethereum all ‘sent’ messages are updated as ‘pending’ ● Core Contracts increment message counter ● All message data can be retrieved for later use @starkwareltd
  • 12. 4. Message consumed 12 ● Recipient should be calling StarkNet contract directly, but trigger can be arbitrary ● Counter decremented by 1 ● Full payload needs to be sent as calldata @starkwareltd
  • 13. Delays 13 ● Messages are transmitted with proofs ● Proof verification frequency is currently every 2h on testnet ● This means your L2 -> L1 messages will be slow to debug! ● As usage of StarkNet picks up, this frequency may lower @starkwareltd
  • 15. L1 -> L2 Messaging Status Description ‘sendMessageL2’ L1 Contract initiates a message w/ destination address. Core Contract hashes msg params + increases counter ‘l1_handler’ L2 Contract’s corresponding message handler is invoked Proof Handled message attached to proof of relevant state update State Update Message Consumption by L2 Contract included in State Update Message Cleared Initial counter is decrement and message considered handled
  • 16. 1. sendMessageL2 16 ● Call the `sendMessageToL2` selector on the CCs ● Message is indexed and counter is incremented ● Specify the L2 recipient, as well as the function selector to call @starkwareltd
  • 17. 2. l1_handler 17 ● After 10 block confs, your message is confed on StarkNet ● StarkNet initiates the corresponding L2 tx defined by the contracts ‘l1_handler’ @starkwareltd
  • 18. 3. Prove it 18 ● The execution that takes place in the ‘l1_handler’ is added to the proof written back to L1 @starkwareltd
  • 19. 4. State Update 19 ● The state is updated with the included ‘l1_handler’ execution @starkwareltd
  • 20. 5. Message cleared 20 ● Message is now cleared from the Core Contracts storage ● Message is considered handled @starkwareltd
  • 21. Why this is cool
  • 22. Blockchains talking natively 22 ● No element of trust in the mechanism ● Ethereum has certainty of what happened on StarkNet ● Ethereum has mathematical proof that a message was sent @starkwareltd
  • 23. Design your own protocol 23 ● No assumption about the payload sent (i.e. ‘payload_size=X’) ● Smart contracts on both sides can act upon data sent by L2 to move assets ● Assets can sit on any smart contract using the bridge ○ Tired of liquidity waiting in a bridge? ○ Design a bridge that has liquidity sitting on AAVE ○ Afraid of the security? ○ Implement a time lock on your bridge and select your own security @starkwareltd
  • 24. Tight L1 integration 24 ● Full remote control: Send to a L1/L2 contract instructions for an arbitrary call ○ Recipient ○ Function selector ● L1 liquidity is StarkNet liquidity ○ You can use directly L1 assets in your applications @starkwareltd