Home

Awesome

DISCLAIMER

Hello Starknet community, this repository is not updated with the latest Cairo syntax and hence, we do not recommend to attempt this tutorial as of today. If you are interested in contributing to the repository to update the tutorial, please create a PR and tag me @gyan0890 on it and we will be happy to support you with the process.

A great resource to get you up to speed with the new Cairo syntax in a Starknet context is Chapter 2 of the Starknet Book.

You can also ping me(@gyanlakshmi) on Telegram to help you assign the right tasks.

StarkNet messaging bridge

Welcome! This is an automated workshop that will explain how to use the StarkNet L1 <-> L2 messaging bridge to create powerful cross layer applications.

It is aimed at developers that:

Introduction

How it works

The goal of this tutorial is for you to create and deploy contracts on StarkNet and Ethereum that will interact with each other. In other words, you will create your own L1 <-> L2 bridge.

Your progress will be check by an evaluator contract, deployed on StarkNet, which will grant you points in the form of ERC20 tokens, deployed at address 0x031d9e05ec67956acfec4768f7b302a56f8a256686fa077594f6dde40d5ca04c.

Another evaluator is deployed on L1 (evaluator contract). It will check your work on L1, and send back instructions to the L2 evaluator to credit you points on L2.

Each exercise will allow you to explore the Starknet messaging bridge in a step by step way. Be sure to check both sides of the exercice - on L1 and L2.

Getting ready to work

Evaluators addresses

Working on the tutorial

L2 -> L1 communication takes ~30 mins so it is recommended to complete the L2 -> L1 part with care, and then start working on the next exercice while the message is passed.

Exercises & Contract addresses

Tasks list

Exercise 1 - Send an L1→L2 message with an existing contract (2 pts)

Exercise 2 - Send an L2→L1 message with an existing contract (2 pts)

Exercise 3 - Send an L1→L2 message with your own contract (2 pts)

Exercise 4 - Send an L2→L1 message with existing contracts (2 pts)

Exercise 5 - Receive an L1→L2 message with your own contract (2 pts)

Exercise 6 - Receive an L2→L1 message with existing contracts (2 pts)

Annex - Useful tools and ressources

Checking your progress & counting your points

​ Your points will get credited in your wallet! Add token 0x031d9e05ec67956acfec4768f7b302a56f8a256686fa077594f6dde40d5ca04c and check from time to time. ​

Articles & documentation

Disclaimer

​ Don't expect any kind of benefit from using this, other than learning a bunch of cool stuff about StarkNet, the first general purpose validity rollup on the Ethereum Mainnnet. ​ StarkNet is still in Alpha. This means that development is ongoing, and the paint is not dry everywhere. Things will get better, and in the meanwhile, we make things work with a bit of duct tape here and there! ​

Where am I?

This workshop is the fourth in a series aimed at teaching how to build on StarkNet. Checkout out the following:

TopicGitHub repo
Learn how to read Cairo codeCairo 101
Deploy and customize an ERC721 NFTStarkNet ERC721
Deploy and customize an ERC20 tokenStarkNet ERC20
Build a cross layer application (you are here)StarkNet messaging bridge
Debug your Cairo contracts easilyStarkNet debug
Design your own account contractStarkNet account abstraction

Providing feedback & getting help

Once you are done working on this tutorial, your feedback would be greatly appreciated!

Please fill out this form to let us know what we can do to make it better.

​ And if you struggle to move forward, do let us know! This workshop is meant to be as accessible as possible; we want to know if it's not the case.

​ Do you have a question? Join our Discord server, register, and join channel #tutorials-support ​

Contributing

This project can be made better and will evolve as StarkNet matures. Your contributions are welcome! Here are things that you can do to help: