Node Operator
Search…
Configuring zkSync Payments
How to configure L2 Payments with zkSync

Background

Storj is continuously innovating to bring the decentralized cloud to the masses
We are excited to bring Layer 2 (L2) ethereum scaling through ZK Rollups to our community. L2 scaling aligns with our goal of bringing decentralized cloud storage to the masses - via more efficient and autonomous payments.
Here are a few of the benefits to receiving payouts through this approach:
Better Scalability With zkSync, payouts will consume less block space on the Ethereum network because transactions are bundled together and processed in batches. The system is currently capable of processing 2000 transactions per second!
Lower Layer 2 Transfer Fees ZkSync also dramatically lowers network transfer fees (compared to Layer 1 fees) for operators sharing their hard drive space and bandwidth on the Storj network. ZkSync accounts are tied to your existing Ethereum keys and current transaction fees on L2 are as low as ~0.000543 ETH at 210 Gwei. As the zkSync ecosystem grows, interoperability between projects and exchanges means even more savings. These fees can be reinvested in the community, creating new incentives for network operators to drive growth.
Pay Network Fees in STORJ Token One of the most interesting things about zkSync is it supports "gasless meta-transactions" that allow users to pay transaction fees in the tokens being transferred. For example, if you want to transfer STORJ from L2 to an exchange, smart contract, or other address, there is no need for you to own ETH or any other tokens.

Get Started and Opt-in

To opt-in to zkSync you need to do a simple change in your Node configuration by following these steps:
Open your storage node's config.yaml (see Where can I find the config.yaml?) and add the line
1
operator.wallet-features: ["zksync"]
Copied!
Please enter everything in lowercase and double-check for spelling mistakes. This is a very basic implementation without any validations.
Once you have added the line to your config file, save it and restart your node.
The change to the payment method will be indicated in your personal dashboard
After opting-in for zkSync payouts for STORJ payments, gather your ETH address and private key, navigate to the zkSync Wallet (https://wallet.zksync.io/), and connect your L1 ethereum wallet. If you have problems accessing your wallet, you might want to change your payout address to an address that you can access (for which you control the private keys).
Supported Wallets: zkSync supports WalletConnect, an open source protocol for connecting decentralized applications to mobile wallets. The protocol also supports hardware wallets like Trezor/Ledger and software wallets like Metamask, Fortmatic, Portis, Oper, Dapper, Lattice and Torus.
Finally, zkSync enables our Storage Node Operators to more easily interact directly with the world of DeFi through solutions like Curve, Numio, Uniswap V3, and others.
We are excited to share this update around payment scaling with our community of operators. If you have any questions about using zkSync, check out our documentation. If you have ideas, or would like to talk with the team, please feel free to reach out on our forum.

Understanding zkSync fees

Matter Labs runs an API for calculating transfer fees. Here's an example session to determine the Layer 2 to Layer 1 withdrawal fee:
1
curl -X POST -H 'Content-type: application/json' -d '{
2
"jsonrpc":"2.0",
3
"id":1, "method": "get_tx_fee",
4
"params": ["Withdraw", "0x80a52B7F26426d2b16578FC5f376c349F54772A7", "STORJ"]
5
}' https://api.zksync.io/jsrpc | jq
Copied!
Sample output:
1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"feeType": "Withdraw",
5
"gasTxAmount": "52700",
6
"gasPriceWei": "121000000437",
7
"gasFee": "3197359019",
8
"zkpFee": "1192017",
9
"totalFee": "3190000000"
10
},
11
"id": 1
12
}
Copied!
This tells us that at a gas price of approximately 121 GWei, the withdrawal fee is about 31.9 STORJ. Note that this is only an example, actual fees will vary depending on current STORJ-ETH exchange rates.
Here is an example of a Layer 2 to Layer 2 transfer fee:
1
curl -X POST -H 'Content-type: application/json' -d '{
2
"jsonrpc":"2.0",
3
"id":1, "method": "get_tx_fee",
4
"params": ["Transfer", "0x80a52B7F26426d2b16578FC5f376c349F54772A7", "STORJ"]
5
}' https://api.zksync.io/jsrpc | jq
Copied!
Sample output:
1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"feeType": "TransferToNew",
5
"gasTxAmount": "1980",
6
"gasPriceWei": "121000000437",
7
"gasFee": "120128480",
8
"zkpFee": "1192017",
9
"totalFee": "121300000"
10
},
11
"id": 1
12
}
Copied!
This tells us that at a gas price of approximately 121 Gwei, the transfer fee would be about 1.2 STORJ.
You can learn more in the zkSync Documentation.

Withdrawal from zkSync to L1

If you want to withdraw your tokens from your zkSync L2 wallet address to any L1 address, you need to reconnect your L1 ethereum wallet to zkSync with https://wallet.zksync.io/ - once connected, it will show your L2 token balance as shown below.
zkSync Wallet
Now click the Withdraw button.
You may see the account activation request if this is your first withdrawal.
Currently, zkSync requires users to pay a one-time registration fee of ~11000 gas for registering your address to zkSync, as this requires an on-chain transaction (you can elect to pay it with your STORJ tokens rather than ETH). This one-time fee should be eliminated in the near future.
    1.
    Authorize your account:
Authorize to Sign account activation
2. Sign the account activation:
Sign account activation
Then finally, you will see a window where you can select a destination L1 address to send the tokens to. By default the address will be your own L1 wallet address (which is the same as on L2), but you can change it to any other L1 address. For example, if you plan to immediately sell the tokens, you could choose an exchange's STORJ deposit address. This way you could directly withdraw STORJ from your L2 zkSync wallet address to an exchange deposit address in one single transaction.
This window also allows you to select which type of token to use to pay for the withdrawal fee, so you could choose STORJ in order to avoid spending eth for gas fees with the Change fee token button.
Withdraw to L1

Complete withdrawal to L1

    1.
    Replace the destination address with the one you want to send the tokens to. If you want to just withdraw to your own wallet address on L1, select it from your contacts list with the button Own account [v]. You can save the entered address to contacts later.
    2.
    Click the Select token button and select STORJ.
Select a token
3. Enter the amount you want to withdraw into the Amount field. You will see a withdrawal fee, one-time activation fee (only the first time you make a withdrawal), and the estimated fee values expressed USD.
Confirm Withdraw to L1
4. Confirm withdrawal by pressing the Withdraw to L1 button. You should be able to confirm the withdrawal transaction in History.
Last modified 5d ago