SlideShare a Scribd company logo
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

More Related Content

PPTX
Understanding the Transport Layer: MUX, DEMUX, Process-to-Process Delivery, T...
PDF
Computer Networks Module 2.pdf
PPT
Secure Socket Layer.ppt [ssl for websecurity]
PPTX
Computer network transport layer MODUL 2.pptx
PDF
TGIPulsar - EP #006: Lifecycle of a Pulsar message
PDF
How to build a dApp in StarkNet
PPTX
DLL Elementary protocols from computer networks.pptx
Understanding the Transport Layer: MUX, DEMUX, Process-to-Process Delivery, T...
Computer Networks Module 2.pdf
Secure Socket Layer.ppt [ssl for websecurity]
Computer network transport layer MODUL 2.pptx
TGIPulsar - EP #006: Lifecycle of a Pulsar message
How to build a dApp in StarkNet
DLL Elementary protocols from computer networks.pptx

Similar to Bridging with StarkNet (20)

PPTX
TRANSPORT LAYER ppt.pptx
PPTX
Bitcoin lightning network and ethereum protocols
PPTX
Network protocols
PDF
From Stream to Screen: Real-Time Data Streaming to Web Frontends with Conflue...
PPT
RC Car detailed analysis
PPTX
Encode x StarkNet Autumn Hackathon: Aave Ethereum / StarkNet Bridge
PPTX
Scaling blockchain poart II: Rollups by Dan Boneh
PPTX
Week4 lec1-bscs1
PPTX
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
PPT
Real time-embedded-system-lec-06
PDF
Interledger Protocol Stack Deep Dive @ Boston Interledger Meetup
PPTX
Parallel and distributed computing .pptx
PPTX
SSL And TLS
PDF
Fluent destry saul
PPT
ch_02n1111111111111111111111111111111111111111111111111.ppt
PPTX
3.1 Transport Layer Presentationsss.pptx
PPTX
OOP Lecture 24-Network Programming-Part1.pptx
PDF
Telnet
PPTX
Transport layer.pptx
TRANSPORT LAYER ppt.pptx
Bitcoin lightning network and ethereum protocols
Network protocols
From Stream to Screen: Real-Time Data Streaming to Web Frontends with Conflue...
RC Car detailed analysis
Encode x StarkNet Autumn Hackathon: Aave Ethereum / StarkNet Bridge
Scaling blockchain poart II: Rollups by Dan Boneh
Week4 lec1-bscs1
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
Real time-embedded-system-lec-06
Interledger Protocol Stack Deep Dive @ Boston Interledger Meetup
Parallel and distributed computing .pptx
SSL And TLS
Fluent destry saul
ch_02n1111111111111111111111111111111111111111111111111.ppt
3.1 Transport Layer Presentationsss.pptx
OOP Lecture 24-Network Programming-Part1.pptx
Telnet
Transport layer.pptx
Ad

More from TinaBregovi (20)

PPTX
Building LSD Use Cases on Bifrost
PPTX
Urbit Launch Event
PDF
Layer Hack: Boba Network: Understanding Hybrid Compute
PPTX
Layer Hack: zkSync - Intro to zkEVM
PDF
Rollup-as-a-service and why it matters to the next-gen of dApps
PPTX
Layer Hack: AltLayer Workshop
PPTX
Layer Hack Launch Event
PPTX
How To Build Better NFTs with Briq
PDF
NFTs on StarkNet
PDF
Braavos Wallet Workshop.pdf
PPTX
StarkNet Autumn Hackathon Launch Event.pptx
PPTX
Harmony Marketplace SDK.pptx
PPTX
Coinbase Node
PPTX
Get Ready for Coinbase Node
PPTX
MANIFOLD MEV Bounty Competition
PDF
Public SP Meeting
PDF
Ecosystem WG
PDF
Welcome to the Web 3.0
PDF
Introduction to IPFS & Filecoin - longer version
PPTX
Introduction to IPFS & Filecoin
Building LSD Use Cases on Bifrost
Urbit Launch Event
Layer Hack: Boba Network: Understanding Hybrid Compute
Layer Hack: zkSync - Intro to zkEVM
Rollup-as-a-service and why it matters to the next-gen of dApps
Layer Hack: AltLayer Workshop
Layer Hack Launch Event
How To Build Better NFTs with Briq
NFTs on StarkNet
Braavos Wallet Workshop.pdf
StarkNet Autumn Hackathon Launch Event.pptx
Harmony Marketplace SDK.pptx
Coinbase Node
Get Ready for Coinbase Node
MANIFOLD MEV Bounty Competition
Public SP Meeting
Ecosystem WG
Welcome to the Web 3.0
Introduction to IPFS & Filecoin - longer version
Introduction to IPFS & Filecoin
Ad

Recently uploaded (20)

PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
A Presentation on Touch Screen Technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Hybrid model detection and classification of lung cancer
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Encapsulation theory and applications.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
1. Introduction to Computer Programming.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
August Patch Tuesday
1 - Historical Antecedents, Social Consideration.pdf
Approach and Philosophy of On baking technology
A Presentation on Touch Screen Technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Tartificialntelligence_presentation.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Getting Started with Data Integration: FME Form 101
Hybrid model detection and classification of lung cancer
Programs and apps: productivity, graphics, security and other tools
Group 1 Presentation -Planning and Decision Making .pptx
Encapsulation theory and applications.pdf
Zenith AI: Advanced Artificial Intelligence
1. Introduction to Computer Programming.pptx
A comparative analysis of optical character recognition models for extracting...
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
A comparative study of natural language inference in Swahili using monolingua...
MIND Revenue Release Quarter 2 2025 Press Release
August Patch Tuesday

Bridging with StarkNet