Skip to content

Commit aec47ad

Browse files
yvonneno1gitbook-bot
authored andcommitted
GITBOOK-40: change request with no subject merged in GitBook
1 parent a7da8c7 commit aec47ad

File tree

7 files changed

+54
-39
lines changed

7 files changed

+54
-39
lines changed
Lines changed: 16 additions & 0 deletions
Loading

networks/testnet_addresses.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
# Testnet: dApps & Deployment Addresses
1+
# Testnet
22

3+
{% tabs %}
4+
{% tab title="ZKEX" %}
35
`Deploy Time`: May-15-2023 03:09:23 AM +UTC
46

57
`Tag`: `Latest`
68

79
`zkLink Version`: [027ccd51356fbefbd98c7d1c8d09975f7728d29a](https://github.com/zkLinkProtocol/zklink-periphery/commit/027ccd51356fbefbd98c7d1c8d09975f7728d29a)
810

911
<table><thead><tr><th width="242">Network</th><th>Contract Address</th></tr></thead><tbody><tr><td>Goerli Testnet</td><td><a href="https://goerli.etherscan.io/address/0xC668dE72C9eb10870D52E618A44f4182d428825e">0xC668dE72C9eb10870D52E618A44f4182d428825e</a></td></tr><tr><td>zkSync Era Testnet</td><td><a href="https://goerli.explorer.zksync.io/address/0xa2e2Bc5ce03443BeC5094cEd04BF8E0EC887aDC9">0xa2e2Bc5ce03443BeC5094cEd04BF8E0EC887aDC9</a></td></tr><tr><td>Scroll Alpha Testnet</td><td><a href="https://blockscout.scroll.io/address/0x378de89c13df5e428d9f1edff4ae305764d592e2">0x378de89c13df5e428d9f1edff4ae305764d592e2</a></td></tr><tr><td>Linea Goerli Testnet</td><td><a href="https://explorer.goerli.linea.build/address/0x4931cb9e5fc58be00c5fd133d0961347f3406b86">0x4931cb9e5fc58be00c5fd133d0961347f3406b86</a></td></tr><tr><td>Bsc Testnet</td><td><a href="https://testnet.bscscan.com/address/0x0473ecc194462dd4010c6be0d1dac73e7ca9fc7f">0x0473ecc194462dd4010c6be0d1dac73e7ca9fc7f</a></td></tr><tr><td>Polygon Testnet</td><td><a href="https://mumbai.polygonscan.com/address/0x4d6f405639f4bcf3e58505ee0965ae2cb4201be3">0x4d6f405639f4bcf3e58505ee0965ae2cb4201be3</a></td></tr><tr><td>Avax Testnet</td><td><a href="https://testnet.snowtrace.io/address/0x2096eAD9d82ca596Ca807e82b2D61c15aDCb5fFF">0x2096eAD9d82ca596Ca807e82b2D61c15aDCb5fFF</a></td></tr></tbody></table>
12+
{% endtab %}
13+
{% endtabs %}
1014

1115
***
1216

17+
<img src="../.gitbook/assets/file.excalidraw.svg" alt="" class="gitbook-drawing">
18+
1319
`Deploy Time`: Apr-28-2023 05:37:24 AM +UTC
1420

1521
`Tag`: `Dunkirk`

networks/testnet_networks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
> 💡Multiple dApps may share one network, and one dApp may have multiple versions in different networks.
44
5-
<table><thead><tr><th width="199">Network</th><th width="95">ChainId</th><th>Supported</th><th width="96">Dunkirk</th><th width="88">Deposit Confirmations</th><th>Comment</th></tr></thead><tbody><tr><td>Goerli Testnet</td><td>5</td><td><mark style="color:green;">✔</mark></td><td><mark style="color:green;">✔</mark></td><td>30</td><td>--</td></tr><tr><td>zkSync Era Testnet</td><td>280</td><td>Compressed Mode Only</td><td><mark style="color:green;">✔</mark></td><td>30</td><td>--</td></tr><tr><td>Scroll Alpha Testnet</td><td>534353</td><td><mark style="color:red;">✖</mark></td><td><mark style="color:red;">✖</mark></td><td>30</td><td>Lack of support for Sha2-256</td></tr><tr><td>Linea Goerli Testnet</td><td>59140</td><td><mark style="color:green;">✔</mark></td><td><mark style="color:green;">✔</mark></td><td>30</td><td>--</td></tr><tr><td>Bsc Testnet</td><td>97</td><td><mark style="color:green;">✔</mark></td><td><mark style="color:green;">✔</mark></td><td>30</td><td>--</td></tr><tr><td>Polygon Testnet</td><td>80001</td><td><mark style="color:green;">✔</mark></td><td><mark style="color:green;">✔</mark></td><td>30</td><td>--</td></tr><tr><td>Avax Testnet</td><td>43113</td><td><mark style="color:green;">✔</mark></td><td><mark style="color:green;">✔</mark></td><td>30</td><td>--</td></tr><tr><td>StarkNet</td><td>--</td><td><mark style="color:red;">✖</mark></td><td><mark style="color:red;">✖</mark></td><td>30</td><td>Under development</td></tr><tr><td>Polygon zkEVM</td><td>1101</td><td><mark style="color:red;">✖</mark></td><td><mark style="color:red;">✖</mark></td><td>30</td><td>Lack of support for Sha2-256</td></tr></tbody></table>
5+
<table><thead><tr><th width="151">Network</th><th width="95">ChainId</th><th width="130">Supported</th><th width="92">Dunkirk</th><th width="102">Deposit Confirmations</th><th>Comment</th></tr></thead><tbody><tr><td>Goerli Testnet</td><td>5</td><td><mark style="color:green;">✔</mark></td><td><mark style="color:green;">✔</mark></td><td>30</td><td>--</td></tr><tr><td>zkSync Era Testnet</td><td>280</td><td>Compressed Mode Only</td><td><mark style="color:green;">✔</mark></td><td>30</td><td>--</td></tr><tr><td>Scroll Alpha Testnet</td><td>534353</td><td><mark style="color:red;">✖</mark></td><td><mark style="color:red;">✖</mark></td><td>30</td><td>Lack of support for Sha2-256</td></tr><tr><td>Linea Goerli Testnet</td><td>59140</td><td><mark style="color:green;">✔</mark></td><td><mark style="color:green;">✔</mark></td><td>30</td><td>--</td></tr><tr><td>Bsc Testnet</td><td>97</td><td><mark style="color:green;">✔</mark></td><td><mark style="color:green;">✔</mark></td><td>30</td><td>--</td></tr><tr><td>Polygon Testnet</td><td>80001</td><td><mark style="color:green;">✔</mark></td><td><mark style="color:green;">✔</mark></td><td>30</td><td>--</td></tr><tr><td>Avax Testnet</td><td>43113</td><td><mark style="color:green;">✔</mark></td><td><mark style="color:green;">✔</mark></td><td>30</td><td>--</td></tr><tr><td>StarkNet</td><td>--</td><td><mark style="color:red;">✖</mark></td><td><mark style="color:red;">✖</mark></td><td>30</td><td>Under development</td></tr><tr><td>Polygon zkEVM</td><td>1101</td><td><mark style="color:red;">✖</mark></td><td><mark style="color:red;">✖</mark></td><td>30</td><td>Lack of support for Sha2-256</td></tr></tbody></table>
66

streamline/deposit.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ zkLink supports account abstraction (AA) wallets and externally owned account (E
1818
3. AA wallet on EVM
1919
4. AA wallet on nonEVM
2020

21-
#### **Thus the accordingly call functions are as followed:**
21+
## **Deposit Functions**
2222

23-
A: directly call zkLink deposit function
23+
#### **The accordingly call functions are as followed:**
24+
25+
`A: directly call zkLink deposit function`
2426

2527
Note: supports both AA wallets and EOA wallets; it is required that the from\_address can directly sign zkLink deposit transactions.
2628

27-
B: call transfer to user AA wallet
29+
`B: call transfer to user AA wallet`
2830

2931
Note: supports AA wallets that adopt the zkLink auto transfer function only, such as UniPass.
3032

31-
C: call transfer to proxy deposit contract, and then automatically deposit to zkLink contract
33+
`C: call transfer to proxy deposit contract, and then automatically deposit to zkLink contract`
3234

3335
Example scenarios:
3436

@@ -37,15 +39,13 @@ Example scenarios:
3739

3840
![Proxy Deposit Flow](../img/proxy\_deposit\_flow.png)
3941

40-
41-
4242
## Exhaustive Scenarios
4343

44-
<table><thead><tr><th width="255"></th><th width="113"></th><th width="149" align="center">Receiver Address</th><th width="100"></th><th></th><th></th></tr></thead><tbody><tr><td></td><td></td><td align="center">AA Wallet - EVM (20 bytes)</td><td>AA Wallet - nonEVM (Starknet 32 bytes)</td><td>EOA EVM (20 bytes)</td><td>EOA nonEVM (32 bytes)</td></tr><tr><td>Sender Address</td><td>EOA - EVM</td><td align="center">ABC</td><td>AC</td><td>AC</td><td>AC</td></tr><tr><td>EOA - nonEVM</td><td>AC</td><td align="center">ABC</td><td>AC</td><td>AC</td><td></td></tr><tr><td>owned AA Wallet - EVM</td><td>ABC</td><td align="center">AC</td><td>AC</td><td>AC</td><td></td></tr><tr><td>owned AA Wallet - nonEVM</td><td>AC</td><td align="center">ABC</td><td>AC</td><td>AC</td><td></td></tr><tr><td>CEX - EVM</td><td>BC</td><td align="center">C</td><td>C</td><td>C</td><td></td></tr><tr><td>CEX - nonEVM</td><td>C</td><td align="center">BC</td><td>C</td><td>C</td><td></td></tr></tbody></table>
44+
<table data-header-hidden><thead><tr><th width="256"></th><th width="113"></th><th width="149" align="center"></th><th width="100"></th><th></th></tr></thead><tbody><tr><td></td><td>AA Wallet - EVM (20 bytes)</td><td align="center">AA Wallet - nonEVM (Starknet 32 bytes)</td><td>EOA EVM (20 bytes)</td><td>EOA nonEVM (32 bytes)</td></tr><tr><td>EOA - EVM</td><td>ABC</td><td align="center">AC</td><td>AC</td><td>AC</td></tr><tr><td>EOA - nonEVM</td><td>AC</td><td align="center">ABC</td><td>AC</td><td>AC</td></tr><tr><td>owned AA Wallet - EVM</td><td>ABC</td><td align="center">AC</td><td>AC</td><td>AC</td></tr><tr><td>owned AA Wallet - nonEVM</td><td>AC</td><td align="center">ABC</td><td>AC</td><td>AC</td></tr><tr><td>CEX - EVM</td><td>BC</td><td align="center">C</td><td>C</td><td>C</td></tr><tr><td>CEX - nonEVM</td><td>C</td><td align="center">BC</td><td>C</td><td>C</td></tr></tbody></table>
4545

4646
Below are 2 typical operational processes using [ZKEX.com](http://zkex.com/) as an example (the first dApp using zkLink infrastructure):
4747

48-
## Example 1
48+
### Example 1
4949

5050
A Unipass AA wallet user intends to deposit a Token (ABC) deployed on Ethereum from a CEX (such as Binance):
5151

@@ -55,22 +55,22 @@ Step 2: Copy the address to the Binance withdrawal page and await for approval f
5555

5656
Step 3: Wait for confirmation from zkex.
5757

58-
Note:
59-
58+
{% hint style="info" %}
6059
1. Since the Unipass AA wallet is compatible with proxy deposit and is deployed on the EVM (the same network with ABC), the deposit address copied to Binance is actually the Unipass AA wallet address.
6160
2. If the token ABC is deployed on StarkNet, which differs from the network of the user's AA wallet, then a proxy deposit contract address would be generated on Starknet to assist the ABC deposit.
6261
3. Why not directly call deposit on zkLink? This is because in many cases, the withdrawal address does not support user-defined contract calls (zklink deposit function), especially on CEXs, who generally only support the most basic transfer calls.
62+
{% endhint %}
6363

64-
## Example 2
64+
### Example 2
6565

6666
A MetaMask user intends to deposit the token ABC on EVM from its MetaMask address:
6767

6868
Step 1: On the zkex deposit page, locate ABC and select "Personal Wallet" as the fund source (it may vary if it is a deposit from CEX). Enter the amount, sign in MetaMask, and call zkLink deposit function;
6969

7070
Step 2: Only wait for the deposit transaction to be submitted and confirmed on-chain (it required 36 block on Ethereum).
7171

72-
Note:
73-
72+
{% hint style="info" %}
7473
1. A user may deposit to ZKEX from another MetaMask address. In this case, ZKEX can provide a separate deposit page to assist in signing the zkLink deposit with a third address.
7574
2. If the token is deployed on a non EVM-compatible network, the deposit will need to go through a proxy deposit contract.
75+
{% endhint %}
7676

streamline/wallet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> 💡Account abstraction unifies contract accounts and EOAs. Integrating AA wallets brings better user experience to dApps built on top of zkLink. Smart contract wallets are much more flexible than EOAs, allowing users to control their accounts by smart contract rather than simply a private key, and to define their account logic such as permission controls, transaction limits, wallet recovery, etc,.
44
5-
> Taking UniPass as an example, UniPass offers a user-friendly experience for managing smart contract wallets using email and password. We believe this is crucial for users who are not yet familiar with crypto.
5+
Taking UniPass as an example, UniPass offers a user-friendly experience for managing smart contract wallets using email and password. We believe this is crucial for users who are not yet familiar with crypto.
66

77
## Required Conditions
88

streamline/withdraw.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ There are 4 types of the withdraw function : withdraw, forced withdraw (permissi
66

77
<table><thead><tr><th width="137">Calls</th><th width="225">EVM Signature</th><th>NonEvm Signature</th><th>Comment</th></tr></thead><tbody><tr><td>Forced Withdraw</td><td>• <code>ECDSA</code>(<a href="https://en.bitcoin.it/wiki/Secp256k1">secp256k1</a>)</td><td>• <code>ECDSA</code>(<a href="https://docs.starkware.co/starkex/crypto/stark-curve.html">Stark Curve</a>)</td><td>On-chain transaction that needs to be initiated towards the according networks</td></tr><tr><td>Dunkirk Exit</td><td>• <code>ECDSA</code>(<a href="https://en.bitcoin.it/wiki/Secp256k1">secp256k1</a>)</td><td>• <code>ECDSA</code>(<a href="https://docs.starkware.co/starkex/crypto/stark-curve.html">Stark Curve</a>)</td><td>On-chain transaction that needs to be initiated towards the according networks</td></tr><tr><td>Withdraw</td><td>• <code>ECDSA</code>(<a href="https://eips.ethereum.org/EIPS/eip-712">EIP712</a>, <a href="https://en.bitcoin.it/wiki/Secp256k1">secp256k1</a>)<br>• <code>EDDSA</code>(<a href="https://docs.rs/sapling-crypto_ce/latest/sapling_crypto_ce/alt_babyjubjub/index.html">alt_babyjubjub</a>)</td><td>• <code>ECDSA</code> (<a href="https://docs.starkware.co/starkex/crypto/stark-curve.html">Stark Curve</a>) <br>• <code>EDDSA</code> (<a href="https://docs.rs/sapling-crypto_ce/latest/sapling_crypto_ce/alt_babyjubjub/index.html">alt_babyjubjub</a>)</td><td>zkLink L2 operation that requires two signatures: ECDSA for verification from dApp-end, and EDDSA for circuit verification</td></tr><tr><td>Proxy Withdraw</td><td>• <code>ECDSA</code>(<a href="https://eips.ethereum.org/EIPS/eip-712">EIP712</a>, <a href="https://en.bitcoin.it/wiki/Secp256k1">secp256k1</a>)<br>• <code>EDDSA</code>(<a href="https://docs.rs/sapling-crypto_ce/latest/sapling_crypto_ce/alt_babyjubjub/index.html">alt_babyjubjub</a>)</td><td>• <code>ECDSA</code> (<a href="https://docs.starkware.co/starkex/crypto/stark-curve.html">Stark Curve</a>)<br>• <code>EDDSA</code> (<a href="https://docs.rs/sapling-crypto_ce/latest/sapling_crypto_ce/alt_babyjubjub/index.html">alt_babyjubjub</a>)</td><td>zkLink L2 operation that requires two signatures: ECDSA for verification from dApp-end, and EDDSA for circuit verification</td></tr><tr><td>Comment</td><td>Ethereum, zkSync, Scroll, Linea, BSC, Polygon, Avalanche, etc,.</td><td>In the current version, the only non-EVM network that zkLink supports is Starknet</td><td></td></tr></tbody></table>
88

9-
**Note:**
10-
11-
* `proxy withdraw` applies to accounts that can not generate pubkeyhash. For example, a user mistakenly transfers tokens to a smart contract address that does not support pubkeyhash generation. To withdraw the token from Layer2 to Layer1 in such a case, a third party proxy is required to send the withdraw request. Noted that the to\_address must be THE smart contract address.
9+
{% hint style="info" %}
10+
`proxy withdraw` applies to accounts that can not generate pubkeyhash. For example, a user mistakenly transfers tokens to a smart contract address that does not support pubkeyhash generation. To withdraw the token from Layer2 to Layer1 in such a case, a third party proxy is required to send the withdraw request. Noted that the to\_address must be THE smart contract address.
11+
{% endhint %}
1212

1313
## Fast Withdraw
1414

@@ -18,10 +18,10 @@ zkLink verify contract supports Brokers to prepay the withdrawal to users as a s
1818

1919
The record of prepayment information is stored in Layer1 smart contracts. When a withdraw is zk\_verified on-chain, the according prepayment record will be checked in `accepts`; if it is included, the to\_address will be replaced with the broker address.
2020

21-
Note:
22-
21+
{% hint style="info" %}
2322
* The serial execution of the broker logic defined in the smart contract makes sure that: 1. multiple brokers cannot take the same fast withdraw request simultaneously; 2. a single request cannot be approved multiple times.
2423
* The broker records are stored in the contract. Once the prepayment is successfully executed, the broker will definitely receive the prepaid principal.
24+
{% endhint %}
2525

2626
```
2727
/// @dev Accept infos of fast withdraw of account

0 commit comments

Comments
 (0)