Skip to main content
All Collectionsv3PerpetualsTechnical Details
v3 What is on-chain vs. off-chain?
v3 What is on-chain vs. off-chain?

Layer 2 on-chain vs. off-chain

J
Written by James Jia
Updated today

On-chain

The on-chain contract contains a mapping from Ethereum addresses to stark-keys, which is used as the off-chain identifier. This promises that if Alice withdraws money from an off-chain vault with a key that belongs to her, only she can actually control these funds on L1.


In addition, the on-chain contract naturally handles registering, depositing and withdrawing USDC from/to the system, and also contains the commitment to the full balance state of the system, found in L2.

Off-chain

The off-chain logic handles trades, liquidations, transfers and deleverages, as well as updating the oracle prices. It stores the entire balance of all the users, and periodically submit STARK proofs, attesting the validity of the balances change, given the user’s transactions.

You can read more about our authors here.

Did this answer your question?