Skip to content

Commit 0764aed

Browse files
sarahschwartzkaymominuF4No
authored
feat: add zksync os dev preview section (#433)
Adds a new section in the zksync-network docs with an overview of ZKsync OS, network details, quickstart, and FAQ. Also adds the network to the chains list - ~~depends on matter-labs/docs-nuxt-template#116 to add support for MM button~~ - ~~waiting for block explorer URL~~ - missing contract verification url --------- Co-authored-by: krinza.eth <[email protected]> Co-authored-by: Antonio <[email protected]>
1 parent eeb59ca commit 0764aed

File tree

27 files changed

+1327
-6
lines changed

27 files changed

+1327
-6
lines changed

bun.lockb

0 Bytes
Binary file not shown.

components/ZksyncEraNetworkDetails.vue

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<template>
22
<div class="space-y-6">
33
<!-- Mainnet Details -->
4-
<div class="not-prose overflow-x-auto">
4+
<div
5+
v-if="!props.showzksyncos"
6+
class="not-prose overflow-x-auto"
7+
>
58
<UTable
69
:columns="columns"
710
:rows="mainnetDetails"
@@ -53,7 +56,7 @@
5356
<div class="not-prose overflow-x-auto">
5457
<UTable
5558
:columns="columns"
56-
:rows="testnetDetails"
59+
:rows="props.showzksyncos ? zksyncOSTestnetDetails : testnetDetails"
5760
class="min-w-full divide-y divide-gray-200 rounded-lg border border-gray-200 dark:divide-gray-700 dark:border-gray-700"
5861
:ui="{
5962
table: 'w-full table-auto',
@@ -109,6 +112,10 @@ interface NetworkDetail {
109112
isLink?: boolean;
110113
}
111114
115+
const props = defineProps<{
116+
showzksyncos?: boolean;
117+
}>();
118+
112119
const columns = [
113120
{
114121
key: 'property',
@@ -147,4 +154,22 @@ const testnetDetails: NetworkDetail[] = [
147154
isCopyable: true,
148155
},
149156
];
157+
158+
const zksyncOSTestnetDetails: NetworkDetail[] = [
159+
{ property: 'Network Name', value: 'ZKsync OS Devnet', isCode: true },
160+
{ property: 'RPC URL', value: 'https://zksync-os-testnet-alpha.zksync.dev/', isCopyable: true },
161+
{ property: 'WebSocket URL', value: 'wss://zksync-os-testnet-alpha.zksync.dev/ws', isCopyable: true },
162+
{ property: 'Chain ID', value: '8022833', isCode: true },
163+
{ property: 'Currency Symbol', value: 'ETH', isCode: true },
164+
{
165+
property: 'Block Explorer URL',
166+
value: 'https://zksync-os-testnet-alpha.staging-scan-v2.zksync.dev/',
167+
isLink: true,
168+
},
169+
{
170+
property: 'Explorer Verification API',
171+
value: '(coming soon)',
172+
isCopyable: false,
173+
},
174+
];
150175
</script>

content/00.zksync-network/20.environment/03.zksync-era.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ To manually add ZKsync Era as a custom network in your wallet, follow these step
2121

2222
### Network details
2323

24-
::zksync-era-network-details
25-
::
24+
:zksync-era-network-details
2625

2726
## Get testnet funds for your wallet
2827

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: Overview
3+
description: Get started learning about ZKsync OS.
4+
---
5+
6+
ZKsync OS is the modular execution layer of the ZKsync stack. It defines the system-level state transition function of a chain
7+
and supports multiple execution environments (VMs).
8+
9+
Unlike earlier implementations, ZKsync OS separates execution from proving,
10+
making both layers independently upgradable and easier to optimize. This design improves performance, ensures EVM equivalence, and enables
11+
new execution environments to be added for application-specific use cases.
12+
13+
## Architecture
14+
15+
The core of the protocol is built around a two-layer architecture:
16+
17+
- a modular execution layer,
18+
- and the proving layer.
19+
20+
The execution layer defines the logic of execution, memory handling, and IO. It takes block data and an initial state as input
21+
and computes the new state after the block is applied. The proving layer then generates validity proofs of this state transition.
22+
23+
ZKsync OS is implemented in Rust and compiled to two targets. The **x86 target** is used by the sequencer to run execution directly,
24+
while the **RISC-V target** is provided to the ZKsync Airbender prover to generate proofs of correctness. This ensures consistency between
25+
the sequencer’s runtime behavior and the proof system, while keeping execution and proving cleanly separated.
26+
27+
By isolating these layers, ZKsync OS makes it possible to evolve execution logic independently from the prover.
28+
This separation also shifts focus to the execution layer, an area often neglected in rollup design. While many efforts
29+
in the ecosystem concentrate on prover efficiency, ZKsync OS demonstrates that significant performance gains can also be
30+
achieved by optimizing how execution itself is structured.
31+
32+
## Components of ZKsync OS
33+
34+
The main components of ZKsync OS are:
35+
36+
1. **[Bootloader](/zksync-protocol/zksyncos/bootloader):** The entry point program. It initializes the system and then runs transactions using two
37+
components: the system and the execution environment interpreters.
38+
39+
2. **[Execution Environments](/zksync-protocol/zksyncos/execution-environment):** Regular interpreters that take bytecode,
40+
calldata, resources (similar to gas) and some other call context values as its input. Interpreters are instantiated with some local state to execute
41+
a frame. When an interpreter sees a call to another contract, return/revert from current frame, or contract
42+
creation it triggers special functionality to process it, as a potentially different interpreter should be run.
43+
44+
ZKsync OS will initially only support EVM.
45+
In the future, it will include the following EEs:
46+
47+
- **EVM:** Provides full native EVM-equivalence to ZKsync.
48+
- **WASM:** Allows ZKsync to support contracts written in any language that compiles to WASM (e.g. Rust).
49+
- **Native RISC-V:** User-mode RISC V code execution unlocks highest proving performance due to not having any interpretation overhead.
50+
51+
<!-- markdownlint-disable -->
52+
3. **[System](/zksync-protocol/zksyncos/system):** Common for all environments and the bootloader. Provides an abstract interface for low level
53+
handling of IO (storage, events, L1 messages, oracles) and memory management. The system communicates with the
54+
external oracle (non-determinism source), which is needed to read block data, and also for some IO operations,
55+
e.g. to perform the initial read for a storage slot.
56+
57+
::centered-container
58+
![zksyncOS.png](/images/zksyncos-airbender/zksyncOS.png)
59+
::
60+
61+
This modular design enables us to isolate a minimal interface required to implement an Execution Environment.
62+
In addition, the system abstraction makes the storage model customizable and allows for different instances of the entire system.
63+
64+
## System Design Goals
65+
66+
The design of ZKsync OS focuses on delivering high throughput and low cost.
67+
The Rust implementation enables low-level optimizations for memory access,
68+
IO, and execution paths, ensuring that performance can scale in line with network demands.
69+
70+
ZKsync OS serves as the foundation of the Elastic Network. For builders, it offers full EVM equivalence and tooling,
71+
while also unlocking new programming models through WASM and RISC-V.
72+
73+
For users, ZKsync OS provides a consistent experience across chains, with security underpinned by ZK proofs.
74+
And for the broader ecosystem, its modular design allows for application-specific specialization without fragmentation,
75+
while maintaining interoperability across all ZKsync Stack chains.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: ZKsync OS Network
3+
description: Get connected to ZKsync OS Devnet
4+
---
5+
6+
## Add ZKsync OS Devnet to your MetaMask wallet
7+
8+
You can add ZKsync OS Devnet to your MetaMask wallet using the buttons below:
9+
10+
<!-- // cspell: disable -->
11+
:network-adder{ network="ostestnet" }
12+
<!-- // cspell: enable -->
13+
14+
If you are using a different in-browser wallet, the buttons above may also work for them.
15+
16+
## Manually add ZKsync OS Devnet
17+
18+
To manually add ZKsync OS Devnet as a custom network in your wallet, follow these steps:
19+
20+
1. Find the “Add Network” option in your wallet (in MetaMask, you can find this in the networks dropdown).
21+
1. Click on “Add Network" and "Add network manually".
22+
1. Fill in the following details for the ZKsync OS Devnet environment:
23+
24+
### Network details
25+
26+
<!-- // cspell: disable -->
27+
:zksync-era-network-details{showzksyncos}
28+
<!-- // cspell: enable -->
29+
30+
## Get devnet funds for your wallet
31+
32+
Once you have your wallet connected to the ZKsync OS Devnet environment,
33+
you can bridge testnet ETH from Sepolia Testnet to ZKsync OS Devnet.
34+
You can get testnet funds from one of many [testnet faucets](/zksync-network/ecosystem/network-faucets#sepolia-faucets).
35+
36+
### Bridging testnet ETH
37+
38+
The ZKsync portal is not yet updated to support ZKsync OS.
39+
Until then, you can use `cast` or `zksync-sdk` to manually bridge funds over as shown in the examples below:
40+
41+
#### Bridging with `cast`
42+
43+
<!-- // cspell: disable -->
44+
```bash
45+
export BRIDGEHUB_ADDRESS=0xc4fd2580c3487bba18d63f50301020132342fdbd
46+
export CHAIN_ID=8022833
47+
export SEPOLIA_RPC=<YOUR_SEPOLIA_RPC_ENDPOINT>
48+
export ZKOS_DEVNET_RPC=https://zksync-os-testnet-alpha.zksync.dev/
49+
export ADDRESS=<YOUR_WALLET_ADDRESS>
50+
export VALUE_TO_BRIDGE=<AMOUNT_TO_BRIDGE_IN_WEI>
51+
```
52+
<!-- // cspell: enable -->
53+
54+
```bash
55+
cast send -r $SEPOLIA_RPC $BRIDGEHUB_ADDRESS "requestL2TransactionDirect((uint256,uint256,address,uint256,bytes,uint256,uint256,bytes[],address))" "($CHAIN_ID,$VALUE_TO_BRIDGE,$ADDRESS,50,0x,300000,800,[],$ADDRESS)" --value $VALUE_TO_BRIDGE --private-key=$PRIVATE_KEY
56+
```
57+
58+
#### Bridging with `@zksync-sdk`
59+
60+
You can find examples for bridging with `ethers` or `viem` in the [`@zksync-sdk` docs](https://dutterbutter.github.io/zksync-sdk/overview/index.html).
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Developer Quickstart
3+
description: Getting starting developing with ZKsync OS
4+
---
5+
6+
You can use all standard EVM tooling for ZKsync OS.
7+
8+
To get started with Hardhat, follow the steps below:
9+
10+
::content-switcher
11+
---
12+
items: [{
13+
label: 'Hardhat 3 with Viem',
14+
partial: '_partials/_viem'
15+
}, {
16+
label: 'Hardhat 3 with Ethers',
17+
partial: '_partials/_ethers'
18+
}]
19+
---
20+
::
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
title: FAQs
3+
description: Answers to frequently asked questions about ZKsync OS.
4+
---
5+
6+
## What are the main benefits of ZKsync OS?
7+
8+
The main benefits of ZKsync OS over the previous system include faster performance, higher TPS,
9+
the ability to support multiple execution environments,
10+
and the decoupling of the prover from execution to enable faster upgrades.
11+
12+
## What changes to development workflows will be required to use ZKsync OS?
13+
14+
Developers will be able to use standard EVM tooling and compilers for contract deployment and interaction
15+
instead of ZKsync-specific tooling and compilers like `zksolc` and `zkvyper`.
16+
17+
## For app developers, are there any differences from the Ethereum EVM?
18+
19+
ZKsync OS is fully EVM equivalent.
20+
Like with other EVM equivalent L2 solutions, there are a few distinctions that app developers should take note of:
21+
22+
- ZKsync OS will initially target Cancun for the first version.
23+
Support for Pectra will be added soon after.
24+
- ZKsync OS provides some additional L2-specific functionality like sending messages to the L1 and interoperability via [ZKsync Gateway](/zksync-protocol/gateway/overview).
25+
- ZKsync OS can charge additional gas at the end of a transaction to cover pubdata and some additional costs.
26+
This doesn’t affect the behavior of contracts,
27+
but can require higher gas limits / gas price.
28+
See the [Double Resource Accounting](https://docs.zksync.io/zksync-protocol/zksyncos/double-accounting) doc for more information.
29+
- A different state model is used.
30+
For app developers this only affects storage proofs.
31+
More details about the storage model can be found in the [`zksync-os` repository](https://github.com/matter-labs/zksync-os/blob/main/docs/system/io/io.md).
32+
- Blake2f (`0x09`) and KZG point evaluation (`0x0a`) precompiles are not yet supported.
33+
34+
## Is ZKsync OS replacing EraVM? Will existing chains upgrade to it?
35+
36+
Yes, ZKsync OS will replace EraVM for ZKsync chains.
37+
Eventually chains that use EraVM with the legacy system will be deprecated.
38+
39+
## If there are multiple execution environments, why can’t ZKsync OS run EraVM?
40+
41+
It is feasibly possible to run EraVM with ZKsync OS in the future.
42+
However, to enable chains to use ZKsync OS earlier, EVM was prioritized as the first and only execution environment for the initial version.
43+
44+
## What will it mean for projects that use native account abstraction on EraVM?
45+
46+
ZKsync OS will use EVM.
47+
EraVM and native EraVM account abstraction will not be supported.
48+
Any projects that currently rely on native account abstraction on EraVM that wish to switch to ZKsync OS must be migrated.
49+
50+
[ERC-4337](https://docs.erc4337.io/) will be supported with ZKsync OS.
51+
ZKsync SSO contracts will be upgraded for ERC-4337,
52+
so projects that rely of ZKsync SSO will be able to continue using it.
53+
54+
EIP-7702 will not be supported in the initial version of ZKsync OS, but will be in a later version.
55+
56+
## How can builders leverage any new features or capabilities?
57+
58+
In the initial version of ZKsync OS, capabilities will be similar to those of other EVM L2 chains.
59+
However, in the future support for multiple execution environments
60+
will enable builders to use alternative programming languages to write smart contracts.
61+
62+
## Will chains that use ZKsync OS be able to use interop and Gateway?
63+
64+
Yes, chains that use ZKsync OS will also be able to use ZKsync Gateway and interop.
65+
66+
## Does ZKsync OS change what stage ZKsync chains are at?
67+
68+
No, on its own chains that use ZKsync OS will not affect their stage level.
69+
However, it may make it easier to move to stages 1 and 2 because improvements to the prover can be deployed more efficiently.
70+
71+
## Is there a public testnet and mainnet?
72+
73+
A public devnet is live and ready for testing.
74+
You can find the more information in this section of the docs for the [network details](/zksync-network/zksync-os/network-details)
75+
and [getting started](/zksync-network/zksync-os/quickstart) with development.
76+
Currently there is no public mainnet.
77+
78+
## How can I run it locally?
79+
80+
Running a ZKsync OS chain is not yet supported using `zkstack`.
81+
A full guide for running a ZKsync OS chain will be available soon.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
title: ZKsync OS Developer Preview
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Hardhat 3 with Ethers
3+
---
4+
5+
:display_partial{path="_partials/_zksyncos/_setup-folder"}
6+
7+
2. Initialize a new Hardhat 3 project with Mocha and Ethers.js. <!-- markdownlint-disable-line -->
8+
9+
```bash
10+
npx hardhat --init
11+
```
12+
13+
:display_partial{path="_partials/_zksyncos/_setup"}
14+
15+
7. Copy/paste the script below. <!-- markdownlint-disable-line -->
16+
17+
```ts [increment.ts]
18+
:code-import{filePath="zksync-os/scripts/increment-ethers.ts"}
19+
```
20+
21+
:display_partial{path="_partials/_zksyncos/_run-script"}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Hardhat 3 with Viem
3+
---
4+
5+
:display_partial{path="_partials/_zksyncos/_setup-folder"}
6+
7+
2. Initialize a new Hardhat 3 project with Node Test Runner and Viem. <!-- markdownlint-disable-line -->
8+
9+
```bash
10+
npx hardhat --init
11+
```
12+
13+
:display_partial{path="_partials/_zksyncos/_setup"}
14+
15+
7. Copy/paste the script below. <!-- markdownlint-disable-line -->
16+
17+
```ts [increment.ts]
18+
:code-import{filePath="zksync-os/scripts/increment-viem.ts"}
19+
```
20+
21+
:display_partial{path="_partials/_zksyncos/_run-script"}

0 commit comments

Comments
 (0)