├── .commitlintrc.json ├── .editorconfig ├── .firebaserc ├── .github ├── semantic.yml ├── templates │ ├── ISSUE_TEMPLATE.md │ └── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── deploy-preview.yml │ ├── deploy-prod.yml │ ├── release.yml │ ├── secrets_scanner.yaml │ └── semantic-pr-title.yml ├── .gitignore ├── .husky ├── .gitignore ├── commit-msg └── pre-commit ├── .markdownlintignore ├── .markdownlintrc ├── .releaserc ├── .yarn └── releases │ └── yarn-3.2.0.cjs ├── .yarnrc.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── VuePress ├── cspell-zksync.txt ├── cspell.json ├── docs ├── .vuepress │ ├── config.ts │ ├── public │ │ ├── 100-days-to-mainnet.png │ │ ├── ABDK-ZKSync-Audit-v2-part1.pdf │ │ ├── ABDK-ZKSync-Audit-v2-part2.pdf │ │ ├── ABDK-ZkSync-Audit-v5.pdf │ │ ├── ABDK_ZkSync_V8.pdf │ │ ├── ABDK_ZkSync_V9.pdf │ │ ├── Activation-fee.png │ │ ├── D00.png │ │ ├── D1.png │ │ ├── D10.png │ │ ├── D2.png │ │ ├── D3.png │ │ ├── D5.png │ │ ├── D6.png │ │ ├── D7.png │ │ ├── D9.png │ │ ├── ERC20-approval.png │ │ ├── LogoHero.svg │ │ ├── Mainnet.png │ │ ├── S1-2.png │ │ ├── S1.png │ │ ├── S10.png │ │ ├── S11.png │ │ ├── S2.png │ │ ├── S3.png │ │ ├── S4.png │ │ ├── S5.png │ │ ├── S7.png │ │ ├── S8.1.png │ │ ├── S9.png │ │ ├── SE-Popup.png │ │ ├── SE1-2.png │ │ ├── Top-up-1.png │ │ ├── Top-up.png │ │ ├── a1.png │ │ ├── a3.png │ │ ├── a4.png │ │ ├── analytics.js │ │ ├── android-icon-144x144.png │ │ ├── android-icon-192x192.png │ │ ├── android-icon-36x36.png │ │ ├── android-icon-48x48.png │ │ ├── android-icon-72x72.png │ │ ├── android-icon-96x96.png │ │ ├── apiv02-docs.html │ │ ├── apple-icon-114x114.png │ │ ├── apple-icon-120x120.png │ │ ├── apple-icon-144x144.png │ │ ├── apple-icon-152x152.png │ │ ├── apple-icon-180x180.png │ │ ├── apple-icon-57x57.png │ │ ├── apple-icon-60x60.png │ │ ├── apple-icon-72x72.png │ │ ├── apple-icon-76x76.png │ │ ├── apple-icon-precomposed.png │ │ ├── apple-icon.png │ │ ├── authorize-mint.png │ │ ├── authorize-to-send-eth.png │ │ ├── authorize-to-send-zksync.png │ │ ├── bounty-table.png │ │ ├── chart.png │ │ ├── chart2.png │ │ ├── chart3.png │ │ ├── chart4.png │ │ ├── f1.svg │ │ ├── f2.svg │ │ ├── f3.svg │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── favicon.ico │ │ ├── favicon.png │ │ ├── hack.js │ │ ├── icon.png │ │ ├── int-txns.png │ │ ├── json.png │ │ ├── l2fees.png │ │ ├── logo.svg │ │ ├── m1.png │ │ ├── m10.png │ │ ├── m11.png │ │ ├── m2.png │ │ ├── m3.png │ │ ├── m4.png │ │ ├── m7.png │ │ ├── m8.png │ │ ├── mainnet_goerli_selection.png │ │ ├── ms-icon-144x144.png │ │ ├── ms-icon-150x150.png │ │ ├── ms-icon-310x310.png │ │ ├── ms-icon-70x70.png │ │ ├── nonce.png │ │ ├── robots.txt │ │ ├── scalability.png │ │ ├── se.png │ │ ├── se1.png │ │ ├── se2.png │ │ ├── se4.png │ │ ├── se6.png │ │ ├── se8.png │ │ ├── se9.png │ │ ├── social-image.png │ │ ├── social.jpg │ │ ├── zksync-1.0-audit.pdf │ │ ├── zksync1-2021-01-bug.png │ │ ├── zksync1-2021-01-fix.png │ │ └── zktools.png │ ├── styles │ │ ├── index.styl │ │ └── palette.styl │ └── theme │ │ ├── components │ │ └── Home.vue │ │ └── index.js ├── README.md ├── api │ ├── README.md │ ├── changelog │ │ └── README.md │ ├── environments │ │ └── README.md │ ├── events │ │ └── README.md │ ├── sdk │ │ ├── README.md │ │ ├── checkout │ │ │ ├── README.md │ │ │ ├── appendix-a │ │ │ │ └── README.md │ │ │ ├── checkout-manager │ │ │ │ └── README.md │ │ │ ├── constants │ │ │ │ └── README.md │ │ │ ├── protocol │ │ │ │ └── README.md │ │ │ ├── tutorial │ │ │ │ └── README.md │ │ │ └── types │ │ │ │ └── README.md │ │ ├── crypto │ │ │ └── README.md │ │ ├── dart │ │ │ └── README.md │ │ ├── java │ │ │ ├── README.md │ │ │ ├── interfaces │ │ │ │ └── README.md │ │ │ └── tutorial │ │ │ │ └── README.md │ │ ├── js │ │ │ ├── README.md │ │ │ ├── accounts │ │ │ │ └── README.md │ │ │ ├── browser-bundled │ │ │ │ └── README.md │ │ │ ├── nfts │ │ │ │ └── README.md │ │ │ ├── providers │ │ │ │ └── README.md │ │ │ ├── tutorial │ │ │ │ └── README.md │ │ │ ├── types │ │ │ │ └── README.md │ │ │ └── utils │ │ │ │ └── README.md │ │ ├── python │ │ │ ├── README.md │ │ │ └── tutorial │ │ │ │ └── README.md │ │ ├── rust │ │ │ ├── README.md │ │ │ └── tutorial │ │ │ │ └── README.md │ │ └── swift │ │ │ ├── README.md │ │ │ └── tutorial │ │ │ └── README.md │ ├── v0.1 │ │ └── README.md │ ├── v0.2 │ │ └── README.md │ └── web3-rpc │ │ └── README.md ├── dev │ ├── README.md │ ├── contracts │ │ └── README.md │ ├── events │ │ └── README.md │ ├── nfts │ │ └── README.md │ ├── payments │ │ ├── README.md │ │ ├── basic │ │ │ └── README.md │ │ └── sending_transactions │ │ │ └── README.md │ ├── security │ │ ├── README.md │ │ ├── ZKSYNC1-2021-01 │ │ │ └── README.md │ │ ├── approach │ │ │ └── README.md │ │ ├── bug-bounty │ │ │ └── README.md │ │ ├── bugs │ │ │ └── README.md │ │ └── disclosure │ │ │ └── README.md │ └── swaps │ │ └── README.md ├── maintenance │ └── README.md ├── service │ ├── down-night │ │ └── README.md │ ├── down │ │ └── README.md │ ├── testnet-down-night │ │ └── README.md │ └── testnet-down │ │ └── README.md ├── updates │ ├── 2020-06-19-report │ │ └── README.md │ ├── 2020-07-20-upgrade │ │ └── README.md │ ├── 2020-09-06-upgrade │ │ └── README.md │ ├── 2020-12-16-upgrade │ │ └── README.md │ ├── 2021-01-14-upgrade │ │ └── README.md │ ├── 2021-01-22-upgrade │ │ └── README.md │ ├── 2021-01-25-upgrade │ │ └── README.md │ ├── 2021-02-26-upgrade │ │ └── README.md │ ├── 2021-05-31-upgrade │ │ └── README.md │ ├── 2021-06-02-upgrade │ │ └── README.md │ ├── 2021-07-27-upgrade │ │ └── README.md │ ├── 2021-08-12-upgrade │ │ └── README.md │ ├── 2021-11-12-upgrade │ │ └── README.md │ ├── 2022-02-28-upgrade │ │ └── README.md │ ├── 2022-08-19-upgrade │ │ └── README.md │ └── security-audits │ │ └── README.md ├── uptime │ └── README.md ├── userdocs │ ├── README.md │ ├── decentralization │ │ └── README.md │ ├── faq │ │ └── README.md │ ├── intro │ │ └── README.md │ ├── learnbywatching │ │ └── README.md │ ├── privacy │ │ └── README.md │ ├── sc │ │ └── README.md │ ├── security │ │ └── README.md │ ├── status │ │ └── README.md │ ├── tech │ │ └── README.md │ ├── tokens │ │ └── README.md │ ├── tutorials │ │ └── README.md │ └── wallets │ │ └── README.md └── zkevm │ └── README.md ├── drafts ├── change_pubkey_batch.md ├── decent.md ├── functionality.md ├── functionality2.md ├── intro2.md ├── tech │ ├── README.md │ ├── plonk.md │ ├── redshift.md │ ├── zkp.md │ └── zkrollup.md ├── user │ └── README.md └── why.md ├── firebase.json ├── package.json └── yarn.lock /.commitlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "@commitlint/config-conventional" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "zksync-web-docs" 4 | }, 5 | "targets": { 6 | "zksync-web-docs": { 7 | "hosting": { 8 | "prod": [ 9 | "zksync-web-docs" 10 | ], 11 | "staging": [ 12 | "staging-docs-zksync" 13 | ] 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /.github/semantic.yml: -------------------------------------------------------------------------------- 1 | # Always validate the PR title AND all the commits 2 | titleAndCommits: true 3 | # Allows use of Merge commits (e.g. on GitHub: "Merge branch 'master' into feature/ride-unicorns") 4 | # this is only relevant when using commitsOnly: true (or titleAndCommits: true) 5 | allowMergeCommits: true 6 | -------------------------------------------------------------------------------- /.github/templates/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 🧾 Expected Behaviour 4 | 5 | 6 | 7 | 🔨 Current Behaviour 8 | 9 | 10 | 11 | ## 🙋‍️ Possible Solution [optional] 12 | 13 | 14 | 15 | ## 📝 Steps to Reproduce (for bugs) 16 | 17 | 1.2.3.4. 18 | 19 | ## 🖥 Context 20 | 21 | 22 | 23 | ## 🔩 Your Environment 24 | 25 | 26 | 27 | * Version used: 28 | * Browser Name and version: 29 | * Operating System and version (desktop or mobile): 30 | 31 | > Link to your issue / project: 32 | 33 | 34 | ## ✅ Acceptance criteria 35 | -------------------------------------------------------------------------------- /.github/templates/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description 4 | 5 | 6 | ## Motivation and Context 7 | 8 | 9 | 10 | ## How Has This Been Tested? 11 | 12 | 13 | 14 | 15 | ## Screenshots (if appropriate): 16 | 17 | ## Types of changes 18 | 19 | - [ ] Bug fix (non-breaking change which fixes an issue) 20 | - [ ] New feature (non-breaking change which adds functionality) 21 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 22 | 23 | ## Checklist: 24 | 25 | 26 | - [ ] My code follows the code style of this project. 27 | - [ ] My change requires a change to the documentation. 28 | - [ ] I have updated the documentation accordingly. 29 | - [ ] I have read the **CONTRIBUTING** document. 30 | - [ ] I have added tests to cover my changes. 31 | - [ ] All new and existing tests passed. 32 | -------------------------------------------------------------------------------- /.github/workflows/deploy-preview.yml: -------------------------------------------------------------------------------- 1 | name: "Deploy preview" 2 | 3 | concurrency: 4 | group: deploy-pr-${{ github.ref }} 5 | cancel-in-progress: true 6 | 7 | on: pull_request 8 | jobs: 9 | build_and_preview: 10 | if: ${{ github.event.repository.full_name == github.repository }} && ${{ github.repository }} == "matter-labs/zksync-lite-docs" || ${{ github.event.pull_request.base.repo.full_name == github.repository }} 11 | runs-on: ubuntu-latest 12 | environment: dev 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: "Install dependencies" 17 | run: | 18 | yarn set version 3.2.0 19 | yarn install 20 | 21 | - name: "Enable yarn cache" 22 | uses: c-hive/gha-yarn-cache@v2 # using cache 23 | 24 | - name: "Setup node@14" 25 | uses: actions/setup-node@v2 26 | with: 27 | node-version: 18 28 | 29 | - name: "Install dependencies" 30 | run: | 31 | yarn set version 3.2.0 32 | yarn install 33 | 34 | - name: "Run linters (markdownlint & cspell)" 35 | run: yarn ci:lint 36 | 37 | - name: "Deploy preview" 38 | run: yarn docs:build 39 | - uses: matter-labs/action-hosting-deploy@main 40 | with: 41 | firebaseToolsVersion: 12.9.1 42 | repoToken: "${{ secrets.GITHUB_TOKEN }}" 43 | firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_WEB_DOCS_PROD }}" 44 | projectId: zksync-web-docs 45 | channelId: "v-${{ github.ref }}" 46 | -------------------------------------------------------------------------------- /.github/workflows/deploy-prod.yml: -------------------------------------------------------------------------------- 1 | name: "Deploy production" 2 | 3 | concurrency: 4 | group: deploy-production 5 | cancel-in-progress: true 6 | 7 | on: 8 | workflow_dispatch: 9 | inputs: 10 | version: 11 | type: string 12 | description: "A release version to deploy, e.g. 1.0.0" 13 | required: true 14 | default: "1.0.0" 15 | jobs: 16 | deploy: 17 | runs-on: ubuntu-latest 18 | environment: prod 19 | steps: 20 | - name: Download Dist package 21 | uses: dsaltares/fetch-gh-release-asset@master 22 | with: 23 | version: "tags/${{ github.event.inputs.version }}" 24 | file: "dist.zip" 25 | target: "dist.zip" 26 | token: ${{ secrets.GITHUB_TOKEN }} 27 | 28 | - name: Unzip Dist package 29 | run: unzip dist.zip -d ./ 30 | - uses: matter-labs/action-hosting-deploy@main 31 | with: 32 | repoToken: '${{ secrets.GITHUB_TOKEN }}' 33 | firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_WEB_DOCS_PROD }}' 34 | channelId: live 35 | target: prod 36 | projectId: zksync-web-docs 37 | firebaseToolsVersion: 12.9.1 38 | env: 39 | FIREBASE_CLI_PREVIEWS: hostingchannels 40 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: "Semantic release" 2 | 3 | concurrency: 4 | group: semantic-release 5 | cancel-in-progress: true 6 | 7 | on: 8 | push: 9 | branches: [ master ] 10 | jobs: 11 | release: 12 | if: ${{ github.event.repository.full_name == github.repository }} && {{ !contains(github.event.head_commit.message, "skip ci") }} 13 | runs-on: ubuntu-latest 14 | environment: prod 15 | steps: 16 | - uses: actions/checkout@v2 17 | with: 18 | fetch-depth: 0 19 | # Whether to configure the token or SSH key with the local git config 20 | # Default: true 21 | persist-credentials: false # <--- checking this in commit context 22 | 23 | - name: "Enable yarn cache" 24 | uses: c-hive/gha-yarn-cache@v2 # using cache 25 | 26 | - name: "Setup node@14" 27 | uses: actions/setup-node@v2 28 | with: 29 | node-version: 18 30 | 31 | - name: "Install dependencies" 32 | run: | 33 | yarn set version 3.2.0 34 | yarn install 35 | 36 | - name: "Build & deploy to staging" 37 | run: yarn docs:build 38 | - uses: matter-labs/action-hosting-deploy@main 39 | with: 40 | repoToken: "${{ secrets.GITHUB_TOKEN }}" 41 | firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZSYNC_WEB_DOCS_PROD }}" 42 | projectId: zksync-web-docs 43 | firebaseToolsVersion: 12.9.1 44 | target: staging 45 | channelId: live 46 | env: 47 | APP_ENV: production 48 | 49 | - name: "Pack generated distributive" 50 | run: zip -r dist.zip dist firebase.json .firebaserc 51 | 52 | 53 | - name: "Semantic release" 54 | run: yarn semantic-release 55 | env: 56 | HUSKY: 0 57 | CI: true 58 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 59 | 60 | - name: Publish artifact 61 | uses: actions/upload-artifact@v2 62 | with: 63 | name: dist 64 | path: dist.zip 65 | -------------------------------------------------------------------------------- /.github/workflows/secrets_scanner.yaml: -------------------------------------------------------------------------------- 1 | name: Leaked Secrets Scan 2 | on: [pull_request] 3 | jobs: 4 | TruffleHog: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Checkout code 8 | uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 9 | with: 10 | fetch-depth: 0 11 | - name: TruffleHog OSS 12 | uses: trufflesecurity/trufflehog@0c66d30c1f4075cee1aada2e1ab46dabb1b0071a 13 | with: 14 | path: ./ 15 | base: ${{ github.event.repository.default_branch }} 16 | head: HEAD 17 | extra_args: --debug --only-verified 18 | -------------------------------------------------------------------------------- /.github/workflows/semantic-pr-title.yml: -------------------------------------------------------------------------------- 1 | name: Semantic PR title 2 | 3 | concurrency: 4 | group: deploy-pr-${{ github.ref || github.head_ref || github.run_id }} 5 | cancel-in-progress: true 6 | 7 | on: 8 | pull_request_target: 9 | types: 10 | - opened 11 | - edited 12 | - synchronize 13 | 14 | jobs: 15 | main: 16 | name: Check PR title 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: amannn/action-semantic-pull-request@v3.0.0 20 | env: 21 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #vuepress files 2 | 3 | *.log 4 | *.gem 5 | *.rbc 6 | .bundle 7 | .config 8 | coverage 9 | InstalledFiles 10 | lib/bundler/man 11 | pkg 12 | rdoc 13 | spec/reports 14 | test/tmp 15 | test/version_tmp 16 | tmp 17 | .DS_STORE 18 | build/ 19 | .cache 20 | .vagrant 21 | .sass-cache 22 | vendor 23 | 24 | # YARD artifacts 25 | .yardoc 26 | _yardoc 27 | doc/ 28 | .idea/ 29 | 30 | dist 31 | 32 | /.firebase 33 | 34 | # Yarn 35 | .pnp.* 36 | node_modules 37 | .yarn/ 38 | !.yarn/releases 39 | !.yarn/plugins 40 | !.yarn/sdks 41 | !.yarn/versions 42 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no-install commitlint --edit $1 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | CI="1" 5 | npx lint-staged 6 | -------------------------------------------------------------------------------- /.markdownlintignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | CHANGELOG.md 3 | README.md 4 | /dist/ 5 | /drafts 6 | -------------------------------------------------------------------------------- /.markdownlintrc: -------------------------------------------------------------------------------- 1 | { 2 | "MD013": { 3 | "indent": 2, 4 | "tables": false, 5 | "code_blocks": false, 6 | "line_length": 300 7 | }, 8 | "MD033": { 9 | "no-inline-html": false, 10 | "allowed_elements": [ 11 | "br", 12 | "label", 13 | "sup", 14 | "p", 15 | "iframe", 16 | "img", 17 | "table", 18 | "b", 19 | "span", 20 | "tr", 21 | "td", 22 | "div", 23 | "input", 24 | "aside" 25 | ] 26 | }, 27 | "MD036": false, 28 | "fenced-code-language": false, 29 | "first-heading-h1": false, 30 | "first-line-heading": false, 31 | "no-duplicate-header": false, 32 | "no-hard-tabs": false, 33 | "ol-prefix": false, 34 | "whitespace": false 35 | } 36 | -------------------------------------------------------------------------------- /.releaserc: -------------------------------------------------------------------------------- 1 | { 2 | "branches": "master", 3 | "debug": false, 4 | "tagFormat": "${version}", 5 | "npmPublish": false, 6 | "plugins": [ 7 | "@semantic-release/commit-analyzer", 8 | "@semantic-release/release-notes-generator", 9 | [ 10 | "@semantic-release/npm", 11 | { 12 | "npmPublish": false 13 | } 14 | ], 15 | [ 16 | "@semantic-release/github", 17 | { 18 | "assets": [ 19 | { 20 | "path": "dist.zip", 21 | "label": "Dist package" 22 | } 23 | ] 24 | } 25 | ], 26 | [ 27 | "@semantic-release/changelog", 28 | { 29 | "changelogFile": "CHANGELOG.md" 30 | } 31 | ] 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | enableTelemetry: false 2 | 3 | nodeLinker: node-modules 4 | 5 | supportedArchitectures: 6 | cpu: 7 | - current 8 | os: 9 | - current 10 | 11 | yarnPath: .yarn/releases/yarn-3.2.0.cjs 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Matter Labs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [zkSync Lite Docs](https://docs.lite.zksync.io/) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/matter-labs/zksync-lite-docs) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/matter-labs/zksync-lite-docs/Deploy%20production) 2 | 3 | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/matter-labs/zksync-lite-docs/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/zksync.svg?style=flat)](https://www.npmjs.com/package/zksync) [![Follow us!](https://img.shields.io/twitter/follow/zksync?color=%238C8DFC&label=Follow%20%40zkSync&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD0iNDMiIGhlaWdodD0iMjUiIHZpZXdCb3g9IjAgMCA0MyAyNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00Mi42NTM5IDEyLjQ5MTVMMzAuODM3OCAwLjcxNjc0M1Y5LjM0TDE5LjEwNTUgMTcuOTczOUwzMC44Mzc4IDE3Ljk4MlYyNC4yNjYyTDQyLjY1MzkgMTIuNDkxNVoiIGZpbGw9IiM0RTUyOUEiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjk5ODA0NyAxMi40ODcyTDEyLjgxNDEgMjQuMjYxOVYxNS43MDhMMjQuNTQ2NSA3LjAwNDdMMTIuODE0MSA2Ljk5NjY0VjAuNzEyNDYzTDAuOTk4MDQ3IDEyLjQ4NzJaIiBmaWxsPSIjOEM4REZDIi8%2BCjwvc3ZnPgo%3D&style=flat)](https://twitter.com/zksync) 4 | 5 | 6 | ## zkSync Documentation for the v1 | [CHANGELOG](./CHANGELOG.md) 7 | 8 | This repository contains the zkSync documentation hosted at [docs.lite.zksync.io/](https://docs.lite.zksync.io/) 9 | 10 | ## Development 11 | 12 | ### Prerequisites 13 | 14 | A [Node.js](https://nodejs.org/en/download) installation running Node.js version 16. 15 | 16 | ### Local run 17 | 18 | ```bash 19 | yarn install --check-cache 20 | yarn docs:dev 21 | ``` 22 | 23 | ### Development 24 | 25 | CI pipeline will check that the files are formatted according `markdownlint` founds no issues in document 26 | and spelling is correct. Also, there should be no dead links. 27 | 28 | You can check it locally as follows: 29 | 30 | ```bash 31 | yarn 32 | yarn md:lint 33 | yarn cspell 34 | ``` 35 | 36 | If `cspell` doesn't recognize a word but you're sure that it's correct, consider adding it to the `cspell-zksync.txt`. 37 | 38 | ## Deployment 39 | 40 | `master` branch is automatically deployed to 41 | 42 | ### Deploying altogether 43 | 44 | > will do: 45 | 46 | * install node modules; 47 | * prepare, test and build documentation; 48 | * afterwards all contained into the `dist` folder will be deployed in form of the static website 49 | 50 | ```bash 51 | yarn install --check-cache 52 | yarn docs:build 53 | yarn firebase deploy 54 | ``` 55 | 56 | ## Extra documentation 57 | 58 | ## cSpell 59 | 60 | Configuration in `cspell.json`: 61 | 62 | * `version` — version of the setting file, always **0.1** 63 | * `language` — language - current active spelling language 64 | * `words[]` — words - list of words to be always considered correct 65 | * `dictionaries[]` 66 | 67 | ``` 68 | "dictionaryDefinitions": [ 69 | { 70 | "name": "zksync", "path": "./cspell-zksync.txt" 71 | } 72 | ] 73 | ``` 74 | 75 | ```bash 76 | { 77 | "version": "0.1", 78 | // language - current active spelling language 79 | "language": "en", 80 | // words - list of words to be always considered correct 81 | "words": [], 82 | "dictionaries": ["typescript", "zksync"], 83 | // 84 | "dictionaryDefinitions": [ 85 | { 86 | "name": "zksync", "path": "./cspell-zksync.txt" 87 | } 88 | ] 89 | } 90 | ``` 91 | 92 | --- 93 | 94 | # ZKsync Ecosystem 95 | 96 | - [**Start building with ZKsync v2 🚀**](https://portal.zksync.io) 97 | - [Integration Docs](https://docs.lite.zksync.io/dev) 98 | - [Available API & protocols](https://docs.lite.zksync.io/api/) 99 | - [zkWallet](https://lite.zksync.io/) 100 | - [Alternative Withdrawal](https://withdraw.zksync.io/) 101 | - [zkScan](https://zkscan.io/) 102 | - [’out-of-gas’ issue solver ](https://withdraw.zksync.io/) 103 | 104 | --- 105 | 106 | - [Matter Labs: creators of the ZKsync](https://matter-labs.io) 107 | - [ZKsync Homepage](https://zksync.io) 108 | 109 | --- 110 | > BTW, we're hiring: [See open positions](https://joinmatterlabs.com) 111 | 112 | ## License 113 | 114 | zkWallet is distributed under the terms of both the MIT license, and the Apache License (v.2.0). 115 | 116 | See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT) for details. 117 | -------------------------------------------------------------------------------- /VuePress: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/VuePress -------------------------------------------------------------------------------- /cspell-zksync.txt: -------------------------------------------------------------------------------- 1 | // zkSync-related words 2 | matterlabs 3 | zksync 4 | zkscan 5 | zkscrypto 6 | libzkscrypto 7 | pubkey 8 | pubdata 9 | keccak 10 | musig 11 | WASM 12 | jsrpc 13 | backends 14 | ethsig 15 | ethop 16 | decentralization 17 | rollups 18 | zkrollup 19 | zktools 20 | unencrypted 21 | permissionless 22 | trustlessness 23 | IERC 24 | Schnorr 25 | MuSig 26 | Gluchowski 27 | validium 28 | RegeneisMultisig.sol 29 | zkevm 30 | 31 | // Names 32 | Stichting 33 | Kingsfordweg 34 | RSIN 35 | ABDK 36 | Alef 37 | Zcon 38 | Paypal 39 | Numio 40 | Edcon 41 | Arbitrum 42 | Non-fungible 43 | 44 | // Used libraries 45 | numberish 46 | arrayify 47 | hexlify 48 | markdownlint 49 | ethersproject 50 | 51 | // Used programming language words 52 | printf 53 | charsets 54 | println 55 | fatalf 56 | allowfullscreen 57 | inttypes 58 | 59 | // ETC 60 | gitter 61 | signup 62 | signups 63 | precompiled 64 | checkmark 65 | roadmap 66 | majeure 67 | conveniens 68 | reimplementing 69 | subsecond 70 | supermajority 71 | gemeente 72 | unauthorised 73 | SDKs 74 | inter alia 75 | unbundle 76 | incentivized 77 | upgradability 78 | authentification 79 | 80 | // crypto terms 81 | UDST 82 | IPFS 83 | satoshi 84 | multisignature 85 | onchain 86 | convertion 87 | txns 88 | Ethereum's 89 | mainchain 90 | offchain 91 | blockchains 92 | sidechain 93 | sidechains 94 | tokenomics 95 | validator's 96 | stakers 97 | Ethereum signature 98 | gasless 99 | onramps 100 | 101 | // Famous crypto people 102 | Vitalik's 103 | Buterin's 104 | Keyhash 105 | Armeabi 106 | scijava 107 | Vitalik 108 | Buterin 109 | Consensys 110 | 111 | // Dev 112 | mkdir 113 | multilanguage 114 | timespan 115 | satoshi 116 | Regeneis 117 | stakers 118 | Arbitrum 119 | ecrecover 120 | Solana 121 | Vareger 122 | TRESHOLD 123 | multicall 124 | virtualenv 125 | interactor 126 | regenesis 127 | videoframe 128 | cslint 129 | incentivized 130 | IPFS 131 | Timerange 132 | commited 133 | unbundle 134 | userbase 135 | bytecode 136 | precompilers 137 | 138 | //paths & urls 139 | v0.2.md 140 | -------------------------------------------------------------------------------- /cspell.json: -------------------------------------------------------------------------------- 1 | { 2 | "allowCompoundWords": true, 3 | "dictionaries": [ 4 | "typescript", 5 | "cpp", 6 | "npm", 7 | "filetypes", 8 | "cpp", 9 | "en_GB", 10 | "en_US", 11 | "node", 12 | "bash", 13 | "fonts", 14 | "npm", 15 | "cryptocurrencies", 16 | "companies", 17 | "rust", 18 | "html", 19 | "css", 20 | "entities", 21 | "softwareTerms", 22 | "misc", 23 | "fullstack", 24 | "softwareTerms", 25 | "zksync" 26 | ], 27 | "dictionaryDefinitions": [ 28 | { 29 | "name": "zksync", 30 | "addWords": true, 31 | "path": "./cspell-zksync.txt" 32 | } 33 | ], 34 | "ignorePaths": [ 35 | "node_modules", 36 | ".github", 37 | "drafts", 38 | ".github", 39 | "yarn" 40 | ], 41 | "language": ["en-Gb", "en-Us"] 42 | } 43 | -------------------------------------------------------------------------------- /docs/.vuepress/public/100-days-to-mainnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/100-days-to-mainnet.png -------------------------------------------------------------------------------- /docs/.vuepress/public/ABDK-ZKSync-Audit-v2-part1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/ABDK-ZKSync-Audit-v2-part1.pdf -------------------------------------------------------------------------------- /docs/.vuepress/public/ABDK-ZKSync-Audit-v2-part2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/ABDK-ZKSync-Audit-v2-part2.pdf -------------------------------------------------------------------------------- /docs/.vuepress/public/ABDK-ZkSync-Audit-v5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/ABDK-ZkSync-Audit-v5.pdf -------------------------------------------------------------------------------- /docs/.vuepress/public/ABDK_ZkSync_V8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/ABDK_ZkSync_V8.pdf -------------------------------------------------------------------------------- /docs/.vuepress/public/ABDK_ZkSync_V9.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/ABDK_ZkSync_V9.pdf -------------------------------------------------------------------------------- /docs/.vuepress/public/Activation-fee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/Activation-fee.png -------------------------------------------------------------------------------- /docs/.vuepress/public/D00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/D00.png -------------------------------------------------------------------------------- /docs/.vuepress/public/D1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/D1.png -------------------------------------------------------------------------------- /docs/.vuepress/public/D10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/D10.png -------------------------------------------------------------------------------- /docs/.vuepress/public/D2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/D2.png -------------------------------------------------------------------------------- /docs/.vuepress/public/D3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/D3.png -------------------------------------------------------------------------------- /docs/.vuepress/public/D5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/D5.png -------------------------------------------------------------------------------- /docs/.vuepress/public/D6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/D6.png -------------------------------------------------------------------------------- /docs/.vuepress/public/D7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/D7.png -------------------------------------------------------------------------------- /docs/.vuepress/public/D9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/D9.png -------------------------------------------------------------------------------- /docs/.vuepress/public/ERC20-approval.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/ERC20-approval.png -------------------------------------------------------------------------------- /docs/.vuepress/public/LogoHero.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/.vuepress/public/Mainnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/Mainnet.png -------------------------------------------------------------------------------- /docs/.vuepress/public/S1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/S1-2.png -------------------------------------------------------------------------------- /docs/.vuepress/public/S1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/S1.png -------------------------------------------------------------------------------- /docs/.vuepress/public/S10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/S10.png -------------------------------------------------------------------------------- /docs/.vuepress/public/S11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/S11.png -------------------------------------------------------------------------------- /docs/.vuepress/public/S2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/S2.png -------------------------------------------------------------------------------- /docs/.vuepress/public/S3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/S3.png -------------------------------------------------------------------------------- /docs/.vuepress/public/S4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/S4.png -------------------------------------------------------------------------------- /docs/.vuepress/public/S5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/S5.png -------------------------------------------------------------------------------- /docs/.vuepress/public/S7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/S7.png -------------------------------------------------------------------------------- /docs/.vuepress/public/S8.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/S8.1.png -------------------------------------------------------------------------------- /docs/.vuepress/public/S9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/S9.png -------------------------------------------------------------------------------- /docs/.vuepress/public/SE-Popup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/SE-Popup.png -------------------------------------------------------------------------------- /docs/.vuepress/public/SE1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/SE1-2.png -------------------------------------------------------------------------------- /docs/.vuepress/public/Top-up-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/Top-up-1.png -------------------------------------------------------------------------------- /docs/.vuepress/public/Top-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/Top-up.png -------------------------------------------------------------------------------- /docs/.vuepress/public/a1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/a1.png -------------------------------------------------------------------------------- /docs/.vuepress/public/a3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/a3.png -------------------------------------------------------------------------------- /docs/.vuepress/public/a4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/a4.png -------------------------------------------------------------------------------- /docs/.vuepress/public/analytics.js: -------------------------------------------------------------------------------- 1 | window.dataLayer = window.dataLayer || []; 2 | function gtag(){dataLayer.push(arguments);} 3 | gtag('js', new Date()); 4 | 5 | gtag('config', 'G-K9FLXQ2PYF'); -------------------------------------------------------------------------------- /docs/.vuepress/public/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/android-icon-144x144.png -------------------------------------------------------------------------------- /docs/.vuepress/public/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/android-icon-192x192.png -------------------------------------------------------------------------------- /docs/.vuepress/public/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/android-icon-36x36.png -------------------------------------------------------------------------------- /docs/.vuepress/public/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/android-icon-48x48.png -------------------------------------------------------------------------------- /docs/.vuepress/public/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/android-icon-72x72.png -------------------------------------------------------------------------------- /docs/.vuepress/public/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/android-icon-96x96.png -------------------------------------------------------------------------------- /docs/.vuepress/public/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/apple-icon-114x114.png -------------------------------------------------------------------------------- /docs/.vuepress/public/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/apple-icon-120x120.png -------------------------------------------------------------------------------- /docs/.vuepress/public/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/apple-icon-144x144.png -------------------------------------------------------------------------------- /docs/.vuepress/public/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/apple-icon-152x152.png -------------------------------------------------------------------------------- /docs/.vuepress/public/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/apple-icon-180x180.png -------------------------------------------------------------------------------- /docs/.vuepress/public/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/apple-icon-57x57.png -------------------------------------------------------------------------------- /docs/.vuepress/public/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/apple-icon-60x60.png -------------------------------------------------------------------------------- /docs/.vuepress/public/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/apple-icon-72x72.png -------------------------------------------------------------------------------- /docs/.vuepress/public/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/apple-icon-76x76.png -------------------------------------------------------------------------------- /docs/.vuepress/public/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/apple-icon-precomposed.png -------------------------------------------------------------------------------- /docs/.vuepress/public/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/apple-icon.png -------------------------------------------------------------------------------- /docs/.vuepress/public/authorize-mint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/authorize-mint.png -------------------------------------------------------------------------------- /docs/.vuepress/public/authorize-to-send-eth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/authorize-to-send-eth.png -------------------------------------------------------------------------------- /docs/.vuepress/public/authorize-to-send-zksync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/authorize-to-send-zksync.png -------------------------------------------------------------------------------- /docs/.vuepress/public/bounty-table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/bounty-table.png -------------------------------------------------------------------------------- /docs/.vuepress/public/chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/chart.png -------------------------------------------------------------------------------- /docs/.vuepress/public/chart2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/chart2.png -------------------------------------------------------------------------------- /docs/.vuepress/public/chart3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/chart3.png -------------------------------------------------------------------------------- /docs/.vuepress/public/chart4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/chart4.png -------------------------------------------------------------------------------- /docs/.vuepress/public/f1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/.vuepress/public/f2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/.vuepress/public/f3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/.vuepress/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/favicon-16x16.png -------------------------------------------------------------------------------- /docs/.vuepress/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/favicon-32x32.png -------------------------------------------------------------------------------- /docs/.vuepress/public/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/favicon-96x96.png -------------------------------------------------------------------------------- /docs/.vuepress/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/favicon.ico -------------------------------------------------------------------------------- /docs/.vuepress/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/favicon.png -------------------------------------------------------------------------------- /docs/.vuepress/public/hack.js: -------------------------------------------------------------------------------- 1 | let lastHash = ""; 2 | 3 | function locationHashChanged (event) { 4 | try { 5 | if (!event || !event.isTrusted) { 6 | return; 7 | } 8 | const currentLocation = (event.path && event.path.length > 0 && event.path[0] && event.path[0].location) ? event.path[0].location : window.location; 9 | if (currentLocation && currentLocation.hash !== "" && currentLocation.hash !== lastHash) { 10 | const element = document.querySelector(currentLocation.hash); 11 | if (element) { 12 | if (event.hasOwnProperty('stopPropagation')) { 13 | event.stopPropagation(); 14 | } 15 | if (element.hasOwnProperty('scrollIntoViewIfNeeded')) { 16 | element.scrollIntoViewIfNeeded(true); 17 | } else { 18 | element.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' }); 19 | } 20 | lastHash = currentLocation.hash; 21 | return false; 22 | } 23 | } 24 | } catch (err) { 25 | console.debug(err); 26 | } 27 | } 28 | 29 | window.addEventListener('loadeddata', (event) => { 30 | locationHashChanged(event); 31 | }); 32 | 33 | document.addEventListener('readystatechange', (event) => { 34 | locationHashChanged(event); 35 | }); 36 | 37 | // Script #1: Processing scroll-to-hash 38 | window.addEventListener('hashchange', (event) => { 39 | locationHashChanged(event); 40 | }); 41 | 42 | // Script #2: Changing logo & home-link behaviour 43 | window.addEventListener('DOMContentLoaded', (event) => { 44 | locationHashChanged(event); 45 | const singleElement = document.querySelector('a.home-link'); 46 | const newHost = 'https://zksync.io'; 47 | 48 | if (singleElement) { 49 | singleElement.setAttribute('href', newHost); 50 | singleElement.setAttribute('target', '_blank'); 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /docs/.vuepress/public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/icon.png -------------------------------------------------------------------------------- /docs/.vuepress/public/int-txns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/int-txns.png -------------------------------------------------------------------------------- /docs/.vuepress/public/json.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/json.png -------------------------------------------------------------------------------- /docs/.vuepress/public/l2fees.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/l2fees.png -------------------------------------------------------------------------------- /docs/.vuepress/public/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/.vuepress/public/m1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/m1.png -------------------------------------------------------------------------------- /docs/.vuepress/public/m10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/m10.png -------------------------------------------------------------------------------- /docs/.vuepress/public/m11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/m11.png -------------------------------------------------------------------------------- /docs/.vuepress/public/m2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/m2.png -------------------------------------------------------------------------------- /docs/.vuepress/public/m3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/m3.png -------------------------------------------------------------------------------- /docs/.vuepress/public/m4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/m4.png -------------------------------------------------------------------------------- /docs/.vuepress/public/m7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/m7.png -------------------------------------------------------------------------------- /docs/.vuepress/public/m8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/m8.png -------------------------------------------------------------------------------- /docs/.vuepress/public/mainnet_goerli_selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/mainnet_goerli_selection.png -------------------------------------------------------------------------------- /docs/.vuepress/public/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/ms-icon-144x144.png -------------------------------------------------------------------------------- /docs/.vuepress/public/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/ms-icon-150x150.png -------------------------------------------------------------------------------- /docs/.vuepress/public/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/ms-icon-310x310.png -------------------------------------------------------------------------------- /docs/.vuepress/public/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/ms-icon-70x70.png -------------------------------------------------------------------------------- /docs/.vuepress/public/nonce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/nonce.png -------------------------------------------------------------------------------- /docs/.vuepress/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | 4 | # Example 3: Block all but AdsBot crawlers 5 | User-agent: * 6 | Disallow: /service/ 7 | -------------------------------------------------------------------------------- /docs/.vuepress/public/scalability.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/scalability.png -------------------------------------------------------------------------------- /docs/.vuepress/public/se.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/se.png -------------------------------------------------------------------------------- /docs/.vuepress/public/se1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/se1.png -------------------------------------------------------------------------------- /docs/.vuepress/public/se2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/se2.png -------------------------------------------------------------------------------- /docs/.vuepress/public/se4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/se4.png -------------------------------------------------------------------------------- /docs/.vuepress/public/se6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/se6.png -------------------------------------------------------------------------------- /docs/.vuepress/public/se8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/se8.png -------------------------------------------------------------------------------- /docs/.vuepress/public/se9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/se9.png -------------------------------------------------------------------------------- /docs/.vuepress/public/social-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/social-image.png -------------------------------------------------------------------------------- /docs/.vuepress/public/social.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/social.jpg -------------------------------------------------------------------------------- /docs/.vuepress/public/zksync-1.0-audit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/zksync-1.0-audit.pdf -------------------------------------------------------------------------------- /docs/.vuepress/public/zksync1-2021-01-bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/zksync1-2021-01-bug.png -------------------------------------------------------------------------------- /docs/.vuepress/public/zksync1-2021-01-fix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/zksync1-2021-01-fix.png -------------------------------------------------------------------------------- /docs/.vuepress/public/zktools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matter-labs/zksync-lite-docs/24f1e5be0fa0213841aa0873809787bdafca401e/docs/.vuepress/public/zktools.png -------------------------------------------------------------------------------- /docs/.vuepress/styles/index.styl: -------------------------------------------------------------------------------- 1 | .hero 2 | img 3 | transform: scale(0.8) 4 | 5 | .site-name.can-hide 6 | display: none 7 | 8 | .footnote 9 | font-size: 0.8rem 10 | 11 | .newsletter-input 12 | display: inline-block; 13 | width: 18rem; 14 | font-size: 1rem; 15 | color: $ml2; 16 | background-color: #fff; 17 | padding: 0.5rem 1rem; 18 | margin: 0.1rem; 19 | border-radius: 4px; 20 | transition: background-color 0.1s ease; 21 | box-sizing: border-box; 22 | border: 1px solid #ddd; 23 | 24 | .videoframe 25 | max-width: 100%; 26 | margin-top: 15px; 27 | margin-bottom: 25px; 28 | 29 | .newsletter-button 30 | display: inline-block; 31 | width: 10rem; 32 | font-size: 1rem; 33 | color: $ml2; 34 | background-color: #fff; 35 | padding: 0.5rem 1.5rem; 36 | margin: 0.2rem; 37 | border-radius: 4px; 38 | transition: background-color 0.1s ease; 39 | box-sizing: border-box; 40 | border: 1px solid #ccc; 41 | cursor pointer; 42 | 43 | &:hover 44 | background-color: darken(#fff, 5%); 45 | 46 | @media (max-width: 500px) 47 | main.page 48 | padding-bottom: 1rem !important; 49 | .theme-default-content:not(.custom) 50 | padding-bottom: 0.5rem !important; 51 | .page-nav p.inner 52 | margin-bottom: 0!important; 53 | .videoframe 54 | max-width: 100%; 55 | iframe, video 56 | max-width: 100%; 57 | width: 100%; 58 | min-width: calc(100vw - 3rem); 59 | min-height: 35vh; 60 | pre 61 | max-width: 90vw; 62 | ol, li 63 | .extra-class, div[class*="language-"] 64 | left: -1.25rem; 65 | position: relative; 66 | width: 100vw; 67 | .links ul.suggestions 68 | list-style: none !important; 69 | min-width: 0; 70 | padding-inline-start: 0 !important; 71 | padding: 0.4rem !important; 72 | width: calc(100vw - 0.8rem - 4px) !important; 73 | position: fixed; 74 | top: 56px; 75 | right: initial !important; 76 | left: 0 !important; 77 | margin-block-start: 0 !important; 78 | margin-block-end: 0 !important; 79 | margin-inline-start: 0px; 80 | margin-inline-end: 0px; 81 | -------------------------------------------------------------------------------- /docs/.vuepress/styles/palette.styl: -------------------------------------------------------------------------------- 1 | // https://vuepress.vuejs.org/config/#palette-styl 2 | $accentColor = #797AFB 3 | $textColor = #2c3e50 4 | $borderColor = #eaecef 5 | $codeBgColor = #282c34 6 | $arrowBgColor = #ccc 7 | $badgeTipColor = #8C8DFC 8 | $badgeWarningColor = darken(#ffe564, 35%) 9 | $badgeErrorColor = #DA5961 10 | $ml1 = #4E529A 11 | $ml2 = #8C8DFC 12 | 13 | -------------------------------------------------------------------------------- /docs/.vuepress/theme/components/Home.vue: -------------------------------------------------------------------------------- 1 | 53 | 54 | 76 | 77 | 273 | -------------------------------------------------------------------------------- /docs/.vuepress/theme/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extend: '@vuepress/theme-default' 3 | } -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: false 3 | footer: Made with ❤️ by Matter Labs 4 | sidebarDepth: 3 5 | --- 6 | 7 | # Welcome to zkSync Lite 8 | 9 | **zkSync Lite** is a user-centric zk rollup platform from [Matter Labs](https://matter-labs.io). It is a scaling solution for 10 | Ethereum, already live on Ethereum mainnet. 11 | 12 | 13 | 14 | Some of the main features of zkSync Lite are: 15 | 16 | - Extremely low transaction fees 17 | - Trustless protocol 18 | - Funds are cryptographically secure, as in the Ethereum mainnet 19 | - Users are always in control of their funds 20 | - No requirement for operational activity to keep the funds safe 21 | 22 | Get started by reading [the overview](./userdocs). 23 | 24 | 25 | 26 | ### Important links 27 | 28 | Here is a list of important links to interact wth zkSync: 29 | 30 | - **Wallet** (check your balances, NFTs, transactions history and contacts). [https://lite.zksync.io](https://lite.zksync.io) 31 | - **Block Explorer** (Everything you need to explore all transactions and blocks on zkSync). [Block Explorer](https://zkscan.io/) 32 | - **zkCheckout** (Our blazing fast & cost-efficient checkout solution). [https://checkout.zksync.io/](https://checkout.zksync.io/) 33 | ### For Developers 34 | 35 | If you are interested in developing with zkSync, view our [Developers Guide](/dev/) and [API Reference](/api). 36 | 37 | ### Interested in reading more? 38 | 39 | In-depth articles can be found on our [Medium page](https://medium.com/matter-labs). 40 | 41 | ### Contact 42 | 43 | If you have any questions or want to be part of our community, please check out our [contact page](https://zksync.io/contact). 44 | -------------------------------------------------------------------------------- /docs/api/README.md: -------------------------------------------------------------------------------- 1 | # zkSync Lite API Reference Overview 2 | 3 | ## Meta 4 | 5 | - [Changelog and notifications for developers](./changelog) 6 | - [Development and production environments](./environments) 7 | 8 | ## API 9 | 10 | - [API v0.1](./v0.1) (REST + JSON RPC) 11 | 12 | ## SDK 13 | 14 | zkSync Lite support has been implemented for various platforms: 15 | 16 | - [JavaScript / TypeScript](./sdk/js) 17 | - [Rust](./sdk/rust) 18 | - [Android (Java)](./sdk/java) 19 | - [iOS (Swift)](./sdk/swift) 20 | - [Python](./sdk/python) 21 | 22 | ## Ecosystem libraries 23 | 24 | This section also covers the ecosystem libraries we maintain: 25 | 26 | - [Cryptographic backends](./sdk/crypto): support of zkSync cryptography in different programming languages. 27 | - [zkCheckout](./sdk/checkout): TypeScript library to integrate zkSync payments for your application. 28 | - [Schnorr MuSig](https://github.com/matter-labs/schnorr-musig): Rust / WASM library for multisig support. 29 | -------------------------------------------------------------------------------- /docs/api/changelog/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # Changelog 6 | 7 | This page contains the release notes for new features in zkSync network, and also notifications about changes in the 8 | client libraries. 9 | 10 | [[toc]] 11 | 12 | ## Actual SDK versions 13 | 14 | | Network | JavaScript SDK | Rust SDK | Java SDK | Swift SDK | 15 | | ------- | -------------- | -------- | -------- | --------- | 16 | | Mainnet | 0.9.0 | 0.3.0 | 0.0.1-b1 | 0.0.1 | 17 | | Goerli | 0.9.0 | 0.3.0 | 0.0.1-b1 | 0.0.1 | 18 | 19 | ## Minimum supported SDK versions 20 | 21 | | Network | JavaScript SDK | Rust SDK | Java SDK | Swift SDK | 22 | | ------- | -------------- | -------- | -------- | --------- | 23 | | Mainnet | 0.7.5 | 0.1.0 | 0.0.1-b1 | 0.0.1 | 24 | | Goerli | 0.9.0 | 0.3.0 | 0.0.1-b1 | 0.0.1 | 25 | 26 | ## Upcoming breaking changes 27 | 28 | ❗ Important, version `0.12.0` of zkSync JS SDK contains breaking changes, please make fixes before upgrading this npm package. 29 | 30 | ### Changed 31 | - `getOrder` renamed to `signOrder`. The method was used for signing and the name of the method was inconsistent. 32 | - `getLimitOrder` was renamed to `signLimitOrder`. The method was used for signing and the name of the method was inconsistent. 33 | - All methods whose name started with `get` for example `getTransfer` were deleted. Now for this purpose, you could use `BatchBuilder.` 34 | 35 | ## Release history 36 | 37 | Details on releases can be found in the corresponding changelogs: 38 | 39 | - [zkSync smart contracts](https://github.com/matter-labs/zksync/blob/master/changelog/contracts.md) 40 | - [zkSync core](https://github.com/matter-labs/zksync/blob/master/changelog/core.md) 41 | - [zkSync infrastructure](https://github.com/matter-labs/zksync/blob/master/changelog/infrastructure.md) 42 | - [zksync-rs](https://github.com/matter-labs/zksync/blob/master/changelog/rust-sdk.md) 43 | - [zksync.js](https://github.com/matter-labs/zksync/blob/master/changelog/js-sdk.md) 44 | 45 | ## Deprecated APIs 46 | 47 | This section will contain the client library APIs that are outdated and left for the backward compatibility only. 48 | 49 | | Feature | Affected libraries | Scheduled support removal date | 50 | | ------- | ------------------ | ------------------------------ | 51 | | - | - | - | 52 | -------------------------------------------------------------------------------- /docs/api/environments/README.md: -------------------------------------------------------------------------------- 1 | # Environments 2 | 3 | ## Mainnet 4 | 5 | - Wallet: [https://lite.zksync.io](https://lite.zksync.io) 6 | - Explorer: [https://zkscan.io](https://zkscan.io) 7 | - zkSync 8 | [0xabea9132b05a70803a4e85094fd0e1800777fbef](https://etherscan.io/address/0xabea9132b05a70803a4e85094fd0e1800777fbef) 9 | - Verifier 10 | [0x5290E9582B4FB706EaDf87BB1c129e897e04d06D](https://etherscan.io/address/0x5290E9582B4FB706EaDf87BB1c129e897e04d06D) 11 | - Governance 12 | [0x34460C0EB5074C29A9F6FE13b8e7E23A0D08aF01](https://etherscan.io/address/0x34460C0EB5074C29A9F6FE13b8e7E23A0D08aF01) 13 | - Upgrade Gatekeeper 14 | [0x38A43F4330f24fe920F943409709fc9A6084C939](https://etherscan.io/address/0x38A43F4330f24fe920F943409709fc9A6084C939) 15 | 16 | ## Goerli 17 | 18 | - Wallet: [https://lite.zksync.io](https://lite.zksync.io) 19 | - Explorer: [https://goerli.zkscan.io](https://goerli.zkscan.io) 20 | - zkSync 21 | [0x5c56FC5757259c52747AbB7608F8822e7cE51484](https://goerli.etherscan.io/address/0x5c56FC5757259c52747AbB7608F8822e7cE51484) 22 | - Verifier 23 | [0xF321956D6D79f34b4f0a7d8e60791b44ec096fdc](https://goerli.etherscan.io//address/0xF321956D6D79f34b4f0a7d8e60791b44ec096fdc) 24 | - Governance 25 | [0x68FbE14D7D7bEe7DfCc078111aa215e1c2ce3628](https://goerli.etherscan.io//address/0x68FbE14D7D7bEe7DfCc078111aa215e1c2ce3628) 26 | - Upgrade Gatekeeper 27 | [0x746f317b7475E5013AF269938A87A4cCEcc16658](https://goerli.etherscan.io//address/0x746f317b7475E5013AF269938A87A4cCEcc16658) 28 | 29 | -------------------------------------------------------------------------------- /docs/api/sdk/README.md: -------------------------------------------------------------------------------- 1 | # zkSync SDK 2 | 3 | zkSync support has been implemented for various platforms: 4 | 5 | - [JavaScript / TypeScript](./js) 6 | - [Rust](./rust) 7 | - [Android (Java)](./java) 8 | - [iOS (Swift)](./swift) 9 | - [Python](./python) 10 | - [Dart](./dart) This is an unofficial open-sourced SDK for zkSync 11 | 12 | ## Ecosystem libraries 13 | 14 | This section also covers the ecosystem libraries we maintain: 15 | 16 | - [Cryptographic backends](./crypto): support of zkSync cryptography in different programming languages. 17 | - [zkCheckout](./checkout): TypeScript library to integrate zkSync payments for your application. 18 | - [Schnorr MuSig](https://github.com/matter-labs/schnorr-musig): Rust / WASM library for multisignature support. 19 | -------------------------------------------------------------------------------- /docs/api/sdk/checkout/README.md: -------------------------------------------------------------------------------- 1 | # zkCheckout SDK 2 | 3 | This section contains documentation for the zkCheckout SDK, the tool that helps to conveniently create payments with 4 | zkSync. 5 | 6 | ## Examples 7 | 8 | Great examples of the library uses: 9 | 10 | - [Gitcoin Grants round 8](https://gitcoin.co/blog/gitcoin-grants-round-8/) 11 | - [zkLink service: bit.ly for payment links on zkSync](https://link.zksync.io/?MHhhMDcyRTYxNDMyODY2NWJlN0UyRjIxNjZCRTFBN2JBMTk1RjhiZTQ0fERBSXwxMDA) 12 | ([source code](https://github.com/matter-labs/zksync-link)). 13 | -------------------------------------------------------------------------------- /docs/api/sdk/checkout/appendix-a/README.md: -------------------------------------------------------------------------------- 1 | # Appendix A: Using bundle in a browser 2 | 3 | It is possible to use `zksync-checkout` in a browser directly. 4 | 5 | - `ethers@5.0` dependency is required for `zksync-checkout` to work. 6 | 7 | > The example from the tutorial with zksync-checkout fetched from [https://unpkg.com](https://unpkg.com) CDN 8 | 9 | **Note** that it is likely that if the checkout is called instantly, the popup will be blocked by the browser. You 10 | should open the checkout after some event, e.g. button click. 11 | 12 | ```html 13 | 14 | 15 | 16 | 17 | 53 | 54 | 55 | ``` 56 | -------------------------------------------------------------------------------- /docs/api/sdk/checkout/checkout-manager/README.md: -------------------------------------------------------------------------------- 1 | # Checkout Manager 2 | 3 | The main class that is used by the library users. Any time you want to start a checkout, you instantiate a new 4 | `CheckoutManager` object and call the `zkSyncBatchCheckout` method. 5 | 6 | Example of using a `CheckoutManager` can be found in the tutorial. 7 | 8 | ## Class instantiation 9 | 10 | The `CheckoutManager`'s constructor has the following interface: 11 | 12 | ```tsx 13 | constructor(network: EthereumNetwork, customPopupOrigin?: string) 14 | ``` 15 | 16 | It takes an Ethereum network name as a parameter. Creates a `CheckoutManager` instance that will work with the supplied 17 | network. 18 | 19 | Note, that if you specify `localhost` as the network, the library will expect the zkSync side of the checkout flow to be 20 | running at `localhost:8080`. 21 | 22 | The second parameter is the address of the zkSync page which handles the checkout. This parameter should be omitted. 23 | 24 | ## zkSyncBatchCheckout 25 | 26 | ```tsx 27 | async zkSyncBatchCheckout( 28 | transactions: ZkSyncTransaction[], 29 | feeToken: TokenLike, 30 | userAddress?: string 31 | ): Promise 32 | ``` 33 | 34 | Gets an array of the zkSync transactions for the flow and token in which the zkSync fee will be paid. Also, 35 | `userAddress` is the optional parameter, which, if supplied, will be used to check that the user logs in with the 36 | correct address. 37 | 38 | Returns a promise that resolves with the array of the hashes of the transactions in the same order as the transactions 39 | were supplied. 40 | 41 | **Note, that you should NOT add the fee transaction by yourself.** Just specify the `feeToken` and everything else will 42 | be handled by us. 43 | 44 | ## estimateBatchFee 45 | 46 | ```tsx 47 | async estimateBatchFee( 48 | transactions: ZkSyncTransaction[], 49 | feeToken: TokenLike, 50 | ): Promise 51 | ``` 52 | 53 | ```tsx 54 | // The following is the generalized version of the method. 55 | // Might be used if you just have some array of transactions 56 | // that you want to estimate fee for. 57 | async function estimateBatchFee( 58 | transactions: ZkSyncTransaction[], 59 | feeToken: TokenLike, 60 | network: EthereumNetwork 61 | ): Promise; 62 | ``` 63 | 64 | Gets an array of the zkSync transactions for the flow and the token in which the zkSync fee will be paid. 65 | 66 | Returns the promise that resolves with the number of `feeToken` (in wei) that will be paid by the user. 67 | 68 | Note, that the value that the method returns does not take into account the amount of the gas fee that will be paid by 69 | the user in process of depositing the tokens she lacks on L2 to proceed to checkout. But it DOES take into account the 70 | fact that one transaction will be added to pay the fee. You can read more on the optional additional fee transaction in 71 | batches [here](/dev/payments/sending_transactions/#sending-transaction-batches). 72 | 73 | ## wait 74 | 75 | ```tsx 76 | async wait( 77 | txHashes: string[], 78 | type: 'COMMIT' | 'VERIFY' = 'COMMIT' 79 | ): Promise 80 | ``` 81 | 82 | ```tsx 83 | // The following is the generalized version of the method. 84 | // Might be used if you just have some array of transactions 85 | // that you want to wait for. 86 | async function wait( 87 | txHashes: string[], 88 | type: 'COMMIT' | 'VERIFY' = 'COMMIT', 89 | network: EthereumNetwork 90 | ): Promise; 91 | ``` 92 | 93 | Gets an array of the zkSync transactions' hashes and resolves with a list of the transactions' receipts. 94 | `TransactionInfo` is a zkSync type specified [here](/api/sdk/js/providers/#get-transaction-receipt), 95 | extended with the transaction hash. 96 | 97 | ## getState 98 | 99 | ```tsx 100 | async getState( 101 | address: string 102 | ): Promise 103 | ``` 104 | 105 | ```ts 106 | // The following is the generalized version of the method. 107 | // Might be used if you want to get the state of 108 | // an account on an arbitrary Ethereum network, 109 | // supported by zkSync. 110 | async function getState(address: string, network: EthereumNetwork): Promise; 111 | ``` 112 | 113 | Gets the Ethereum address of a zkSync account as a parameter and returns its state. The `AccountState` type is 114 | re-exported from zkSync. You can read more about it 115 | [here](/api/sdk/js/providers/#get-account-state-by-address). 116 | 117 | ## checkEnoughBalance 118 | 119 | ```tsx 120 | async checkEnoughBalance( 121 | transactions: ZkSyncTransaction[], 122 | feeToken: string, 123 | senderAddress: string, 124 | ethProvider: ethers.providers.BaseProvider 125 | ): Promise 126 | ``` 127 | 128 | ```tsx 129 | // The following is the generalized version of the method. 130 | // Might be used if you want to check the balance of 131 | // an account on an arbitrary Ethereum network, 132 | // supported by zkSync. 133 | async function checkEnoughBalance( 134 | transactions: ZkSyncTransaction[], 135 | feeToken: string, 136 | senderAddress: string, 137 | ethProvider: ethers.providers.BaseProvider, 138 | network: EthereumNetwork 139 | ): Promise; 140 | ``` 141 | 142 | Gets a list of transactions, token to pay the fee with, and the address of the user as parameters. Also takes an ethers 143 | provider as a parameter. It is needed for checking the L1 balance of the user. 144 | 145 | Returns a promise that resolves with `true` if the user has combined balance on L1 + L2 sufficient to do all the 146 | transactions and pay the fee, and `false` otherwise. 147 | 148 | The function can throw `FAILED_TO_GET_ONCHAIN_BALANCE` if it fails to get the on-chain balance of the user. 149 | -------------------------------------------------------------------------------- /docs/api/sdk/checkout/constants/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # Constants 6 | 7 | A collection of all the important constants. 8 | 9 | The majority of the constants are for internal use but some of them might be useful. 10 | 11 | ## CheckoutErrors 12 | 13 | An object that contains the text messages of all the errors that might be thrown during the checkout flow. 14 | 15 | 19 | 20 | 21 | 22 | ```tsx 23 | export const CheckoutErrors = { 24 | NOT_IMPLEMENTED_ERROR: 'This functionality is not implemented', 25 | NOT_IN_BROWSER_ERROR: 'The library is intended for use in browser enviroment only!', 26 | OPENING_TIMEOUT_ERROR: 'Took too long for the zkSync page to open', 27 | FAILED_TO_OPEN_ZKSYNC: 'Failed to open zkSync page', 28 | NO_OPENER_ERROR: 'ZkSync manager object should be instantiated only if the window is a popup', 29 | LOGICAL_ERROR: 'An unknown error occured.', 30 | ZKSYNC_CLOSED_ERROR: 'User closed zkSync', 31 | CHECKOUT_NOT_STARTED_ERROR: 'The checkout has not been started', 32 | CLIENT_CLOSED_ERROR: "The client's page has been closed", 33 | INVALID_SENDER_ERROR: 34 | 'Either the `sender` supplied into the checkout or some of the `from` parameters differ from each other', 35 | FAILED_TO_GET_ONCHAIN_BALANCE: "Failed to retreive the user's onchain balance" 36 | } as const; 37 | ``` 38 | 39 | ## Client-side errors vs zkSync-side errors 40 | 41 | The `CheckoutErrors` contains the errors of which might happen both on the zkSync side and on the client's side. 42 | 43 | ### Common errors 44 | 45 | - `NOT_IMPLEMENTED_ERROR`. When the library is complete, there should be no places where such an error could be thrown, 46 | but for the time of development, this error is thrown in the places which have not been properly implemented yet. 47 | - `LOGICAL_ERROR`. This error is thrown if something that should never happen happens. That means that there is a bug in 48 | the library's code. 49 | - `INVALID_SENDER_ERROR`. This error is thrown if the consistency of the sender address is broken. That is, if either 50 | the `userAddress` argument (if supplied) of the `zkSyncBatchCheckout` function is different from any of the supplied 51 | `from` fields of the transactions, or if any supplied `from` field of the transactions is different from any other. In 52 | other words, 53 | - `FAILED_TO_GET_ONCHAIN_BALANCE`. This error is thrown if the library fails to retrieve the user's Ethereum balance. 54 | 55 | ### Client-side errors 56 | 57 | - `NOT_IN_BROWSER_ERROR`. This error is thrown because the library is intended to be used only in the browser 58 | environment. Particularly, the error is thrown if the `window` global object is not defined. 59 | - `OPENING_TIMEOUT_ERROR`. This error is thrown if the zkSync page takes too long to load. It is used to tackle the case 60 | when the user opens the checkout page, but then closes it quickly. 61 | - `FAILED_TO_OPEN_ZKSYNC`. This error is thrown if the client's page fails to open the zkSync page. (Technically 62 | speaking, when the `window.open` returns null) 63 | - `ZKSYNC_CLOSED_ERROR`. This error is thrown when the user closes the zkSync checkout page without initiating any 64 | transactions. 65 | 66 | ### zkSync-side errors 67 | 68 | - `NO_OPENER_ERROR`. This error is thrown if the checkout page is opened without an opener (basically this means that 69 | the page was opened directly, but not as a popup). That's why you may see a gray screen if you open the checkout page 70 | directly in the browser. 71 | - `CHECKOUT_NOT_STARTED_ERROR`. This error is thrown if the checkout page tries to retrieve the state (e.g. list of 72 | transactions, fee token, etc) of the checkout before the data has been received. 73 | - `CLIENT_CLOSED_ERROR`. This error is thrown when the user closes the client's page. This is used to prevent the user 74 | from starting the transfer because the client's page won't be able to receive the transactions hashes. 75 | 76 | ## SemanticTypes 77 | 78 | An object that contains all the possible semantic types. 79 | 80 | ```tsx 81 | export const SemanticTypes = { 82 | Transaction: 'Transaction', 83 | FeeOrCommission: 'FeeOrCommission' 84 | } as const; 85 | ``` 86 | -------------------------------------------------------------------------------- /docs/api/sdk/checkout/protocol/README.md: -------------------------------------------------------------------------------- 1 | # Protocol 2 | 3 | Due to modern web-browsers' security measures, the opening of the tab with the checkout flow internally might look like 4 | a connection establishment via an exchange of `postMessage`-s. 5 | 6 | The protocol follows 7 | [web security best practices](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#security_concerns), 8 | associated with cross-origin communication. 9 | 10 | The internal part of the checkout consists of the following stages: 11 | 12 | 1. The client calls `zkSyncBatchCheckout`. 13 | 2. When the tab is open, the zkSync page will send the `ZKSYNC_OPENED` message. If it fails to do so within 14 | `OPENING_TIMEOUT` ms, the checkout promise resolves with `OPENING_TIMEOUT_ERROR`. After receiving the `ZKSYNC_OPEN` 15 | message, the client's page will send a `START_SESSION` message to the zkSync page. The message contains: 16 | - Array of the transactions, specified by the user. 17 | - Token to pay the fee with. 18 | - The origin of the opener. Must be equal to the origin of the opener (zkSync checks it on its side). 19 | - The checkout id — a feature that enables multiple checkouts at the same time. 20 | 3. If at least in one transaction the `from` field differs from the user's address, the zkSync page will tell the user 21 | about it and will offer him to log in with the other account. The zkSync page will remember the client's origin. Now, 22 | all the `postMessage`-s sent from the zkSync page will only go to the remembered origin. 23 | 4. Every `CLOSE_POLL_INTERVAL` ms the client's page will check if the zkSync page is closed. If the zkSync page is 24 | closed without starting the transactions, the client waits for `FOLLOWUP_HASHES_TIMEOUT` ms in case the hashes were 25 | sent to the client, but the browser was too slow. If the hashes don't arrive within this time, the checkout promise 26 | will be rejected with `ZKSYNC_CLOSED_ERROR`. On the other hand, every `OPENER_CLOSED_POLL_INTERVAL` ms the zkSync 27 | page checks if the client's page is closed. If it is closed before the transactions' hashes were sent, there is a 28 | danger that the hashes that the zkSync page will send won't be processed by the client. To prevent this from 29 | happening the zkSync page will warn the user about that and advice her not to continue the checkout. 30 | 5. When the user clicks on transfer, the zkSync page sends to the opener the array of hashes of the transactions. 31 | 6. (Optional for the client) After the client receives the transactions, he can either wait until they are committed or 32 | verified using the `wait` function. 33 | 34 | **Time constants (all in ms):** 35 | 36 | - `OPENING_TIMEOUT` — 10000 37 | - `CLOSE_POLL_INTERVAL` — 3000 38 | - `FOLLOWUP_HASHES_TIMEOUT` — 500 39 | - `OPENER_CLOSED_POLL_INTERVAL` — 300 40 | 41 | ## Making sure that the user knows about an error 42 | 43 | In order to prevent the situation, where the checkout promise was rejected on the client's webpage, but the user does 44 | not know it, the following measures are taken: 45 | 46 | If the checkout promise is rejected, an `ABORT_CHECKOUT` message is sent to the zkSync page. The message is then handled 47 | by the zkSync page accordingly (show a modal with the error message and suggest the user not to continue the checkout). 48 | -------------------------------------------------------------------------------- /docs/api/sdk/checkout/tutorial/README.md: -------------------------------------------------------------------------------- 1 | # Getting started 2 | 3 | In this tutorial we will demonstrate how to integrate basic zkSync checkout flow into any website: 4 | 5 | 1. Check if the user has sufficient balance to pay for the goods. 6 | 2. Proceed to checkout. 7 | 3. Verify that the transactions have been completed. 8 | 9 | ## Adding dependencies 10 | 11 | ```bash 12 | yarn add zksync-checkout 13 | yarn add ethers # ethers is a peer dependency of zksync-checkout 14 | ``` 15 | 16 | Even though the library requires the `ethers` as its peer dependency there is no need to deal with connecting web3 17 | providers onto your website. The library by itself is sufficient to receive payments in crypto, the rest is handled by 18 | zkSync. 19 | 20 | See [Appendix A](./appendix-a) for how to add library to web project directly from 21 | [https://unpkg.com](https://unpkg.com) CDN. 22 | 23 | **Please note, that the library works only in browser environment, since the user is guided through zkCheckout via a 24 | popup** 25 | 26 | ## Structure of the tutorial 27 | 28 | This tutorial does not cover back-end or front-end code that is needed for a website but focuses solely on how to use 29 | the `zksync-checkout` library. 30 | 31 | This tutorial will show the basic checkout flow by putting all the action inside a single function: 32 | 33 | ```ts 34 | import { Types } from 'zksync-checkout'; 35 | 36 | async function checkoutUser( 37 | // The list of payments the user has to do 38 | transactions: Types.ZkSyncTransaction[], 39 | // The token in which the user will pay the fee 40 | feeToken: Types.TokenLike, 41 | // The app can accept payments whether you know the address of the user or you don't 42 | address?: string 43 | ) { 44 | // Here will go the code 45 | } 46 | ``` 47 | 48 | Let's say that the user has to make two payments: one for some apples worth 23 DAI and one for the bananas worth 55.5 49 | DAI, also the user should pay the zkSync fee in DAI. Then you could call the function the following way: 50 | 51 | ```ts 52 | const transactions = [ 53 | { 54 | to: '', 55 | token: 'DAI', 56 | // The amount should be specified in wei 57 | amount: '23000000000000000000', 58 | description: 'For apples' 59 | }, 60 | { 61 | to: '', 62 | token: 'DAI', 63 | amount: '55500000000000000000', 64 | description: 'For bananas' 65 | } 66 | ]; 67 | 68 | // Here we assume that we don't know the address of the user 69 | checkoutUser(transactions, 'DAI'); 70 | ``` 71 | 72 | ## Creating checkout manager 73 | 74 | For each checkout we need to create a separate `CheckoutManager` object which handles all the necessary internals needed 75 | for the checkout: 76 | 77 | ```ts 78 | import { CheckoutManager } from 'zksync-checkout'; 79 | 80 | // .. 81 | 82 | // 'goerli' is also supported 83 | const checkoutManager = new CheckoutManager('mainnet'); 84 | ``` 85 | 86 | ## Checking user's balance 87 | 88 | If the user's address is known, we should check if the user has sufficient funds to proceed with the payment. This can 89 | be done easily with the following piece of code: 90 | 91 | ```ts 92 | // For testing purposes, the default providers could be used 93 | // but for the production, it is preferred to use custom providers 94 | // (e.g. Infura, Alchemy, etc) 95 | const ethProvider = ethers.providers.getDefaultProvider('mainnet'); 96 | 97 | // ... 98 | 99 | // Checks that sum of L1 + L2 balances of the user are sufficient to pay 100 | // for the transactions 101 | const hasEnoughBalance = await checkoutManager.checkEnoughBalance(transactions, feeToken, address, ethProvider); 102 | 103 | // Notify the user that she does not hold enough funds 104 | if (!hasEnoughBalance) { 105 | throw new Error('Not enough balance!'); 106 | } 107 | ``` 108 | 109 | ## Proceed to checkout 110 | 111 | ```ts 112 | // Proceeding to the checkout, retrieving the transactions' hashes 113 | const txHashes = await checkoutManager.zkSyncBatchCheckout(transactions, feeToken); 114 | 115 | // Waiting until the transactions complete 116 | const receipts = await checkoutManager.wait(txHashes, 'COMMIT'); 117 | ``` 118 | 119 | zkSync will guide the user through the process of the payment. 120 | 121 | The app has to wait until the transactions complete to be sure that they were successful. 122 | 123 | ::: warning 124 | 125 | It is always a good practice to validate the data received from the front-end on the back-end. 126 | 127 | So make sure to check on the server side that the transactions were valid and have been completed. This can be easily 128 | done through the SDKs for the supported languages. Here is 129 | [an example from JS SDK](/api/sdk/js/providers/#wait-for-transaction-receipt). If there is no zkSync SDK for your backend 130 | language you can easily check the transaction status [via our API](/api/v0.1/#transaction-details). 131 | 132 | ::: 133 | 134 | ## Full example 135 | 136 | Here is the code of the full user checkout flow: 137 | 138 | ```tsx 139 | import { Types, CheckoutManager } from 'zksync-checkout'; 140 | 141 | // For the testing purposes the default providers could be used 142 | // but for the production it is preferred to use custom providers 143 | // (e.g. Infura, Alchemy, etc) 144 | const ethProvider = ethers.providers.getDefaultProvider('mainnet'); 145 | 146 | async function checkoutUser( 147 | // The list of payments the user has to do 148 | transactions: Types.ZkSyncTransaction[], 149 | // The token in which the user will pay the fee 150 | feeToken: Types.TokenLike, 151 | // The app can accept payments whether you know the address of the user or you don't 152 | address?: string 153 | ) { 154 | const checkoutManager = new CheckoutManager('mainnet'); 155 | 156 | if (address) { 157 | // Checks that sum of L1 + L2 balances of the user are sufficient to pay 158 | // for the transactions 159 | const hasEnoughBalance = await checkoutManager.checkEnoughBalance(transactions, feeToken, address, ethProvider); 160 | 161 | if (!hasEnoughBalance) { 162 | throw new Error('Not enough balance!'); 163 | } 164 | } 165 | 166 | // Proceeding to the checkout, retrieving the transactions' hashes 167 | const txHashes = await checkoutManager.zkSyncBatchCheckout(transactions, feeToken); 168 | 169 | // Waiting until the transactions complete 170 | const receipts = await checkoutManager.wait(txHashes, 'COMMIT'); 171 | 172 | // Now we now that the transactions have completed and 173 | // we can send the payment info to be processed on the back-end of your app 174 | } 175 | 176 | const transactions = [ 177 | { 178 | to: '', 179 | token: 'DAI', 180 | // The amount should be specified in wei 181 | amount: '23000000000000000000', 182 | description: 'For apples' 183 | }, 184 | { 185 | to: '', 186 | token: 'DAI', 187 | amount: '55500000000000000000', 188 | description: 'For bananas' 189 | } 190 | ]; 191 | 192 | // Here we assume that you don't know the address of the user 193 | checkoutUser(transactions, 'DAI'); 194 | ``` 195 | -------------------------------------------------------------------------------- /docs/api/sdk/checkout/types/README.md: -------------------------------------------------------------------------------- 1 | # Types 2 | 3 | ## ZkSyncTransaction 4 | 5 | Every transaction that is passed into `zkSyncBatchCheckout` or `estimateBatchFee` should adhere to the following 6 | interface: 7 | 8 | ```tsx 9 | interface ZkSyncTransaction { 10 | // If the address specified differs from the one that the 11 | // user logs in to zkSync with, the user will be asked to re-login 12 | from?: string; 13 | to: string; 14 | token: TokenLike; 15 | amount: string; 16 | semanticType?: 'Transaction' | 'FeeOrCommission'; 17 | description?: string; 18 | } 19 | ``` 20 | 21 | - `from` — this field contains the Ethereum address of the transaction sender. The field can be omitted since the user 22 | has to log in to zkSync before continuing the checkout process. But if this field is specified and the account from 23 | which the user logs in to zkSync differs from any of the `from` fields of the transactions, the zkSync checkout page 24 | will notify the user about that and will ask her to log in to the appropriate account. 25 | - `to` — this field contains the Ethereum address of the recipient of the transaction. 26 | - `token` — the symbol of the token in which the transaction will be done. 27 | - `amount` — the number of tokens in wei to be transferred. 28 | - `semanticType` — semantic type of the transaction, it is used to help the zkSync checkout popup provide better UX. For 29 | instance, if your website collects fees in a certain transaction, you should set `semanticType` to 30 | `'FeeOrCommission'`. The default value is `'Transaction'`. 31 | 32 | **Note** that if you set `semanticType` to `'FeeOrCommission'` then you also MUST provide a non-empty `description`. If 33 | you don't, the checkout will fail with `RECEIVED_INVALID_DATA_ERROR`. 34 | 35 | - `description` — the transaction description. For now, it is only used when `semanticType` is set to 36 | `'FeeOrCommission'`, and is ignored otherwise. 37 | 38 | ## TokenLike 39 | 40 | Just a string. Has a special type name to clarify that the string should be equal to a token's symbol. 41 | 42 | ```tsx 43 | type TokenLike = string; 44 | ``` 45 | 46 | ## EthereumNetwork 47 | 48 | The type which specifies an Ethereum network. 49 | 50 | ```tsx 51 | type EthereumNetwork = 'goerli' | 'mainnet'; 52 | ``` 53 | -------------------------------------------------------------------------------- /docs/api/sdk/java/README.md: -------------------------------------------------------------------------------- 1 | # Android SDK 2 | 3 | This section contains documentation for the Java SDK for zkSync. 4 | 5 | ::: warning 6 | 7 | This is the alpha version of the SDK, if you find mistakes - you can contact us on Discord. 8 | 9 | ::: 10 | 11 | ## Resources 12 | 13 | - [zkSync Lite Block Explorer](https://zkscan.io/) 14 | - [zkSync Java SDK github page](https://github.com/zksync-sdk/zksync-java) 15 | 16 | ## Table of contents 17 | 18 | - [Getting started](./tutorial) 19 | - [Interfaces](./interfaces) 20 | -------------------------------------------------------------------------------- /docs/api/sdk/js/README.md: -------------------------------------------------------------------------------- 1 | # JavaScript SDK 2 | 3 | This section contains documentation for the JavaScript SDK for zkSync. 4 | 5 | ## Resources 6 | 7 | - [zkSync Lite Block Explorer](https://zkscan.io/) 8 | - [zkSync JS SDK github page](https://github.com/matter-labs/zksync/tree/master/sdk/zksync.js) 9 | 10 | ## Table of contents 11 | 12 | - [Getting started](./tutorial) 13 | - [Providers](./providers) 14 | - [Accounts](./accounts) 15 | - [Utils](./utils) 16 | - [Types](./types) 17 | - [Appendix A: Using bundle in a browser](./browser-bundled) 18 | -------------------------------------------------------------------------------- /docs/api/sdk/js/browser-bundled/README.md: -------------------------------------------------------------------------------- 1 | # Appendix A: Using bundle in a browser 2 | 3 | It is possible to use `zksync.js` in a browser directly. 4 | 5 | - `ethers@5.0` dependency is required for `zksync.js` to work. 6 | 7 | > Example with zksync@0.8.1 fetched from [https://unpkg.com](https://unpkg.com) CDN 8 | 9 | ```html 10 | 11 | 12 | 13 | 14 | 27 | 28 | 29 | ``` 30 | -------------------------------------------------------------------------------- /docs/api/sdk/js/tutorial/README.md: -------------------------------------------------------------------------------- 1 | # Getting started 2 | 3 | In this tutorial we will demonstrate how to: 4 | 5 | 1. Connect to the zkSync network. 6 | 1. Deposit assets from Ethereum into zkSync. 7 | 1. Make transfers. 8 | 1. Withdraw funds back to Ethereum mainnet. 9 | 10 | ## Adding dependencies 11 | 12 | ```bash 13 | yarn add zksync 14 | yarn add ethers # ethers is a peer dependency of zksync 15 | ``` 16 | 17 | See [Appendix A](../browser-bundled) for how to add library to web project directly from 18 | [https://unpkg.com](https://unpkg.com) CDN. 19 | 20 | ## Adding imports 21 | 22 | You can import all the content of the zkSync library with the following statement: 23 | 24 | ```typescript 25 | import * as zksync from 'zksync'; 26 | ``` 27 | 28 | Note, that it is not actually required to import all of the library. For instance, if you only need the Wallet class, 29 | you can safely do 30 | 31 | ```typescript 32 | import { Wallet } from 'zksync'; 33 | ``` 34 | 35 | But in the rest of the book we will assume that the library was imported the first way to differentiate content imported 36 | from the zksync and ethers libraries. 37 | 38 | ## Connecting to zkSync network 39 | 40 | To interact with zkSync network users need to know the endpoint of the operator node. 41 | 42 | ```typescript 43 | const syncProvider = await zksync.getDefaultProvider('goerli'); 44 | ``` 45 | 46 | Most operations require some read-only access to the Ethereum network. We use `ethers` library to interact with 47 | Ethereum. 48 | 49 | ```typescript 50 | const ethersProvider = ethers.getDefaultProvider('goerli'); 51 | ``` 52 | 53 | ## Creating a Wallet 54 | 55 | To control your account in zkSync, use the `zksync.Wallet` object. It can sign transactions with keys stored in 56 | `zksync.Signer` and send transaction to zkSync network using `zksync.Provider`. 57 | 58 | `zksync.Wallet` is a wrapper around 2 objects: 59 | 60 | - `ethers.Signer` to sign Ethereum transactions. 61 | - `zksync.Signer` to sign native zkSync transactions. 62 | 63 | The private key used by `zksync.Signer` is implicitly derived from Ethereum signature of a special message. 64 | 65 | ```typescript 66 | // Create ethereum wallet using ethers.js 67 | const ethWallet = ethers.Wallet.fromMnemonic(MNEMONIC).connect(ethersProvider); 68 | 69 | // Derive zksync.Signer from ethereum wallet. 70 | const syncWallet = await zksync.Wallet.fromEthSigner(ethWallet, syncProvider); 71 | ``` 72 | 73 | ## Depositing assets from Ethereum into zkSync 74 | 75 | We are going to deposit `1.0 ETH` to our zkSync account. 76 | 77 | ```typescript 78 | const deposit = await syncWallet.depositToSyncFromEthereum({ 79 | depositTo: syncWallet.address(), 80 | token: 'ETH', 81 | amount: ethers.utils.parseEther('1.0') 82 | }); 83 | ``` 84 | 85 | "ETH" stands for native Ether. To transfer supported ERC20 token use ERC20 address or ERC20 symbol instead of "ETH". 86 | 87 | After the tx is submitted to the Ethereum node, we can track its status using the returned object: 88 | 89 | ```typescript 90 | // Await confirmation from the zkSync operator 91 | // Completes when a promise is issued to process the tx 92 | const depositReceipt = await deposit.awaitReceipt(); 93 | 94 | // Await verification 95 | // Completes when the tx reaches finality on Ethereum 96 | const depositReceipt = await deposit.awaitVerifyReceipt(); 97 | ``` 98 | 99 | ## Unlocking zkSync account 100 | 101 | To control assets in zkSync network, an account must register a separate public key once. 102 | 103 | ```typescript 104 | if (!(await syncWallet.isSigningKeySet())) { 105 | if ((await syncWallet.getAccountId()) == undefined) { 106 | throw new Error('Unknown account'); 107 | } 108 | 109 | // As any other kind of transaction, `ChangePubKey` transaction requires fee. 110 | // User doesn't have (but can) to specify the fee amount. If omitted, library will query zkSync node for 111 | // the lowest possible amount. 112 | const changePubkey = await syncWallet.setSigningKey({ 113 | feeToken: 'ETH', 114 | ethAuthType: 'ECDSA' 115 | }); 116 | 117 | // Wait until the tx is committed 118 | await changePubkey.awaitReceipt(); 119 | } 120 | ``` 121 | 122 | ## Checking zkSync account balance 123 | 124 | ```typescript 125 | // Committed state is not final yet 126 | const committedETHBalance = await syncWallet.getBalance('ETH'); 127 | 128 | // Verified state is final 129 | const verifiedETHBalance = await syncWallet.getBalance('ETH', 'verified'); 130 | ``` 131 | 132 | To list all tokens of this account at once, use `getAccountState`: 133 | 134 | ```typescript 135 | const state = await syncWallet.getAccountState(); 136 | 137 | const committedBalances = state.committed.balances; 138 | const committedETHBalance = committedBalances['ETH']; 139 | 140 | const verifiedBalances = state.verified.balances; 141 | const committedETHBalance = verifiedBalances['ETH']; 142 | ``` 143 | 144 | ## Making a transfer in zkSync 145 | 146 | Now, let's create a second wallet and transfer some funds into it. Note that we can send assets to any fresh Ethereum 147 | account, without preliminary registration! 148 | 149 | ```typescript 150 | const ethWallet2 = ethers.Wallet.fromMnemonic(MNEMONIC2).connect(ethersProvider); 151 | const syncWallet2 = await zksync.SyncWallet.fromEthSigner(ethWallet2, syncProvider); 152 | ``` 153 | 154 | We are going to transfer `0.999 ETH` to another account and pay `0.001 ETH` as a fee to the operator (zkSync account 155 | balance of the sender is going to be decreased by `0.999 + 0.001 ETH`). The use of `closestPackableTransactionAmount()` 156 | and `closestPackableTransactionFee()` is necessary because the precision of transfer in zkSync is limited (see docs 157 | below). 158 | 159 | ```typescript 160 | const amount = zksync.utils.closestPackableTransactionAmount(ethers.utils.parseEther('0.999')); 161 | const fee = zksync.utils.closestPackableTransactionFee(ethers.utils.parseEther('0.001')); 162 | 163 | const transfer = await syncWallet.syncTransfer({ 164 | to: syncWallet2.address(), 165 | token: 'ETH', 166 | amount, 167 | fee 168 | }); 169 | ``` 170 | 171 | Note that setting fee manually is not required. If `fee` field is omitted, SDK will choose the lowest possible fee 172 | acceptable by server: 173 | 174 | ```typescript 175 | const amount = zksync.utils.closestPackableTransactionAmount(ethers.utils.parseEther('0.999')); 176 | 177 | const transfer = await syncWallet.syncTransfer({ 178 | to: syncWallet2.address(), 179 | token: 'ETH', 180 | amount 181 | }); 182 | ``` 183 | 184 | To track the status of this transaction: 185 | 186 | ```typescript 187 | const transferReceipt = await transfer.awaitReceipt(); 188 | ``` 189 | 190 | ## Withdrawing funds back to Ethereum 191 | 192 | ```typescript 193 | const withdraw = await syncWallet2.withdrawFromSyncToEthereum({ 194 | ethAddress: ethWallet2.address, 195 | token: 'ETH', 196 | amount: ethers.utils.parseEther('0.998') 197 | }); 198 | ``` 199 | 200 | Assets will be withdrawn to the target wallet after the zero-knowledge proof of zkSync block with this operation is 201 | generated and verified by the mainnet contract. 202 | 203 | We can wait until ZKP verification is complete: 204 | 205 | ```typescript 206 | await withdraw.awaitVerifyReceipt(); 207 | ``` 208 | -------------------------------------------------------------------------------- /docs/api/sdk/python/README.md: -------------------------------------------------------------------------------- 1 | # Python SDK 2 | 3 | This section contains documentation for the Python SDK for zkSync. 4 | 5 | ## Resources 6 | 7 | - [zkSync Lite block explorer](https://zkscan.io/) 8 | - [zkSync Python SDK github page](https://github.com/zksync-sdk/zksync-python) 9 | 10 | ## Table of contents 11 | 12 | - [Getting started](./tutorial) 13 | -------------------------------------------------------------------------------- /docs/api/sdk/rust/README.md: -------------------------------------------------------------------------------- 1 | # Rust SDK 2 | 3 | This section contains documentation for the Rust SDK for zkSync. 4 | 5 | ## Resources 6 | 7 | - [zkSync Lite Wallet](https://lite.zksync.io/) 8 | - [zkSync Rust SDK github page](https://github.com/matter-labs/zksync/tree/master/sdk/zksync-rs) 9 | 10 | ## Table of contents 11 | 12 | - [Getting started](./tutorial) 13 | -------------------------------------------------------------------------------- /docs/api/sdk/swift/README.md: -------------------------------------------------------------------------------- 1 | # iOS SDK 2 | 3 | This section contains documentation for the Swift SDK for zkSync. 4 | 5 | ::: warning 6 | 7 | This is the alpha version of the SDK, if you find mistakes - you can contact us on Discord. 8 | 9 | ::: 10 | 11 | ## Resources 12 | 13 | - [zkSync Lite block explorer](https://zkscan.io/) 14 | - [zkSync Swift SDK github page](https://github.com/zksync-sdk/zksync-swift) 15 | 16 | ## Table of contents 17 | 18 | - [Getting started](./tutorial) 19 | -------------------------------------------------------------------------------- /docs/api/v0.2/README.md: -------------------------------------------------------------------------------- 1 | # zkSync API v0.2 2 | 3 | The new API interface for the zkSync network has been recently made available! This API unifies JSON-RPC and REST API 4 | under one REST interface. 5 | 6 | The documentation is available [here](https://docs.lite.zksync.io/apiv02-docs/) (the re-design will be available in the 7 | future). 8 | -------------------------------------------------------------------------------- /docs/dev/README.md: -------------------------------------------------------------------------------- 1 | # Introduction to zkSync Lite for Developers 2 | 3 | ## Overview 4 | 5 | zkSync is a scaling and privacy engine for Ethereum. Its current functionality scope includes low gas transfers of ETH 6 | and ERC20 tokens in the Ethereum network, atomic swaps & limit orders as well as native L2 NFT support. This document is 7 | a high-level description of the zkSync development ecosystem. 8 | 9 | zkSync is built on ZK Rollup architecture. ZK Rollup is an L2 scaling solution in which all funds are held by a smart 10 | contract on the mainchain, while computation and storage are performed off-chain. For every Rollup block, a state 11 | transition zero-knowledge proof (SNARK) is generated and verified by the mainchain contract. This SNARK includes the 12 | proof of the validity of every single transaction in the Rollup block. Additionally, the public data update for every 13 | block is published over the mainchain network in the cheap calldata. 14 | 15 | This architecture provides the following guarantees: 16 | 17 | - The Rollup validator(s) can never corrupt the state or steal funds (unlike Sidechains). 18 | - Users can always retrieve the funds from the Rollup even if validator(s) stop cooperating because the data is 19 | available (unlike Plasma). 20 | - Thanks to validity proofs, neither users nor a single other trusted party needs to be online to monitor Rollup blocks 21 | in order to prevent fraud (unlike payment channels or Optimistic Rollups). 22 | 23 | In other words, ZK Rollup strictly inherits the security guarantees of the underlying L1. 24 | 25 | ## Capabilities 26 | 27 | First of all, zkSync, as a scaling solution, is capable of making transfers, and doing them quick and cheap. Interfaces 28 | and principles of the core zkSync functionality are covered in the [payments section](/dev/payments) of this 29 | documentation. 30 | 31 | Secondly, zkSync is friendly for exchanges. Atomic swaps — an essential component of exchange protocols — are already 32 | [available](/dev/contracts/) on mainnet! 33 | 34 | Thirdly, zkSync has native support of NFTs. You can try it out in our [wallet](https://lite.zksync.io/). 35 | 36 | Finally, zkSync support is implemented for all the main platforms. Check out our [SDK section](/api/sdk) of docs, and 37 | start developing with zkSync! 38 | 39 | If you need smart contract support, zkSync Era is your go to solution. As of February 2022, zkSync Era Testnet has been live featuring smart contracts in Solidity or reusing existing Solidity code. You can find more details in the [zkSync Era Documentation](https://docs.zksync.io) 40 | -------------------------------------------------------------------------------- /docs/dev/contracts/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # Smart contracts 6 | 7 | zkSync is on track to introduce highly efficient, secure, Turing complete, multilanguage smart contracts. 8 | 9 | [[toc]] 10 | 11 | 12 | 13 | ## Programming model 14 | 15 | The zkSync smart contract programming model inherits that of Ethereum. 16 | 17 | Solidity will be supported first, so you can use unbounded loops, recursion, vectors and maps of arbitrary length, and 18 | so on. Local variables are stored on the stack or the heap, whereas the contract storage is accessed globally. Contracts 19 | call one another via strongly typed interfaces and have access to public storage fields. 20 | 21 | ## Composability 22 | 23 | zkSync smart contracts are able to call one another just like Ethereum smart contracts can. Each call transaction tree 24 | is atomic, regardless of the number of contract instances involved. 25 | 26 | Any DeFi project can be migrated to zkSync, since most of the existing Solidity code can be deployed without changes. 27 | 28 | ## zkEVM 29 | 30 | The zkEVM is a highly efficient, Turing complete, SNARK-friendly virtual machine for executing smart contracts. 31 | 32 | State-of-the-art optimizations are applied to smart contract bytecode, while the virtual machine itself is optimized for 33 | high load, allowing it to execute transactions in the blink of an eye. 34 | 35 | The machine is SNARK-friendly; that is, the execution trace can be proven in SNARKs. However, it does not require one 36 | circuit per program. A single circuit can be used instead, which needs to be audited only once. 37 | 38 | The target proof system of the Sync VM is [PLONK](https://eprint.iacr.org/2019/953). 39 | 40 | ## Solidity 41 | 42 | ### Porting Smart Contracts 43 | 44 | Most DeFi and NFT projects will work with no code changes. However, in the first version, calls to SHA256 and Keccak256 45 | will be replaced with a circuit friendly hash function automatically by the compiler. A few other cryptographic 46 | primitives are currently also unsupported, for example ecrecover and the cryptographic precompiles. 47 | 48 | ### UI Interaction 49 | 50 | You can interact completely with smart contracts and the zkSync network via our Web3 API and Ethers SDK: 51 | 52 | - For _read_ requests: any web3-compliant framework in any language will work out of the box, with additional optional 53 | zkSync L2 specific functionality. 54 | - For _write_ requests (sending transactions): due to fundamental differences between L1 and L2, you will have to write 55 | some additional code (for example, zkSync supports paying fees in any token, so sending a transaction will involve 56 | choosing a token to pay fees). 57 | 58 | You can ask questions and get assistance in our [Discord](https://join.zksync.dev/) developer chat room. 59 | 60 | ### Submitting Transactions 61 | 62 | For interactions with smart contracts, users will sign an EIP712 message with a hash of the calldata. Since EIP712 is 63 | based on a native Ethereum signature, all wallets, even hardware wallets, will work without any extensions required. 64 | 65 | ### Deployment 66 | 67 | ZKsync Era Mainnet is here! To get started visit the [ZKsync Era Documentation](https://docs.zksync.io). 68 | 69 | ## Zinc 70 | 71 | ::: warning 72 | 73 | We would like to inform our users that we have shifted our primary focus towards a [Solidity-first approach](https://medium.com/matter-labs/unisync-a-port-of-uniswap-v2-on-the-zkevm-b12954748504), and as a result, Zinc is now officially deprecated, meaning it will not receive any further updates or support in the future. 74 | 75 | ::: 76 | 77 | [Zinc](https://github.com/matter-labs/zinc) is an emerging framework for developing smart contracts and SNARK circuits 78 | on the zkSync platform. 79 | 80 | Existing ZKP frameworks lack functionality specific to smart contracts. Since smart contracts deal with valuable 81 | financial assets, security and safety are crucial. That's why designers of modern smart contract languages, such as 82 | Simplicity or Libra's Move, favored safety and formal verifiability of the code over expressiveness. 83 | 84 | Zinc is created to fill the gap between these two worlds by providing a simple, reliable smart contract language that is 85 | optimized for ZKP circuits and is easy for developers to learn. 86 | 87 | The framework includes a simple, Turing complete, safety-focused, general-purpose language designed specifically for 88 | developing smart contracts and zero-knowledge proof circuits with a flat learning curve. The syntax and semantics 89 | closely follow that of [Rust](https://www.rust-lang.org/). 90 | 91 | The Zinc compiler uses LLVM as its middle-end and back-end, which provides a powerful set of solutions for code 92 | optimization. 93 | 94 | ## Getting help 95 | 96 | Most questions are answered in our [zkEVM FAQ](/zkevm/README.md) and major concepts are outlined on our 97 | [Medium](https://medium.com/matter-labs). 98 | 99 | You can ask questions and get assistance in our [Discord](https://join.zksync.dev/) developer chat room. 100 | -------------------------------------------------------------------------------- /docs/dev/payments/README.md: -------------------------------------------------------------------------------- 1 | # zkSync payments 2 | 3 | This section provides a guide on how zkSync protocol works, and how to interact with it. 4 | 5 | - [Basic Concepts](./basic) 6 | - [Sending Transactions](./sending_transactions) 7 | -------------------------------------------------------------------------------- /docs/dev/security/README.md: -------------------------------------------------------------------------------- 1 | # zkSync Security 2 | 3 | - [Security Approach](./approach) 4 | - [Bug Bounty](./bug-bounty) 5 | - [List of Known Bugs](./bugs) 6 | - [Vulnerability Disclosure Policy](./disclosure) 7 | -------------------------------------------------------------------------------- /docs/dev/security/ZKSYNC1-2021-01/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # ZKSYNC1-2021-01 Post Mortem 6 | 7 | ## Summary 8 | 9 | On July 26, 2021, we were notified of a critical vulnerability in zkSync’s smart contracts that was introduced in 10 | zkSync’s [Version 5.1 upgrade](https://github.com/matter-labs/zksync/blob/master/changelog/contracts.md#2021-05-31) on 11 | July 1. The fix was [deployed](https://github.com/matter-labs/zksync/blob/master/changelog/contracts.md#2021-07-27) on 12 | July 27, and all funds are safe. At the time of the report, zkSync had $8.5m USD in total value locked and was the only 13 | severe vulnerability in the zkSync protocol since genesis to date. 14 | 15 | ## Technical Details 16 | 17 | ### The Vulnerability 18 | 19 | To initialize new upgrades, the 20 | [initialize](https://github.com/matter-labs/zksync/blob/153449487a04a32e1412926c9f5bd443760a659e/contracts/contracts/ZkSync.sol#L129) 21 | function inside the zkSync main contract is called: 22 | 23 | ![zksync1-2021-01-bug.png](/zksync1-2021-01-bug.png) 24 | 25 | This function can be external because the Proxy contract which uses this contract as a target for delegatecalls 26 | intercepts all calls of the function with such signature. However, this meant initialize could be called on the target 27 | contract with any parameters at any time, allowing anyone to set `additionalZkSync` in the target contract storage to 28 | any address. 29 | 30 | If the attacker sets `additionalZkSync` to an address that would execute the `SELFDESTRUCT` opcode on any entry, and 31 | then call any function on the zkSync main contract that uses logic from `additionalZkSync` via delegatecall, the main 32 | zkSync target contract could have been destroyed and all funds would have been frozen. 33 | 34 | Funds could not be stolen because the Proxy contract owns the rollup assets and it did not contain a vulnerability, only 35 | the code of the Proxy’s target. 36 | 37 | ### The Fix 38 | 39 | Because there is a 3-day timelock from the initialization of the upgrade and the execution, we introduced the fix in a 40 | way that those who checked the code diff during the upgrade would not find the vulnerability. 41 | 42 | To fix the vulnerability, we updated the `initializeReentrancyGuard` function to the new OpenZeppelin version and added 43 | a check that makes it impossible to reinitialize ReentrancyGuard and the main contract’s target consequently. For the 44 | updated version, we initialized zkSync’s target contract while deploying, so no one can reinitialize it. 45 | 46 | ![zksync1-2021-01-fix.png](/zksync1-2021-01-fix.png) 47 | 48 | ## Bug Bounty 49 | 50 | In accordance with our Bug Bounty Policy, we have paid the person who made the disclosure our maximum bounty of $500,000 51 | due to the severity of the bug found. 52 | 53 | ## Conclusion 54 | 55 | Following this vulnerability, we have conducted a thorough internal review of our security approach and processes, 56 | introducing a number of systematic improvements not only to fix the root cause, but also to make our entire system more 57 | robust in bug prevention and reaction. 58 | 59 | To better manage the security of a rapidly upgrading protocol, we: upgraded our security council to allow for instant 60 | upgradability with 9/15 signatures, improved our bug bounty program and are partnering with ImmuneFi. These improvements are explored in depth in this 61 | [article](https://medium.com/@matterlabs/upgradability3-934db4433b0c). 62 | 63 | In the security section of our documentation, we have also added a JSON-formatted 64 | [list of known bugs](/dev/security/bugs) and updated our 65 | [vulnerability disclosure policy](/dev/security/disclosure). 66 | -------------------------------------------------------------------------------- /docs/dev/security/approach/README.md: -------------------------------------------------------------------------------- 1 | # Security by correctness, isolation, and obscurity 2 | 3 | Historically, there are 4 | [3 major approaches](https://theinvisiblethings.blogspot.com/2008/09/three-approaches-to-computer-security.html) to 5 | securing computer systems. How can we apply these approaches to zkSync and blockchains in general? 6 | 7 | ## 1. **Security by correctness** 8 | 9 | Security by correctness refers to being as proactive as we can in producing software that does not have bugs or 10 | maliciously behaving code. We do this by following the industry’s best practices. 11 | [Building Secure Contracts](https://github.com/crytic/building-secure-contracts) maintained by Trail of Bits, 12 | [Smart Contract Best Practices](https://consensys.github.io/smart-contract-best-practices/) maintained by Consensys 13 | Diligence, and 14 | [Security & Safety Research Base](https://github.com/OffcierCia/ultimate-defi-research-base#security--safety) maintained 15 | by Cia Officer are three of many great resources documenting the industry’s learnings from testing in production for the 16 | past few years. Our contracts and cryptography are also subject to internal and 17 | [external audits](/updates/security-audits). 18 | 19 | ## 2. **Security by isolation** 20 | 21 | The goal of security by isolation is to separate a system into smaller pieces to minimize the impact of the failure of 22 | one piece on all other pieces. Following this philosophy, our smart contracts are split and designed under the 23 | assumption that all other parts can be byzantine–unreliable, buggy, or compromised. 24 | 25 | Additionally, we believe that security by isolation can be further strengthened by adding redundancy. In zkSync, all 26 | transactions submitted are validated by simple execution before inclusion in the block. So if there is a vulnerability 27 | in our ZK circuits, the attacker would need to break through both the cryptography *and* the sequencer (our 28 | servers for now, but eventually switching to multi-validator PoS consensus). 29 | 30 | ## 3. **Security by obscurity** 31 | 32 | This approach relies on obscurity to make the attacker’s life as hard as possible, yet blockchain culture is grounded in 33 | radical transparency for developers and users, and complemented by our strong community of white-hat hackers. 34 | 35 | To strike the balance between secrecy for security’s sake and transparency, we are committed to the following: 36 | 37 | - **Upgrades**: All code for upgrades is made public for one month before they go live. 38 | - **Audits**: Full audit reports are published in our [documentation](/updates/security-audits). 39 | - **Vulnerability Disclosure**: All vulnerabilities must be handled silently until a fix is deployed and the Matter Labs 40 | team conducts a thorough internal review of not only the root cause, but also potential weak links in the overall 41 | security design. A public postmortem will be released with each vulnerability after systematic changes have been fully 42 | implemented. Please see our [full vulnerability disclosure policy](/dev/security/disclosure) and 43 | updated [list of known bugs](/dev/security/bugs). 44 | -------------------------------------------------------------------------------- /docs/dev/security/bug-bounty/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # Bug Bounty Program 6 | 7 | [[toc]] 8 | 9 | ## Scope 10 | 11 | Issues that can lead to substantial loss of money, critical bugs like a broken live-ness condition, blocking upgrade system, irreversible loss of 12 | funds, or enforced exodus mode. 13 | 14 | ## Assumptions 15 | 16 | In order to be eligible for the bug bounty, a bug should adhere to the security assumptions of zkSync. You can read more 17 | about them [here](https://github.com/matter-labs/zksync/blob/master/docs/protocol.md#assumptions). 18 | 19 | ## Disclosure Policy 20 | 21 | Let us know as soon as possible upon discovery of a potential security issue. 22 | 23 | Provide us a reasonable amount of time to resolve the issue **before any disclosure** **to the public or a third 24 | party.** 25 | 26 | ### The wrong way to disclose 27 | 28 | The following actions will make you ineligible for the bug bounty program: 29 | 30 | - Filing a public issue about the vulnerability 31 | - Testing the vulnerability on mainnet or testnet 32 | 33 | ### The right way to disclose 34 | 35 | Please email us at [security@zksync.io](mailto:security@zksync.io). We appreciate detailed information about confirming 36 | or fixing the vulnerability. If possible, please use the PGP key below to encrypt the message. 37 | 38 | ## Exclusions 39 | 40 | - Already known vulnerabilities. 41 | - Vulnerabilities in code not leading to funds lost or frozen. 42 | - Vulnerabilities not related to smart contracts or cryptography used by the protocol. 43 | 44 | ## Eligibility 45 | 46 | - You must be the first reporter of the vulnerability 47 | - You must be able to verify a signature from the same address 48 | - Provide enough information about the vulnerability 49 | 50 | ## Bounty Payout 51 | 52 | ![bounty-table.png](/bounty-table.png) 53 | 54 | For severe cases involving a total loss of funds, we will pay a bounty of $500,000. 55 | 56 | ## Contact 57 | 58 | Please submit all your requests here: [security@zksync.io](mailto:security@zksync.io). 59 | 60 | ### PGP Key 61 | 62 | The following PGP key may be used to communicate sensitive information to developers: 63 | 64 | Fingerprint: `5FED B2D0 EA2C 4906 DD66 71D7 A2C5 0B40 CE3C F297` 65 | 66 | ```text 67 | -----BEGIN PGP PUBLIC KEY BLOCK----- 68 | 69 | mQINBGEBmQkBEAD6tlkBEZFMvR8kOgxXX857nC2+oTik6TopJz4uCskuqDaeldMy 70 | l+26BBzLkIeO1loS+bzVgnNFJRrGt9gv98MzNEHJVv6D7GsSLlUX/pz7Lxn0J4ry 71 | o5XIk3MQTCUBdaXGs6GBLl5Xe8o+zNj4MKd4zjgDLinITNlE/YZCDsXyvYS3YFTQ 72 | cwaUTNlawkKgw4BLaEqwB2JuyEhI9wx5X7ibjFL32sWMolYsNAlzFQzM09HCurTn 73 | q0DYau9kPJARcEk9/DK2iq0z3gMCQ8iRTDaOWd8IbSP3HxcEoM5j5ZVAlULmjmUE 74 | StDaMPLj0Kh01Tesh/j+vjchPXHT0n4zqi1+KOesAOk7SIwLadHfQMTpkU7G2fR1 75 | BrA5MtlzY+4Rm6o7qu3dpZ+Nc4iM3FUnaQRpvn4g5nTh8vjG94OCzX8DXWrCKyxx 76 | amCs9PLDYOpx84fXYv4frkWpKh2digDSUGKhoHaOSnqyyvu3BNWXBCQZJ20rqEIu 77 | sXOQMxWIoWCOOPRRvrHrKDA2hpoKjs3pGsProfpVRzb9702jhWpTfbDp9WjQlFtX 78 | 2ZIDxlwAxcugClgrp5JiUxvhg2A9lDNwCF7r1e68uNv5usBZQVKPJmnvS2nWgKy8 79 | x9oJsnwrEjxwiRHd34UvfMkwY9RENSJ+NoXqBdS7Lwz4m6vgbzq6K56WPQARAQAB 80 | tCRaa1N5bmMgU2VjdXJpdHkgPHNlY3VyaXR5QHprc3luYy5pbz6JAk4EEwEKADgW 81 | IQRf7bLQ6ixJBt1mcdeixQtAzjzylwUCYQGZCQIbAwULCQgHAgYVCgkICwIEFgID 82 | AQIeAQIXgAAKCRCixQtAzjzyl5y8EAC/T3oq88Dak2b+5TlWdU2Gpm6924eAqlMt 83 | y1KksDezzNQUlPiCUVllpin2PIjU/S+yzMWKXJA04LoVkEPfPOWjAaavLOjRumxu 84 | MR6P2dVUg1InqzYVsJuRhKSpeexzNA5qO2BPM7/I2Iea1IoJPjogGbfXCo0r5kne 85 | KU7a5GEa9eDHxpHTsbphQe2vpQ1239mUJrFpzAvILn6jV1tawMn5pNCXbsa8l6l2 86 | gtlyQPdOQECy77ZJxrgzaUBcs/RPzUGhwA/qNuvpF0whaCvZuUFMVuCTEu5LZka2 87 | I9Rixy+3jqBeONBgb+Fiz5phbiMX33M9JQwGONFaxdvpFTerLwPK2N1T8zcufa01 88 | ypzkWGheScFZemBxUwXwK4x579wjsnfrY11w0p1jtDgPTnLlXUA2mom4+7MyXPg0 89 | F75qh6vU1pdXaCVkruFgPVtIw+ccw2AxD50iZQ943ZERom9k165dR9+QxOVMXQ4P 90 | VUxsFZWvK70/s8TLjsGljvSdSOa85iEUqSqh0AlCwIAxLMiDwh5s/ZgiHoIM6Xih 91 | oCpuZyK9p0dn+DF/XkgAZ/S91PesMye3cGm6M5r0tS26aoc2Pk6X37Hha1pRALwo 92 | MOHyaGjc/jjcXXxv6o55ALrOrzS0LQmLZ+EHuteCT15kmeY3kqYJ3og62KgiDvew 93 | dKHENvg7d7kCDQRhAZleARAA6uD6WfdqGeKV5i170+kLsxR3QGav0qGNAbxpSJyn 94 | iHQ8u7mQk3S+ziwN2AAopfBk1je+vCWtEGC3+DWRRfJSjLbtaBG8e6kLP3/cGA75 95 | qURz6glTG4nl5fcEAa6B1st0OxjVWiSLX3g/yjz8lznQb9awuRjdeHMnyx5DsJUN 96 | d+Iu5KxGupQvKGOMKivSvC8VWk9taaQRpRF+++6stLCDk3ZtlxiopMs3X2jAp6xG 97 | sOBbix1cv9BTsfaiL7XDL/gviqBPXYY5L42x6+jnPo5lROfnlLYkWrv6KZr7HD4k 98 | tRXeaSwxLD2EkUyb16Jpp0be/ofvBtITGUDDLCGBiaXtx/v8d52MARjsyLJSYloj 99 | 1yiW01LfAiWHUC4z5jl2T7E7sicrlLH1M8Z6WbuqjdeaYwtfyPA2YCKr/3fn6pIo 100 | D+pYaBSESmhA92P+XVaf5y2BZ6Qf8LveDpWwsVGdBGh9T0raA1ooe1GESLjmIjUa 101 | z5AeQ/uXL5Md9I6bpMUUJYQiH19RPcFlJriI3phXyyf6Wlkk8oVEeCWyzcmw+x1V 102 | deRTvE2x4WIwKGLXRNjin2j1AP7vU2HaNwlPrLijqdyi68+0irRQONoH7Qonr4ca 103 | xWgL+pAaa3dWxf0xqK7uZFp4aTVWlr2uXtV/eaUtLmGMCU0jnjb109wg5L0F7WRT 104 | PfEAEQEAAYkCNgQYAQoAIBYhBF/tstDqLEkG3WZx16LFC0DOPPKXBQJhAZleAhsM 105 | AAoJEKLFC0DOPPKXAAEP/jK7ch9GkoaYlsuqY/aHtxEwVddUDOxjyn3FMDoln85L 106 | /n8AmLQb2bcpKSqpaJwMbmfEyr5MDm8xnsBTfx3u6kgaLOWfKxjLQ6PM7kgIMdi4 107 | bfaRRuSEI1/R6c/hNpiGnzAeeexldH1we+eH1IVmh4crdat49S2xh7Qlv9ahvgsP 108 | LfKl3rJ+aaX/Ok0AHzhvSfhFpPr1gAaGeaRt+rhlZsx2QyG4Ez8p2nDAcAzPiB3T 109 | 73ENoBIX6mTPfPm1UgrRyFKBqtUzAodz66j3r6ebBlWzIRg8iZenVMAxzjINAsxN 110 | w1Bzfgsi5ZespfsSlmEaa7jJkqqDuEcLa2YuiFAue7Euqwz1aGeq1GfTicQioSCb 111 | Ur/LGyz2Mj3ykbaP8p5mFVcUN51yQy6OcpvR/W1DfRT9SHFT/bCf9ixsjB2HlZGo 112 | uxPJowwqmMgHd755ZzPDUM9YDgLI1yXdcYshObv3Wq537JAxnZJCGRK4Y8SwrMSh 113 | 8WRxlaM0AGWXiJFIDD4bQPIdnF3X8w0cGWE5Otkb8mMHOT+rFTVlDODwm1zF6oIG 114 | PTwfVrpiZBwiUtfJol1exr/MzSPyGoJnYs3cRf2E3O+D1LbcR8w0LbjGuUy38Piz 115 | ZO/vCeyJ3JZC5kE8nD+XBA4idwzh0BKEfH9t+WchQ3Up9rxyzLyQamoqt5Xby4pY 116 | =xkM3 117 | -----END PGP PUBLIC KEY BLOCK----- 118 | 119 | ``` 120 | -------------------------------------------------------------------------------- /docs/dev/security/bugs/README.md: -------------------------------------------------------------------------------- 1 | # List of Known Bugs 2 | 3 | Below you will find a JSON-formatted list of known security-relevant bugs. The file itself is hosted in this GitHub 4 | repository. This list was started on January 1, 2022, and covers Version 5.2 and forward. 5 | 6 | The JSON file of known vulnerabilities is a list of objects, one for each vulnerability, with the following keys: 7 | 8 | `name`: unique name given to vulnerability 9 | 10 | `uid`: unique identifier of the vulnerability of format `ZKSYNC1--` 11 | 12 | `summary`: short description of the vulnerability 13 | 14 | `description`: detailed description of the vulnerability 15 | 16 | `links`: list of relevant URLs with more detailed information (optional) 17 | 18 | `introduced`: the first published zkSync version that contained the vulnerability 19 | 20 | `fixed`: the first published zkSync version that did not contain the vulnerability anymore 21 | 22 | `severity`: severity of the vulnerability: `low`, `medium`, `high`, `critical` taking into account the severity of 23 | impact and likelihood of exploitation 24 | 25 | ```json 26 | [ 27 | { 28 | "name": "SELFDESTRUCT main via delegatecall", 29 | "uid": "ZKSYNC1-2021-01", 30 | "summary": "The Proxy’s target code allowed setting the main zkSync contract to SELFDESTRUCT, resulting in a freeze of user funds.", 31 | "description": "The initialize function in the zkSync main contract could be called on the target contract with any parameters at any time, allowing anyone to set additionalZkSync in the target contract storage to any address. If the attacker sets additionalZkSync to an address that would execute the SELFDESTRUCT opcode on any entry, and then call any function on the zkSync main contract that uses logic from additionalZkSync via delegatecall, the main zkSync target contract could have been destroyed and all funds would have been frozen. Funds could not be stolen because the Proxy contract owns the rollup assets and it did not contain a vulnerability, only the code of the Proxy’s target.", 32 | "links": "https://zksync.io/dev/security/ZKSYNC1-2021-01", 33 | "introduced": "v5.1", 34 | "fixed": "v5.2", 35 | "severity": "Critical" 36 | } 37 | ] 38 | ``` 39 | 40 | Extended description is available [HERE](../ZKSYNC1-2021-01) 41 | -------------------------------------------------------------------------------- /docs/dev/security/disclosure/README.md: -------------------------------------------------------------------------------- 1 | # Vulnerability Disclosure 2 | 3 | Credit: The Geth and Solidity team has done an outstanding job in shaping their vulnerability disclosure policies and 4 | practices. The following is heavily inspired by Geth’s 5 | [Vulnerability Disclosure Policy](https://geth.ethereum.org/docs/vulnerabilities/vulnerabilities) and Solidity’s 6 | [Bug Disclosure Practices](https://docs.soliditylang.org/en/develop/bugs.html). 7 | 8 | ## About Disclosures 9 | 10 | The primary goal for the Matter Labs team is the health of the zkSync network as a whole, and the decision of when to 11 | publish the details of the vulnerability is dependent on minimizing the risk and impact of its discovery and 12 | exploitation. If the publicizing of the vulnerability would harm zkSync mainnet users, we reserve the right to silently 13 | patch and ship fixes. 14 | 15 | In general, when we receive a critical vulnerability report, we will proceed in this order: deploy a silent fix, notify 16 | zkSync forks, take additional measures in our security design and processes, and then disclose to the public. 17 | 18 | ## Public Transparency 19 | 20 | All vulnerabilities must be handled silently until a fix is deployed and the Matter Labs team conducts a thorough 21 | internal review of not only the root cause, but also potential weak links in the overall security design. A public 22 | postmortem will be released with each vulnerability after systematic changes have been fully implemented. For previous 23 | vulnerabilities and their postmortems, see below. 24 | 25 | ## Disclosed Vulnerabilities 26 | 27 | You can find a JSON-formatted list of known security-relevant bugs in this Github repository. This list was started on 28 | January 1, 2022, and covers Version 5.2 and forward. 29 | 30 | The JSON file of known vulnerabilities is a list of objects, one for each vulnerability, with the following keys: 31 | 32 | `name`: unique name given to vulnerability 33 | 34 | `uid`: unique identifier of the vulnerability of format `ZKSYNC1--` 35 | 36 | `summary`: short description of the vulnerability 37 | 38 | `description`: detailed description of the vulnerability 39 | 40 | `links`: list of relevant URLs with more detailed information (optional) 41 | 42 | `introduced`: the first published zkSync version that contained the vulnerability 43 | 44 | `fixed`: the first published zkSync version that did not contain the vulnerability anymore 45 | 46 | `severity`: severity of the vulnerability: `low`, `medium`, `high`, `critical` taking into account the severity of 47 | impact and likelihood of exploitation 48 | -------------------------------------------------------------------------------- /docs/maintenance/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: false 3 | --- 4 | 5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 | # Welcome to zkSync Lite — a zkRollup for trustless and scalable payments on Ethereum 19 | 20 |
21 |
22 |
23 | 24 | zkSync website is currently undergoing planned maintenance. We'll be back up in a bit! 25 | 26 | You can track the current maintenance status on [our twitter page](https://twitter.com/zksync). 27 | 28 | 29 | Try out the [zkSync Lite wallet](https://lite.zksync.io/). -------------------------------------------------------------------------------- /docs/service/down-night/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: false 3 | --- 4 | 5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 | # zkSync BETA is temporarily unavailable 19 | 20 |
21 |
22 |
23 | 24 | We apologize for the inconvenience — our team has been notified and will take care of this ASAP. Normally, we are 25 | responding to mainnet incidents almost instantly between 6am and 10pm CET. Soon, this availability window will be 26 | extended to 24/7. 27 | 28 | While keeping 100% zkSync uptime can be challenging at this stage, **the security of users' assets is not affected at 29 | all by any operational issues**. A great thing about ZK rollup — the tech that powers zkSync — is that the funds are 30 | [secured purely by smart contracts and zero-knowledge proofs](/userdocs/security). The zkSync 31 | [protocol](https://github.com/matter-labs/zksync/blob/master/docs/protocol.md) guarantees that any assets deposited into 32 | it will always be retrievable on Ethereum, even if all zkSync operators were shut down permanently or became malicious. 33 | Both smart contract and zero-knowledge parts of zkSync have been [thoroughly audited](/updates/security-audits). 34 | 35 | You can monitor the operational status of all zkSync components and testnets at the 36 | [zkSync status page](https://uptime.com/s/zkSync). Feel free to [contact us](https://zksync.io/contact) if you have 37 | any further questions. 38 | 39 | Sincerely, 40 | 41 | Your Matter Labs Team 42 | -------------------------------------------------------------------------------- /docs/service/down/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: false 3 | --- 4 | 5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 | # zkSync BETA is temporarily unavailable 19 | 20 |
21 |
22 |
23 | 24 | zkSync is temporarily down or undergoing a planned maintenance. We apologize for the inconvenience — our team is on it, 25 | we'll be back up in a bit! 26 | 27 | While keeping 100% zkSync uptime can be challenging at this stage, **the security of users' assets is not affected at 28 | all by any operational issues**. A great thing about ZK rollup — the tech that powers zkSync — is that the funds are 29 | [secured purely by smart contracts and zero-knowledge proofs](/userdocs/security). The zkSync 30 | [protocol](https://github.com/matter-labs/zksync/blob/master/docs/protocol.md) guarantees that any assets deposited into 31 | it will always be retrievable on Ethereum, even if all zkSync operators were shut down permanently or became malicious. 32 | Both smart contract and zero-knowledge parts of zkSync have been [thoroughly audited](/updates/security-audits). 33 | 34 | You can monitor the operational status of all zkSync components and testnets at the 35 | [zkSync status page](https://uptime.com/s/zkSync). Feel free to [contact us](https://zksync.io/contact) if you have 36 | any further questions. 37 | 38 | Sincerely, 39 | 40 | Your Matter Labs Team 41 | -------------------------------------------------------------------------------- /docs/service/testnet-down-night/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: false 3 | --- 4 | 5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 | # zkSync on this testnet is temporarily unavailable 19 | 20 |
21 |
22 |
23 | 24 | We apologize for the inconvenience — our team has been notified and will take care of this ASAP. Normally, we are 25 | responding to testnet incidents almost instantly between 6am and 10pm CET. In the future, this availability window will 26 | be extended to 24/7. 27 | 28 | While keeping 100% zkSync uptime can be challenging at this stage, **the security of users' assets is not affected at 29 | all by any operational issues**. A great thing about ZK rollup — the tech that powers zkSync — is that the funds are 30 | [secured purely by smart contracts and zero-knowledge proofs](/userdocs/security). The zkSync 31 | [protocol](https://github.com/matter-labs/zksync/blob/master/docs/protocol.md) guarantees that any assets deposited into 32 | it will always be retrievable on Ethereum, even if all zkSync operators were shut down permanently or became malicious. 33 | Both smart contract and zero-knowledge parts of zkSync have been [thoroughly audited](/updates/security-audits). 34 | 35 | You can monitor the operational status of all zkSync components and testnets at the 36 | [zkSync status page](https://uptime.com/s/zkSync). Feel free to [contact us](https://zksync.io/contact) if you have 37 | any further questions. 38 | 39 | Sincerely, 40 | 41 | Your Matter Labs Team 42 | -------------------------------------------------------------------------------- /docs/service/testnet-down/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: false 3 | --- 4 | 5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 | # zkSync on this testnet is temporarily unavailable 19 | 20 |
21 |
22 |
23 | 24 | zkSync on this testnet is temporarily down or undergoing a planned maintenance. We apologize for the inconvenience — our 25 | team is on it, we'll be back up in a bit! 26 | 27 | While keeping 100% zkSync uptime can be challenging at this stage, **the security of users' assets is not affected at 28 | all by any operational issues**. A great thing about ZK rollup — the tech that powers zkSync — is that the funds are 29 | [secured purely by smart contracts and zero-knowledge proofs](/userdocs/security). The zkSync 30 | [protocol](https://github.com/matter-labs/zksync/blob/master/docs/protocol.md) guarantees that any assets deposited into 31 | it will always be retrievable on Ethereum, even if all zkSync operators were shut down permanently or became malicious. 32 | Both smart contract and zero-knowledge parts of zkSync have been [thoroughly audited](/updates/security-audits). 33 | 34 | You can monitor the operational status of all zkSync components and testnets at the 35 | [zkSync status page](https://uptime.com/s/zkSync). Feel free to [contact us](https://zksync.io/contact) if you have 36 | any further questions. 37 | 38 | Sincerely, 39 | 40 | Your Matter Labs Team 41 | -------------------------------------------------------------------------------- /docs/updates/2020-06-19-report/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: false 3 | --- 4 | 5 | # zkSync day 1 incident report 6 | 7 | ## What happened 8 | 9 | Operation of zkSync was disrupted on the launch day for several hours, due to two separate incidents. 10 | 11 | ## The outcome 12 | 13 | Problems have been resolved, the system is up and running since then without interruptions. Funds in zkSync were not 14 | endangered. 15 | 16 | ## Incident #1 17 | 18 | Some users have initiated transactions to address zero (0x0000000000000000000000000000\- 000000000000). Though this is a 19 | permitted action in zkSync protocol, our server incorrectly managed the state of this transactions, which has resulted 20 | in generating blocks of incorrect format. No zero-knowledge proofs could be generated for these blocks because they 21 | would violate security constraints. 22 | 23 | After an investigation, our team has fixed the problem on the server, reverted invalid blocks, and initiated 24 | reapplication of the in-fly (unverified) transactions that were collected since the incorrect block was produced. 25 | Transactions to the zero address were not executed. 26 | 27 | To protect users from losing funds, we also implemented a check to disallow transactions to the zero address. 28 | 29 | ## Incident #2 30 | 31 | Several hours later, account state requests to zkSync API started to respond slowly (with ~15 sec latency), leading to a 32 | degraded user experience. 33 | 34 | This had the following reason. zkSync was originally designed and tested to operate under high load, with blocks 35 | generated every 3 seconds. However, for the launch it was decided to increase block generation to 15 minutes, as there 36 | was not so many requests expected. Internally to increase the safety new blocks are generated in parts - mini-blocks - 37 | which are executed and stored into the database. While the block generation time was increased to 15 minutes, every 38 | mini-block was still generated every 100ms. Overhead for storing pending block became pretty big, and the zkSync state 39 | keeper struggled to respond to the incoming requests. 40 | 41 | As a result of investigation, the mini-block generation time was increased as well, and also additional optimizations to 42 | the routine processing mini-blocks were added to prevent similar situations in the future. 43 | 44 | ## Lessons learned 45 | 46 | Being ready to work fast does not automatically mean that you are ready to work slow. 47 | 48 | Logging infrastructure is really important. Without proper logging, the investigation would have taken much longer, as 49 | the problem was pretty non-trivial. Problems can happen in the places where you expect them the least. Being always 50 | ready is our responsibility, and this situation was a lesson that better to be learned early. 51 | 52 | Finally, it worth mentioning that despite problems on the server side, all the users funds were completely safe! As 53 | funds are held by the smart contract, even if all the offchain infrastructure disappears, users will be able to get 54 | their money back. However, it is very important to pay attention to the finality status of your transactions! While all 55 | funds in zkRollup are always safe, only transactions marked with a green double-checkmark have full finality guarantees. 56 | The in-fly transactions (marked with a single yellow checkmark) are delivered on the best effort basis by the operator. 57 | They can still be reverted if our infrastructure fails, with the funds remaining in the last verified state (i.e. at the 58 | sender's account). 59 | -------------------------------------------------------------------------------- /docs/updates/2020-07-20-upgrade/README.md: -------------------------------------------------------------------------------- 1 | # zkSync contracts v2 upgrade announcement 2 | 3 | We will start the notice period to upgrade zkSync contracts to a new version today. 4 | 5 | ## Changes 6 | 7 | - Added event denoting information about pending and completed withdrawals. 8 | [bb0d1bd](https://github.com/matter-labs/zksync/commit/bb0d1bd) 9 | - Added support for tokens that aren't fully compatible with ERC20. 10 | [c088328](https://github.com/matter-labs/zksync/commit/c088328) 11 | - Block revert interval is changed to 0 hours. [c088328](https://github.com/matter-labs/zksync/commit/c088328) 12 | - Redundant priority request check is removed from contract upgrade logic. 13 | [c088328](https://github.com/matter-labs/zksync/commit/c088328) 14 | - `PRIORITY_EXPIRATION_PERIOD` is reduced to 3 days. [c12ab40](https://github.com/matter-labs/zksync/commit/c12ab40) 15 | - `UPGRADE_NOTICE_PERIOD` is increased to 8 days. [c12ab40](https://github.com/matter-labs/zksync/commit/c12ab40) 16 | 17 | ## Code diff 18 | 19 | The exact changes in the code of the contracts 20 | [can be found here](https://github.com/matter-labs/zksync/compare/contracts-1…contracts-2?file-filters[]=.sol#diff-99ba1fa7e498c046a900e03ec0ab8d18). 21 | -------------------------------------------------------------------------------- /docs/updates/2020-09-06-upgrade/README.md: -------------------------------------------------------------------------------- 1 | # zkSync contracts v3 upgrade announcement 2 | 3 | We will start the notice period to upgrade zkSync contracts to a new version today. 4 | 5 | ## Changes 6 | 7 | - Change pubkey operation requires fee for processing. 8 | - Added support for the forced exit operation which allows user to force a withdrawal from another account that does not 9 | have signing key set and is older than 24h. 10 | 11 | ## Code diff 12 | 13 | The exact changes in the code of the contracts 14 | [can be found here](https://github.com/matter-labs/zksync/compare/contracts-2…contracts-3?file-filters[]=.sol#diff-99ba1fa7e498c046a900e03ec0ab8d18). 15 | -------------------------------------------------------------------------------- /docs/updates/2020-12-16-upgrade/README.md: -------------------------------------------------------------------------------- 1 | # zkSync contracts v4 upgrade announcement 2 | 3 | We will start the notice period to upgrade zkSync contracts to a new version today. 4 | 5 | ## Changes 6 | 7 | - Timestamp is added to the block commitment. Rollup block timestamp validity is checked when block is committed 8 | onchain. 9 | - Offchain ChangePubKey can be performed for smart contract wallets that can be deployed with CREATE2 when pubkey hash 10 | is encoded in the CREATE2 salt parameter. 11 | - Governance contract can pause token deposits. 12 | - ChangePubKey message signature is changed. 13 | - Onchain operation processing changed on the contract. 14 | - Recursive block verifier added. 15 | - Onchain rollup block commitment changed, multiple blocks can be committed, verified at once. 16 | 17 | ## Code diff 18 | 19 | The exact changes in the code of the contracts 20 | [can be found here](https://github.com/matter-labs/zksync/compare/contracts-3...contracts-4?file-filters[]=.sol). 21 | -------------------------------------------------------------------------------- /docs/updates/2021-01-14-upgrade/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # zkSync contracts v4.1 upgrade announcement 6 | 7 | We will start the notice period to upgrade zkSync contracts to a new version today. 8 | 9 | ## Changes 10 | 11 | ### Added 12 | 13 | - Multiple blocks can be committed, proven or executed with one transaction. 14 | - Rollup block timestamp is added. 15 | - `ChangePubKey` can be authorized without L1 transaction for smart-contract accounts that can be deployed using CREATE2 16 | function with specific salt. 17 | - Block processing is split into three parts: commit, proving onchain, execution. Block is finalized when its executed. 18 | - Governance now can pause deposits of some tokens. 19 | - New events `Deposit(token, amount)`, `Withdrawal(token, amount)` are added when funds are deposited or removed from 20 | the contract. 21 | 22 | ### Changed 23 | 24 | - Cost of `Deposit` and `FullExit` for user is reduced significantly. 25 | - Priority queue storage format is changed for gas cost optimization. 26 | - Block storage format is changed for gas cost optimization. 27 | - `ChangePubKey` message that should be signed by ETH private key is changed. 28 | - Upgrade notice period is increased to 2 weeks. 29 | - `ChangePubKey` with L2 public key that was authorized onchain can be reset if needed after waiting period of 1 day. 30 | - Maximum gas limit for ETH and ERC20 token withdrawal from zkSync contract is set to be 100k. 31 | - Proof of the L2 funds in the exodus mode now can be provided by anyone on behalf of any user. 32 | - Withdrawal from zkSync contract (funds that are withdrawn from L2 but failed to be pushed out of the zkSync contract) 33 | now can be done on behalf of any user. 34 | - Some of the public variables are made internal. 35 | - Withdraw from the zkSync contract now should be performed using `withdrawPendingBalance` instead of (`withdrawETH`, 36 | `withdrawERC20`). 37 | - Multiple functions and variables are renamed: 38 | 1. `fullExit` -> `requestFullExit` 39 | 1. `exit` -> `performExodus` 40 | 1. `triggerExodusIfNeeded` -> `activateExodusMode` 41 | 1. `balanceToWithdraw` -> `pendingBalance` 42 | 43 | ### Removed 44 | 45 | - Pending withdrawal queue is removed, instead we try to execute token transfers when we finalize block. 46 | - All events for user operations (Deposit, Withdraw, etc.) are removed. 47 | 48 | ## Code diff 49 | 50 | The exact changes in the code of the contracts 51 | [can be found here](https://github.com/matter-labs/zksync/compare/contracts-3...contracts-4?file-filters[]=.sol). 52 | -------------------------------------------------------------------------------- /docs/updates/2021-01-22-upgrade/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # zkSync contracts v4.2 upgrade announcement 6 | 7 | We will start the notice period to upgrade zkSync contracts to a new version today. This is a small amendment of the 8 | v4.1 to enable backward-compatibility for all of the legacy API. 9 | 10 | ## Changes 11 | 12 | ### Added 13 | 14 | - Multiple blocks can be committed, proven or executed with one transaction. 15 | - Rollup block timestamp is added. 16 | - `ChangePubKey` can be authorized without L1 transaction for smart-contract accounts that can be deployed using CREATE2 17 | function with specific salt. 18 | - Block processing is split into three parts: commit, proving onchain, execution. Block is finalized when its executed. 19 | - Governance now can pause deposits of some tokens. 20 | - New events `Deposit(token, amount)`, `Withdrawal(token, amount)` are added when funds are deposited or removed from 21 | the contract. 22 | 23 | ### Changed 24 | 25 | - Cost of `Deposit` and `FullExit` for user is reduced significantly. 26 | - Priority queue storage format is changed for gas cost optimization. 27 | - Block storage format is changed for gas cost optimization. 28 | - `ChangePubKey` message that should be signed by ETH private key is changed. 29 | - Upgrade notice period is increased to 2 weeks. 30 | - `ChangePubKey` with L2 public key that was authorized onchain can be reset if needed after waiting period of 1 day. 31 | - Maximum gas limit for ETH and ERC20 token withdrawal from zkSync contract is set to be 100k. 32 | - Proof of the L2 funds in the exodus mode now can be provided by anyone on behalf of any user. 33 | - Withdrawal from zkSync contract (funds that are withdrawn from L2 but failed to be pushed out of the zkSync contract) 34 | now can be done on behalf of any user. 35 | - Some of the public variables are made internal. 36 | - Withdraw from the zkSync contract now should be performed using `withdrawPendingBalance` instead of (`withdrawETH`, 37 | `withdrawERC20`). 38 | - Multiple functions and variables are renamed: 39 | 1. `fullExit` -> `requestFullExit` 40 | 1. `exit` -> `performExodus` 41 | 1. `triggerExodusIfNeeded` -> `activateExodusMode` 42 | 1. `balanceToWithdraw` -> `pendingBalance` 43 | 44 | ### Removed 45 | 46 | - Pending withdrawal queue is removed, instead we try to execute token transfers when we finalize block. 47 | - All events for user operations (Deposit, Withdraw, etc.) are removed. 48 | 49 | ## Code diff 50 | 51 | The exact changes in the code of the contracts 52 | [can be found here](https://github.com/matter-labs/zksync/compare/contracts-3...contracts-4.2?file-filters[]=.sol). 53 | -------------------------------------------------------------------------------- /docs/updates/2021-01-25-upgrade/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # zkSync contracts v4.3 upgrade announcement 6 | 7 | We will start the notice period to upgrade zkSync contracts to a new version today. This is a small amendment of the 8 | v4.2 to enable backward-compatibility for all of the legacy API. 9 | 10 | ## Changes 11 | 12 | ### Added 13 | 14 | - Multiple blocks can be committed, proven or executed with one transaction. 15 | - Rollup block timestamp is added. 16 | - `ChangePubKey` can be authorized without L1 transaction for smart-contract accounts that can be deployed using CREATE2 17 | function with specific salt. 18 | - Block processing is split into three parts: commit, proving onchain, execution. Block is finalized when its executed. 19 | - Governance now can pause deposits of some tokens. 20 | - New events `Deposit(token, amount)`, `Withdrawal(token, amount)` are added when funds are deposited or removed from 21 | the contract. 22 | 23 | ### Changed 24 | 25 | - Cost of `Deposit` and `FullExit` for user is reduced significantly. 26 | - Priority queue storage format is changed for gas cost optimization. 27 | - Block storage format is changed for gas cost optimization. 28 | - `ChangePubKey` message that should be signed by ETH private key is changed. 29 | - Upgrade notice period is increased to 2 weeks. 30 | - `ChangePubKey` with L2 public key that was authorized onchain can be reset if needed after waiting period of 1 day. 31 | - Maximum gas limit for ETH and ERC20 token withdrawal from zkSync contract is set to be 100k. 32 | - Proof of the L2 funds in the exodus mode now can be provided by anyone on behalf of any user. 33 | - Withdrawal from zkSync contract (funds that are withdrawn from L2 but failed to be pushed out of the zkSync contract) 34 | now can be done on behalf of any user. 35 | - Some of the public variables are made internal. 36 | - Withdraw from the zkSync contract now should be performed using `withdrawPendingBalance` instead of (`withdrawETH`, 37 | `withdrawERC20`). 38 | - Multiple functions and variables are renamed: 39 | 1. `fullExit` -> `requestFullExit` 40 | 1. `exit` -> `performExodus` 41 | 1. `triggerExodusIfNeeded` -> `activateExodusMode` 42 | 1. `balanceToWithdraw` -> `pendingBalance` 43 | 44 | ### Removed 45 | 46 | - Pending withdrawal queue is removed, instead we try to execute token transfers when we finalize block. 47 | - All events for user operations (Deposit, Withdraw, etc.) are removed. 48 | 49 | ## Code diff 50 | 51 | The exact changes in the code of the contracts 52 | [can be found here](https://github.com/matter-labs/zksync/compare/contracts-3...contracts-4.3?file-filters[]=.sol). 53 | -------------------------------------------------------------------------------- /docs/updates/2021-02-26-upgrade/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # zkSync contracts v5 upgrade announcement 6 | 7 | 8 | 9 | This upgrade brings permissionless token listing to zkSync. 10 | 11 | ## Changes 12 | 13 | Code diff: 14 | [https://github.com/matter-labs/zksync/compare/contracts-4.3...contracts-5?file-filters%5B%5D=.sol#diff-e4f1b8266f4a874645b73c3ecf54a854159f7a24f84c3ec3c112f0855570e847R38](https://github.com/matter-labs/zksync/compare/contracts-4.3...contracts-5?file-filters%5B%5D=.sol#diff-e4f1b8266f4a874645b73c3ecf54a854159f7a24f84c3ec3c112f0855570e847R38) 15 | 16 | ### Added 17 | 18 | - `tokenGovernance` address is added to the `Governance` contract. `tokenGovernance` can list new tokens. 19 | - `TokenGovernance` contract is added to allow anybody to pay fee and list new tokens. 20 | 21 | ### Changed 22 | 23 | - Maximum amount of tokens that can be used to pay tx fee is increased to 512. 24 | - Circuit now enforces that `ForcedExit` target account pubkey hash is empty. 25 | - Various minor / stylistic fixes. 26 | -------------------------------------------------------------------------------- /docs/updates/2021-05-31-upgrade/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # zkSync contracts v5.1 upgrade announcement 6 | 7 | 8 | 9 | Please note, that the upgrade comes as an amendment of the [previous one](../2021-02-26-upgrade). And contains all the 10 | changes that it had, but brings a lot of new features as well. 11 | 12 | This upgrade brings native NFT and atomic swaps/limit orders support. This upgrade requires regenerating the root hash 13 | and so requires the most trust from our users, more on that can be read 14 | [here](https://medium.com/matter-labs/zksync-1-x-swaps-nfts-event-system-and-permissionless-token-listing-e126fcc04d61). 15 | 16 | ## Changes 17 | 18 | The exact changes in the code of the contracts 19 | [can be found here](https://github.com/matter-labs/zksync/compare/contracts-5…contracts-5.1?file-filters[]=.sol). 20 | 21 | ### Added 22 | 23 | - `MintNFT`, `WithdrawNFT` operations, which enable native NFT support. More on the NFT structure can be read 24 | [here](../../dev/nfts). 25 | - `Swap` operation, which depending on the implementation may serve either atomic swaps or limit orders functionality. 26 | You can read more [here](../../dev/swaps). 27 | - The security council, which is able to shorten the upgrade notice period. More on that 28 | [here](https://medium.com/matter-labs/keeping-funds-safe-a-3-factor-approach-to-security-in-zksync-2-0-a70b0f53f360). 29 | - `RegeneisMultisig.sol` to handle submissions of the new root hash by the security council during the upgrade. 30 | - A special account with id `2**24 - 1`. It is used to ensure the correctness of the NFT data. 31 | 32 | ### Changed 33 | 34 | - The maximum amount of tokens that can be used to pay transaction fees is increased to 1023. 35 | - The account tree depth for each account increased to `32`. 36 | - Due to the smart contract size limitations, `ZkSync.sol` was split into two parts: the original `ZkSync.sol` and the 37 | `AdditionalZkSync.sol`, to which some functionality is delegated. 38 | - `ZkSyncNFTFactory.sol` which serves as a default NFT factory, where all the NFTs are withdrawn by default. 39 | - Various minor / stylistic fixes. 40 | -------------------------------------------------------------------------------- /docs/updates/2021-06-02-upgrade/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # zkSync contracts v5.1 upgrade announcement 6 | 7 | 8 | 9 | Please note, that the upgrade comes as an amendment of the [previous one](../2021-02-26-upgrade). And contains all the 10 | changes that it had, but brings a lot of new features as well. 11 | 12 | This upgrade brings native NFT and atomic swaps/limit orders support. This upgrade requires regenerating the root hash 13 | and so requires the most trust from our users, more on that can be read 14 | [here](https://medium.com/matter-labs/zksync-1-x-swaps-nfts-event-system-and-permissionless-token-listing-e126fcc04d61). 15 | 16 | ## Changes 17 | 18 | The exact changes in the code of the contracts 19 | [can be found here](https://github.com/matter-labs/zksync/compare/contracts-5…contracts-5.1?file-filters[]=.sol). 20 | 21 | ### Added 22 | 23 | - `MintNFT`, `WithdrawNFT` operations, which enable native NFT support. More on the NFT structure can be read 24 | [here](../../dev/nfts). 25 | - `Swap` operation, which depending on the implementation may serve either atomic swaps or limit orders functionality. 26 | You can read more [here](../../dev/swaps). 27 | - The security council, which is able to shorten the upgrade notice period. More on that 28 | [here](https://medium.com/matter-labs/keeping-funds-safe-a-3-factor-approach-to-security-in-zksync-2-0-a70b0f53f360). 29 | - `RegeneisMultisig.sol` to handle submissions of the new root hash by the security council during the upgrade. 30 | - A special account with id `2**24 - 1`. It is used to ensure the correctness of the NFT data. 31 | 32 | ### Changed 33 | 34 | - The maximum amount of tokens that can be used to pay transaction fees is increased to 1023. 35 | - The account tree depth for each account increased to `32`. 36 | - Due to the smart contract size limitations, `ZkSync.sol` was split into two parts: the original `ZkSync.sol` and the 37 | `AdditionalZkSync.sol`, to which some functionality is delegated. 38 | - `ZkSyncNFTFactory.sol` which serves as a default NFT factory, where all the NFTs are withdrawn by default. 39 | - Various minor / stylistic fixes. 40 | -------------------------------------------------------------------------------- /docs/updates/2021-07-27-upgrade/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # zkSync contracts v5.2 upgrade announcement 6 | 7 | 8 | 9 | This upgrade includes features for the upcoming wallet integrations and some minor refactoring. 10 | 11 | ## Changes 12 | 13 | The exact changes in the code of the contracts 14 | [can be found here](https://github.com/matter-labs/zksync/compare/contracts-5.1...contracts-5.2?file-filters%5B%5D=.sol#diff-8bfb64c31730477b31e37f735b523beb50906f3732c054a633fac89d8be38c75) 15 | 16 | ### Added 17 | 18 | - Additional method for CREATE2 `ChangePubKey` authorization with extra custom data (wallet-specific). 19 | - Events for the pending withdrawals (in case a withdrawal fails over low gas limit). 20 | 21 | ### Changed 22 | 23 | - Code cleanup after the previous upgrade with regenesis. 24 | - Various minor / stylistic fixes. 25 | -------------------------------------------------------------------------------- /docs/updates/2021-08-12-upgrade/README.md: -------------------------------------------------------------------------------- 1 | # zkSync contracts v5.3 upgrade announcement 2 | 3 | 4 | 5 | This is a technical upgrade of the verification keys to increase the block aggregation capacity from 8 to 18. 6 | 7 | ## Changes 8 | 9 | This upgrade does not contain any changes in the code of the contracts. 10 | -------------------------------------------------------------------------------- /docs/updates/2021-11-12-upgrade/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # zkSync contracts v6 upgrade announcement 6 | 7 | 8 | 9 | This upgrade includes a change to the contract upgrade model. 10 | 11 | 12 | 13 | ## Changes 14 | 15 | ### Changed 16 | 17 | The new upgrade model: 9/15 security council members for an instant upgrade 18 | -------------------------------------------------------------------------------- /docs/updates/2022-02-28-upgrade/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # zkSync contracts v8 upgrade announcement 6 | 7 | 8 | 9 | We will start the notice period to upgrade zkSync contracts to a new version today. 10 | 11 | ## Changes 12 | 13 | The exact changes in the code of the contracts 14 | [can be found here](https://github.com/matter-labs/zksync/compare/contracts-7...contracts-8?file-filters[]=.sol). 15 | 16 | ### Added 17 | 18 | - `cutUpgradeNoticePeriodBySignature` a function for approving instant upgrade by security council members. 19 | - `Create2Factory.sol` - the smart contract that used to deploys targets. 20 | - New event `ApproveCutUpgradeNoticePeriod(address)` emitted after security council member approve upgrade. 21 | - Check that the deposited amount is non-zero. 22 | 23 | ### Changed 24 | 25 | - Upgrade can be initialized/finished in case of exodus mode. 26 | - `cutUpgradeNoticePeriod` takes the hash of targets to which upgrades initialized. 27 | - `WithdrawalPending` - event parameters changed. 28 | - `Withdraw`/`ForcedExit`/`FullExit` may be executed on `executeBlocks` or stored as pending depending on the input 29 | parameters when executing the block. 30 | - Minor gas optimizations are used. 31 | -------------------------------------------------------------------------------- /docs/updates/2022-08-19-upgrade/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # zkSync contracts v9 upgrade announcement 6 | 7 | 8 | 9 | We will start the notice period to upgrade zkSync contracts to a new version today. 10 | 11 | ## Changes 12 | 13 | The exact changes in the code of the contracts 14 | [can be found here](https://github.com/matter-labs/zksync/compare/contracts-8...contracts-9?file-filters[]=.sol). 15 | 16 | ### Added 17 | 18 | - `nonReentrant` modifier for all external functions as additional protection from reentrancy attack. 19 | - New method for EIP-712 `ChangePubKey` authorization. 20 | - A check for non-zero address when changing the governor. 21 | 22 | ### Changed 23 | 24 | - `WithdrawalPending` event parameters changed. 25 | - `Withdrawal` event parameters changed. 26 | - Use `calldata` instead of `memory` for gas cost optimization. 27 | - The visibility of the function `authFactsResetTimer` changed from internal to public. 28 | - `proveBlocks` ignores already proven blocks. 29 | 30 | ### Removed 31 | 32 | - Withdrawals are no longer finalized in the `executeBlocks` function 33 | -------------------------------------------------------------------------------- /docs/updates/security-audits/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: false 3 | --- 4 | 5 | # zkSync Security Audits 6 | 7 | ## 08.29.2022 8 | 9 | By: [ABDK Consulting](https://www.abdk.consulting/). Release Tag: 10 | [Contracts-9](https://github.com/matter-labs/zksync/releases/tag/contracts-9) 11 | 12 | - [Report](/ABDK_ZkSync_V9.pdf) 13 | 14 | ## 03.29.2022 15 | 16 | By: [ABDK Consulting](https://www.abdk.consulting/). Release Tag: 17 | [Contracts-8](https://github.com/matter-labs/zksync/releases/tag/contracts-8) 18 | 19 | - [Report v1](/ABDK_ZkSync_V8.pdf) 20 | 21 | ## 06.29.2021 22 | 23 | By: [ABDK Consulting](https://www.abdk.consulting/). Release Tag: 24 | [Contracts-5.1](https://github.com/matter-labs/zksync/releases/tag/contracts-5.1) 25 | 26 | - [Report v1](/ABDK-ZkSync-Audit-v5.pdf) 27 | 28 | ## 03.02.2021 29 | 30 | By: [ABDK Consulting](https://www.abdk.consulting/). Release Tag: 31 | [Contracts-4.3](https://github.com/matter-labs/zksync/releases/tag/contracts-4.3) 32 | 33 | - [Report v2, Part 1](/ABDK-ZKSync-Audit-v2-part1.pdf). 34 | - [Report v2, Part 2](/ABDK-ZKSync-Audit-v2-part2.pdf). 35 | 36 | ## 16.06.2020 37 | 38 | By: [ABDK Consulting](https://www.abdk.consulting/). Release Tag: 39 | [Contracts-1](https://github.com/matter-labs/zksync/releases/tag/contracts-1) 40 | 41 | - [Report v1](/zksync-1.0-audit.pdf). 42 | -------------------------------------------------------------------------------- /docs/uptime/README.md: -------------------------------------------------------------------------------- 1 | # Uptime 2 | 3 | ## Mainnet 4 | 5 | [https://uptime.com/s/zkSync](https://uptime.com/s/zkSync) 6 | -------------------------------------------------------------------------------- /docs/userdocs/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebarDepth: 3 3 | --- 4 | 5 | # Welcome to zkSync Lite 6 | 7 | **zkSync Lite** is a user-centric zk rollup platform from [Matter Labs](https://matter-labs.io). It is a scaling solution for 8 | Ethereum, already live on Ethereum mainnet. 9 | 10 | 11 | 12 | Some of the main features of zkSync are: 13 | 14 | - Extremely low transaction fees 15 | - Trustless protocol 16 | - Funds are cryptographically secure, as in the Ethereum mainnet 17 | - Users are always in control of their funds 18 | - No requirement for operational activity to keep the funds safe 19 | 20 | Get started by reading [the overview](./userdocs/). 21 | 22 | 23 | 24 | ### Important links 25 | 26 | Here is a list of important links to interact wth zkSync: 27 | 28 | - **Wallet** (check your balances, NFTs, transactions history and contacts). [https://lite.zksync.io](https://lite.zksync.io) 29 | - **Block Explorer** (Everything you need to explore all transactions and blocks on zkSync). [https://zkscan.io](https://zkscan.io) 30 | - **zkCheckout** (Our blazing fast & cost-efficient checkout solution). [https://checkout.zksync.io/](https://checkout.zksync.io/) 31 | 32 | ### For Developers 33 | 34 | If you are interested in developing with zkSync, view our [Developers Guide](/dev/) and [API Reference](/api). 35 | 36 | ### Interested in reading more? 37 | 38 | In-depth articles can be found on our [Medium page](https://medium.com/matter-labs). 39 | 40 | ### Contact 41 | 42 | If you have any questions or want to be part of our community, please check out our [contact page](https://zksync.io/contact). 43 | -------------------------------------------------------------------------------- /docs/userdocs/decentralization/README.md: -------------------------------------------------------------------------------- 1 | # Decentralization 2 | 3 | [[toc]] 4 | 5 | ## How decentralized is zkSync 6 | 7 | Technologically, decentralization is not a binary option but rather a continuum of design choices. The following rough 8 | scale can be used to asses a level of decentralization of a crypto project with regard to the ownership of assets: 9 | 10 | 1. Centralized custody (fully trusted): Coinbase 11 | 2. Collective custody (trust in the honest majority): sidechains 12 | 3. Non-custodial via fraud proofs (trust in the honest minority): optimistic rollups 13 | 4. Non-custodial, centrally operated (trustless): Argent 14 | 5. Multi-operator (trustless\*, weak censorship-resistance): Cosmos 15 | 6. Peer-to-peer (trustless\*, strong censorship-resistance): Ethereum, Bitcoin 16 | 17 | Right now, **zkSync** is at level 4 of this scale. It is fully non-custodial with zero trust assumptions: the **zkSync** 18 | validator has no power to do anything with user's assets without explicit authorization. Users can always withdraw all 19 | of their funds to Ethereum mainnet without any cooperation from validators (even if the latter is completely shut down 20 | and unresponsive). 21 | 22 | However, at the moment, the daily operation of the **zkSync** network depends on the health of the computational service 23 | provider who generates zero-knowledge proofs for the blocks. 24 | 25 | \* For L1 networks, trustlessness is only guaranteed by the ability (and to the extent 26 | of that ability) of honest minority users to fork away from the network taken over by dishonest majority. For L2 27 | protocols, this is not necessary, because users can ultimately rely on L1 to circumvent exit censorship. 28 | 29 | ## Who operates zkSync now 30 | 31 | Currently, the computational service provider for the **zkSync** network is "Stichting ZK Sync", a non-profit Dutch 32 | foundation registered under RSIN 861038204 in Kingsfordweg 151, 1043GR Amsterdam. The service operates close to 33 | break-even costs. 34 | 35 | ## Decentralization roadmap 36 | 37 | Matter Labs is committed to developing **zkSync** into a fully decentralized protocol. 38 | 39 | We outlined the decentralization roadmap in the 40 | [zkSync vision](https://medium.com/matter-labs/introducing-zk-sync-the-missing-link-to-mass-adoption-of-ethereum-14c9cea83f58) 41 | document. We intend to achieve it by introducing an independent consensus mechanism for block construction with two 42 | different roles: Validators and Guardians. (Note, that the security of **zkSync** will not be affected by introducing an 43 | additional consensus mechanism, since the final verification of state transition proofs still will be performed by a 44 | smart contract on the Ethereum mainnet.) 45 | -------------------------------------------------------------------------------- /docs/userdocs/faq/README.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | 3 | [[toc]] 4 | 5 | ## Why are the fees so high? 6 | 7 | Our fees depend on Ethereum Layer 1 (L1) gas prices because with every zkSync Layer 2 (L2) transaction, we post related 8 | data on Layer 1 — this allows us to inherit the security of Ethereum. 9 | 10 | ## How long are withdrawal times? 11 | 12 | At peak usage of zkSync, the withdrawal time is about 10 minutes. During lower use, it can take up to 7 hours. 13 | Currently, withdrawal times depend on the activity on zkSync, when we finalize blocks, and submit them to L1. 14 | 15 | ## I withdrew my funds but don't see them in my L1 account 16 | 17 | If your withdrawal is marked as "Complete" on [zkScan](https://zkscan.io/), but the funds have not arrived in your 18 | wallet, here are a few steps you should take: 19 | 20 | 1. Make sure that enough time has passed. A withdrawal takes 10 minutes to 7 hours, depending on the usage of the 21 | zkSync network. 22 | 23 | 2. Check for your transaction in "Internal Txns" on [Etherscan](https://etherscan.io/). 24 | 25 | 1. Open Etherscan and go to your address page. 26 | 2. Go to "Internal Txns." 27 | 3. You’ll find a list of all transactions from smart contracts. 28 | 4. The list should have your transaction coming from the zkSync smart contract. 29 | 30 |
31 | 32 | ![Internal Txns Etherescan](/int-txns.png) 33 | 34 |
35 |
36 | 37 | 3. If the account balance is not the same as on Etherscan, contact support for your wallet. 38 | 39 | 4. Depending on your wallet, you may have to add that token for it to display. 40 | 41 | 5. If none of the steps above have helped you, please email us at withdraw@zksync.io describing your problem. It 42 | **MUST** contain the following info: 43 | 44 | 1. Your zkSync wallet address. 45 | 2. The wallet are you using (e.g., Trust). 46 | 3. The problem(s) you encountered. 47 | 48 | - The more information you provide, the faster we can solve your problem! 49 | 50 | ## I used "Transfer" instead of "Withdraw" to get my funds onto L1 51 | 52 | If you attempted to withdraw your zkSync funds to L1 but used the "Transfer" option instead of "Withdraw," you should 53 | try logging in to zkSync with the wallet that received the funds. 54 | 55 | If you cannot log in to the zkSync wallet, you can use the "Alternative Withdrawal" tool. See the 56 | [Alternative Withdrawal](../tutorials/#alternative-withdrawal) section on our [Tutorials](../tutorials) page. 57 | 58 | ## What is the account activation fee? 59 | 60 | The account activation fee is a one-time fee to register your account with zkSync. This fee only applies to your first 61 | zkSync transaction. 62 | 63 | On a deeper level, to be better suited for zero-knowledge proofs, zkSync accounts are defined over a different elliptic 64 | curve than Ethereum's. Activating your account generates and publishes a new private-public key pair over this curve 65 | associated with your Ethereum address. 66 | 67 | The registration process happens directly on the Ethereum smart contract and therefore it is an L1 transaction, so the 68 | activation fee is to pay the Ethereum miners and not zkSync validators. 69 | 70 | ERC-1271 compatible wallets (like Argent) increase this one-time fee because of higher interaction with the zkSync smart 71 | contract. This operation is cheaper if you are using a CREATE2 smart-contract-based wallet. 72 | 73 | ## What is the difference between an Initiated, Committed, and Verified transaction on zkScan? 74 | 75 | **Initiated**: the zkSync server has received and processed the transaction. If the transaction is a transfer, it is 76 | ready for immediate use. 77 | 78 | **Committed**: the transaction appears in a block that is _committed_ to the L1 smart contract. 79 | 80 | **Verified**: the transaction’s block has been proven and verified on the L1 smart contract. 81 | -------------------------------------------------------------------------------- /docs/userdocs/intro/README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | [[toc]] 4 | 5 | ## Introduction 6 | 7 | **zkSync** is a trustless protocol for scalable low-cost payments on Ethereum, powered by 8 | [zkRollup technology](/userdocs/tech/#zk-rollup-architecture). It uses zero-knowledge proofs and on-chain data 9 | availability to keep users' funds as safe as though they never left the mainnet. 10 | 11 | While security is our paramount priority, user and developer experience are central to zkSync design. We obsessively 12 | seek out improvements that eliminate friction and complexity in order to make zkSync the most enjoyable platform on 13 | Ethereum, for both end-users and builders. The best way to get an impression about it is to 14 | [try out zkSync](https://lite.zksync.io) yourself — it should only take 2 minutes. 15 | 16 | 17 | 18 | 19 | 20 | ## Problems zkSync solves 21 | 22 | Gas fees on Ethereum [exceed \$40M per month](https://ethgasstation.info/). With zkSync these costs can be reduced to a 23 | small fraction. 24 | 25 | UX-first crypto wallets like [Argent](https://www.argent.xyz/) or [Dharma](https://www.dharma.io/) aim to provide a 26 | banking alternative to entire societies. zkSync makes this mission accomplishable. 27 | 28 | The rise of DeFi opens many more interesting use cases. zkSync is here to unlock Paypal-scale for your project. 29 | 30 | ## zkSync features 31 | 32 | - Mainnet-level security with zero reliance on 3rd parties 33 | - ETH and ERC20 token transfers with instant confirmations and 10-minute finality on L1\*; see 34 | [supported tokens](/userdocs/tokens/#supported-tokens) 35 | - Ultra-low transaction fees (~1/100th of mainnet costs for ERC20 tokens and ~1/30th for ETH transfers) 36 | - No registration is required to receive funds 37 | - Payments to existing Ethereum addresses (including smart-contracts) 38 | - Fees conveniently payable in the token being transferred 39 | - Withdrawals to mainnet in ~10 minutes\* 40 | - [Multisig](https://tlu.tarilabs.com/cryptography/musig-schnorr-sig-scheme/The_MuSig_Schnorr_Signature_Scheme.html) 41 | support 42 | - Permissionless [smart contracts](/userdocs/sc) (coming soon) 43 | 44 | \* Currently, it may take longer to fill a block with transactions. Once the block is 45 | 'sealed', it is sent to the prover and appears on L1 within 10 minutes. 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | ## zkSync in comparison 54 | 55 | zkSync 56 | [stands out remarkably](https://medium.com/matter-labs/evaluating-ethereum-l2-scaling-solutions-a-comparison-framework-b6b2f410f955) 57 | in security and usability among existing L2 scaling solutions. Thanks to the combination of cutting-edge cryptography 58 | and on-chain data availability, zkRollup (the core technology of zkSync) is **the only** L2 scaling solution that 59 | doesn't require any operational activity to keep the funds safe. For example, users can go offline for a year, then come 60 | back and be sure to safely withdraw their assets without any external help — even if zkRollup validators were long gone. 61 | At our current stage of development, we encourage users to monitor the chain for upgrades, and withdraw if they disagree 62 | with upcoming changes — in the future, upgrades will require a strict opt-in. 63 | 64 | To quote from [Vitalik Buterin's 2021 guide to rollups](https://vitalik.ca/general/2021/01/05/rollup.html): 65 | 66 | > In general, my own view is that in the short term, optimistic rollups are likely to win out for general-purpose EVM 67 | > computation and ZK rollups are likely to win out for simple payments, exchange and other application-specific use 68 | > cases, **but in the medium to long term ZK rollups will win out in all use cases as ZK-SNARK technology improves**. 69 | 70 | ![L2 comparison](/chart4.png) 71 | -------------------------------------------------------------------------------- /docs/userdocs/learnbywatching/README.md: -------------------------------------------------------------------------------- 1 | # Learn by Watching 2 | 3 | Click on the links below for a playlist of curated videos on each topic. 4 | 5 | - [zkRollups](https://www.youtube.com/watch?v=hcLoSQmvhfY&list=PL-Bw34ynlUONLcuwOdaG7A06YQrGEns4s) 6 | - [zkSync Lite](https://www.youtube.com/watch?v=el-9YYGN1nw&list=PL-Bw34ynlUONlnXdkm608shHry8hrYlex) 7 | - [zkSync Era](https://www.youtube.com/watch?v=el-9YYGN1nw&list=PL-Bw34ynlUOP3r0zFeM48JnNZyun2E6Bt) 8 | - [zkPorter](https://www.youtube.com/watch?v=zknVgruhjnU&list=PL-Bw34ynlUOPdA6YsTOc_8xCa_DG45tF6) 9 | -------------------------------------------------------------------------------- /docs/userdocs/privacy/README.md: -------------------------------------------------------------------------------- 1 | # Privacy 2 | 3 | At the moment, all transactions in **zkSync** are transparent: just like in Ethereum, anybody can see the sender, the 4 | recipient and all the details of the transaction. 5 | 6 | However, we take the privacy cause very seriously. Most people won’t feel comfortable moving large parts of their 7 | fortune into a publicly exposed glass box. Inhabitants of dangerous places are unlikely to pay a local merchant in 8 | crypto if the recipient can immediately learn how much money they have. Privacy is an absolute prerequisite for mass 9 | adoption and an important part of **zkSync** roadmap. 10 | 11 | Implementing privacy comes with two big challenges: 12 | 13 | - It must be on by default as an integral protocol feature. To quote Vitalik Buterin: “If your privacy model has a 14 | medium anonymity set, it really has a small anonymity set. If your privacy model has a small anonymity set, it has an 15 | anonymity set of 1. Only global anonymity sets are truly robustly secure.” 16 | - To enable privacy by default, private transaction costs must be very low, despite significant added computational 17 | overhead. 18 | 19 | This is why we decided to focus our efforts on the scalability of **zkSync** first. Once the prover technology is good 20 | enough to add privacy without much cost and scalability overhead, it will be added to the platform. 21 | -------------------------------------------------------------------------------- /docs/userdocs/sc/README.md: -------------------------------------------------------------------------------- 1 | # Smart contracts 2 | 3 | ZKsync Era now provides highly-efficient, secure, Turing-complete, multi-language smart contract functionality. 4 | 5 | Find out more in the [ZKsync Era developer docs](https://docs.zksync.io). 6 | -------------------------------------------------------------------------------- /docs/userdocs/status/README.md: -------------------------------------------------------------------------------- 1 | # Status page 2 | 3 | In order to clearly indicate to users that everything is working fine or that there are problems with a particular 4 | subsystem, we use status page. 5 | 6 | In total, 4 systems are checked for each of the networks (Mainnet, Goerli): 7 | 8 | - Explorer 9 | - REST API 10 | - JSON RPC API 11 | - Wallet 12 | 13 | We use [uptime](https://uptime.com/s/zkSync) for status page and checking requests for each service. 14 | -------------------------------------------------------------------------------- /docs/userdocs/tokens/README.md: -------------------------------------------------------------------------------- 1 | # Tokens & Fees 2 | 3 | [[toc]] 4 | 5 | ## Supported tokens 6 | 7 | **zkSync** can be used to transfer ether (ETH) and ERC20 tokens. The full list of currently supported tokens is 8 | available under this [link](https://zkscan.io/explorer/tokens). 9 | 10 | DISCLAIMER: Listing of a token on zkSync does not represent an endorsement for this token by the Matter Labs team, 11 | Stichting ZK Sync, or any other entity. We do not have competence and authority to analyze the token business model and 12 | smart contract security guarantees of a particular token. Please use any token on your own risk and judgement. 13 | 14 | ## Listing a token 15 | 16 | To list a new token on zkSync, go the [tokens page](https://zkscan.io/explorer/tokens/) of the explorer and click the 17 | "Add New Token" button and follow the instructions. 18 | 19 | ## Fee costs 20 | 21 | In **zkSync** the cost of every transaction has two components: 22 | 23 | - **Off-chain part (storage + prover costs)**: the cost of the state storage and the SNARK (zero-knowledge proof) 24 | generation. This part depends on the use of hardware resources and is therefore invariable. Our benchmarks give 25 | estimates of ~0.001 USD per transfer. 26 | - **On-chain part (gas costs)**: for every **zkSync** block, the validator must pay Ethereum gas to verify the SNARK, 27 | plus additionally ~0.4k gas per transaction to publish the state ∆. The on-chain part is a variable that depends on 28 | the current gas price in the Ethereum network. However, this part is orders of magnitude cheaper than the cost of 29 | normal ETH/ERC20 transfers. 30 | 31 | ## How fees are paid 32 | 33 | Transfers in **zkSync** support "gasless meta-transactions": users pay transaction fees in the tokens being transferred. 34 | Thus, for example, if you want to transfer DAI stable-coin, there is no need for you to own ETH or any other tokens. 35 | Just pay your fees in a fraction of DAI. 36 | 37 | Tokens listed on Uniswap with 45 ETH of liquidity and a token price on CoinGecko can be used to pay for fees. For tokens 38 | without a liquid market price, fees are paid in a different token. 39 | -------------------------------------------------------------------------------- /docs/userdocs/wallets/README.md: -------------------------------------------------------------------------------- 1 | # Wallets 2 | 3 | [[toc]] 4 | 5 | ## What Ethereum wallets does zkSync support? 6 | 7 | Generally, you can safely send funds to any Ethereum address (even to exchanges and smart contracts). The owner of this 8 | address will always be able to claim the funds. 9 | 10 | The up-to-date list of the Ethereum wallets that you can control from the zkSync web wallet can be found directly on 11 | [its homepage](https://lite.zksync.io). 12 | 13 | To control an address programmatically, all you need to is to be able to sign a message with it — either with native 14 | Ethereum signature, or via [EIP1271](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1271.md) in case of smart 15 | contracts. Learn more in the [developer guide](/dev/). 16 | 17 | ## What if my wallet is not supported or can't sign messages? 18 | 19 | Owners of some Ethereum addresses cannot use zkSync directly for various reasons: 20 | 21 | - wallet not supported yet in the web interface; 22 | - an address belongs to an exchange; 23 | - an address belongs to a smart contract without 24 | [EIP1271](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1271.md) support. 25 | 26 | In such cases, you can always withdraw funds from an L2 zkSync account to the same address in L1. The protocol allows 27 | this because the security invariant is not violated: funds never change the owning hand. It requires that the account 28 | have never registered a zkSync public key before. 29 | 30 | If you need to withdraw your funds from such an account, please use the following 31 | [tool for alternative withdrawals](../tutorials/#alternative-withdrawal). Please note, that for the tool to be able to 32 | withdraw funds from your account, all of the following must be true: 33 | 34 | - The account is at least 24 hours old. 35 | - The account has never been unlocked (i.e. nonce is zero). 36 | -------------------------------------------------------------------------------- /drafts/change_pubkey_batch.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### Sending `ChangePubKey` operation in batch 4 | 5 | `ChangePubKey` operation has Ethereum signature as a mandatory field of transaction, and in only can be omitted if 6 | operation was approved on-chain via a separate transaction. 7 | 8 | Thus, if `ChangePubKey` is a part of the batch, it may have the same Ethereum signature as the batch signature. The 9 | logic may be expressed as follows: 10 | 11 | ```js 12 | const changePubKeyMessage = getChangePubKeyMessage(changePubKeyTx); 13 | const batchMessage = getBatchMessage(transactions); 14 | const bytes = concat([changePubKeyMessage, batchMessage]); 15 | const hash = ethers.utils.keccak256(bytes).slice(2); 16 | const message = Uint8Array.from(Buffer.from(hash, 'hex')); 17 | ``` 18 | 19 | This obtained message should be used as both batch Ethereum signature and ChangePubKey Ethereum signature. 20 | 21 | **Note:** There must not be more than one `ChangePubKey` transaction in the batch. 22 | -------------------------------------------------------------------------------- /drafts/decent.md: -------------------------------------------------------------------------------- 1 | First, to [quote](https://twitter.com/VitalikButerin/status/1247607628668309507) Vitalik Buterin: 2 | 3 | > People who say "full decentralization is overkill, you only need non-custodial" are missing the point. A fully decentralized (or "serverless") application is valuable because it gives users the confidence that *it will always be there*, so you can safely build on top of it. 4 | 5 | Second, another critical property of a fully decentralized protocol is censorship-resistance. Users should have confidence that their normal transactions will be included in the next block. 6 | 7 | ... 8 | 9 | **Validators** are responsible for packing transactions into blocks and generating zero-knowledge proofs for them. They participate in the consensus and must, therefore, contribute a share of the security bond for instant tx receipts. Their nodes must run in a secure environment with good internet bandwidth. Alternatively, they may choose to generate ZK proofs in the unsecured on-demand cloud. 10 | 11 | Validators are rewarded with transaction fees, which can be paid in any token being transacted (for the maximum convenience of end-users). 12 | In order to keep the **zkSync** consensus fast, only a limited number of validators are allowed at any moment (between 30 and 100, subject to profiling). Recall, however, that ZK Rollup validators are completely trustless. In **zkSync**, malicious validators can neither jeopardize the security of the system nor trick honest validators into slashing conditions. Therefore, unlike in optimistic rollups, a small set of validators can be frequently rotated by the Guardians. At the same time, the liveness of the consensus is guaranteed as long as more than ⅔ of the nominated validators are honest and operational. 13 | 14 | **Guardians** will comprise the majority of **zkSync** token holders who stake their token share to nominate validators. The purpose of Guardians is to monitor peer-to-peer transaction traffic, detect censorship behavior, and ensure validators caught censoring are not nominated. The motivation of Guardians is to protect the value of their stake by making sure that **zkSync** remains DoS- and censorship-resistant. 15 | 16 | Despite keeping the voting keys online, Guardians in **zkSync** are never exposed to risk of slashing or theft (the ownership keys can be kept in cold storage). They may also choose to monitor only a fraction of the traffic. Thus, their nodes can be run on ordinary laptops or cloud servers, i.e. there is no need for specialized validator services. 17 | 18 | Guardians are rewarded with fees from the Validators denominated in the **zkSync** native token. Their earnings and stakes are locked for a prolonged period of time, to incentivize the prioritization of long-term **zkSync** token value over short-term returns. 19 | -------------------------------------------------------------------------------- /drafts/functionality.md: -------------------------------------------------------------------------------- 1 | # Functionality 2 | 3 | [[toc]] 4 | 5 | ## zkRollup in a nutshell 6 | 7 | **zkRollup** is a trustless blockchain scaling technology driven by the power of succinct 8 | [zero-knowledge proofs](https://github.com/matter-labs/awesome-zero-knowledge-proofs). A few properties make it unique. 9 | 10 | **The security guarantees of zkRollup** are practically as strong as if the funds were placed directly on the mainnet. 11 | In contrast to solutions with off-chain data availability (such as 12 | [validium](https://twitter.com/the_matter_labs/status/1267460624210186241)), zkRollup operators are completely 13 | trustless; the protocol makes it impossible for them to either steal or freeze user's assets. What's important, this is 14 | achieved by pure cryptography, without any game-theoretic constructions. zkRollup eliminates the need for fraud-proofs, 15 | active monitoring by the user or watch-towers, exit games, and other complex interactive mechanisms with significant 16 | operational risks. 17 | 18 | It must be added that zkRollup is built on cutting-edge cryptography and thus can not be called 100% risk-free. At the 19 | same time, the security of the cryptographic primitives used in zkSync has been subject to rigorous review by the 20 | academic and professional cryptographer community. You can learn more about it in the 21 | [corresponding section](/userdocs/security) of this FAQ. 22 | 23 | **The user experience** is in almost every aspect as good or better than that of the mainnet. zkRollup supports 24 | convenient account model like Ethereum (accounts in zkSync even share addresses with the user's Ethereum accounts). 25 | Transaction fees can be paid in any token. And withdrawals to the mainnet are completed in under 10 minutes! This is in 26 | stark contrast to Plasma and optimistic rollups, where users must deal with a staggering exit delay of ~1 week. 27 | 28 | Although the time to hard finality is increased to ~10 min compared to L1, transactions in zkSync are instantly 29 | confirmed with partial (economic) finality. This makes the platform a lot more convenient in practice. 30 | 31 | ## Multisig 32 | 33 | zkSync is cold-wallet friendly. Multisig is also possible with 34 | [muSig Schnorr signature scheme](https://tlu.tarilabs.com/cryptography/musig-schnorr-sig-scheme/The_MuSig_Schnorr_Signature_Scheme.html). 35 | 36 | ## What can zkSync be used for 37 | 38 | - Affordable, scalable, secure, non-custodial ETH and ERC20 token transfers (for now) 39 | - Later: smart contracts (link to question) 40 | 41 | also explain: 42 | 43 | - users can use zkSync UI (link to section) 44 | - alternatively, as a project developer you can build your own wallet using zksync.js -- check out developer guide 45 | (link) 46 | 47 | ## Supported tokens 48 | 49 | For transfers: 50 | 51 | - Native Ether (ETH) 52 | - Plus 30 popular tokens added at launch: list 53 | - Any other token can be added in coordination with Matter Labs -- talk to us (eventually it will be permissionless, but 54 | in the beginning we want to curate the list) 55 | 56 | ## Transaction fees 57 | 58 | - Users pay in the same token as being transferred. 59 | - we are going to operate at break-even cost, later move to marketplace by permissionless validators 60 | - explain how the price the formed: 61 | - variable: 62 | - ETH onchain (gas) part: ~0.3k gas for every transfer (to compare: basic ETH transfer is 21k gas, average ERC20 63 | transfer is 60k-80k gas) 64 | - Technical note: `full_cost = (block_proof_cost + gas_per_tx * N_tx) / N_tx`; 65 | - block_proof_cost ~ 300k gas 66 | - N_tx in block ~1000 - 15000 67 | - as operators, we will charge as though blocks are full 68 | - fixes (driven by physical costs): 69 | - ZKP generation part: ~{placeholder, add when benches complete} 70 | - storage part: ~1/1000 - 1/100 of the ETH storage cost (and, in contrast to ETH, it won't go up with increase gas 71 | costs) 72 | -------------------------------------------------------------------------------- /drafts/functionality2.md: -------------------------------------------------------------------------------- 1 | # Functionality 2 | 3 | [[toc]] 4 | 5 | ## The end-user experience 6 | 7 | Try it out! 8 | 9 | - Address 10 | - Gasless transactions 11 | - Getting money, sending: links to the User guide section 12 | - Non-custodial 13 | - Permissionless: no KYC! 14 | 15 | (record video) 16 | 17 | ## Are transactions private 18 | 19 | - Not now, later. Privacy is important to us! But we want to make it properly without creating false sense of security. network anonymity, etc. 20 | - example: (ppl thought that MW was hiding tx graph, but it wasn't...) 21 | 22 | ## Are contracts supported 23 | 24 | - Not now, later 25 | - Working on zinc: 26 | - docs: 27 | - Explain mental model: same as Ethereum 28 | - Talk to us! 29 | -------------------------------------------------------------------------------- /drafts/intro2.md: -------------------------------------------------------------------------------- 1 | # zkSync in a nutshell 2 | 3 | [[toc]] 4 | 5 | ## What is zkSync 6 | 7 | (for general audience) 8 | 9 | zkSync is a scaling and privacy engine for Ethereum... take ideas from zkSync intro articles. 10 | 11 | Highlights: 12 | 13 | - Non-custodial: you are in control at all times 14 | - Trustless (nobody can steal money) 15 | - Scalable: up to 3,000 TPS, immune to network congestions 16 | - Cheap: a fraction of cent per tx even in peak times 17 | 18 | ## How does it work 19 | 20 | (for general audience) 21 | 22 | high-level tech description 23 | 24 | - explain Rollup 25 | - explain zkRollup 26 | - explain where the money is stored 27 | - links to videos (or embed) 28 | 29 | ## Compare to 30 | 31 | 32 | 33 | ## zkSync vs. Sidechains 34 | 35 | - explain sidechain 36 | - explain trust assumptions 37 | 38 | ## zkSync vs. Plasma 39 | 40 | - explain data availability 41 | 42 | link to (borrow ideas) 43 | 44 | ## zkSync vs. Payment Channels 45 | 46 | - briefly explains lightning/payment channels 47 | - explain capital efficiency 48 | - explain max capacity and channel reopenings on chain 49 | - liveness required: 50 | - explain security problems (payment channels require operators to keep keys online, can be hacked and all funds stolen) 51 | 52 | ## zkSync vs. Optimistic Rollup 53 | 54 | - link to 55 | -------------------------------------------------------------------------------- /drafts/tech/README.md: -------------------------------------------------------------------------------- 1 | # Technology 2 | 3 | ## Zero-knowledge proofs 4 | 5 | ## zkRollup 6 | 7 | ## PLONK 8 | 9 | ## RedShift 10 | 11 | ## What risks are involved 12 | 13 | No software can be guaranteed to be 100% error-free. Blockchain is still an experimental technology with rapidly evolving attack vectors. While Matter Labs is undertaking maximum possible efforts to protect your funds (including security audit and following established security practices), it is our duty to inform the users of zkSync of the potential risks of using any new crypto technology: 14 | 15 | - There can be a bug in the smart contracts. 16 | - There can be a bug in zero-knowledge circuits. 17 | - Trusted setup could be compromised. 18 | - New theoretical and breaches in the cryptography applied can be discovered. 19 | - Finally, your wallet can be hacked. 20 | 21 | We encourage you take your security seriously, but also account for potential failures. Use zkSync at your own risk and do not put more money into it than you can afford to lose. 22 | -------------------------------------------------------------------------------- /drafts/tech/plonk.md: -------------------------------------------------------------------------------- 1 | # PLONK 2 | -------------------------------------------------------------------------------- /drafts/tech/redshift.md: -------------------------------------------------------------------------------- 1 | # RedShift 2 | -------------------------------------------------------------------------------- /drafts/tech/zkp.md: -------------------------------------------------------------------------------- 1 | # Zero-knowledge proofs 2 | -------------------------------------------------------------------------------- /drafts/tech/zkrollup.md: -------------------------------------------------------------------------------- 1 | # zkRollup 2 | -------------------------------------------------------------------------------- /drafts/user/README.md: -------------------------------------------------------------------------------- 1 | # User guide 2 | 3 | (to discuss after you have tried goerli yourself) 4 | 5 | ## Getting started with zkSync UI 6 | 7 | - zksync Lite [Block Explorer](https://zkscan.io/) 8 | - non-custodial, web-based UI to interact with zkSync 9 | - it doesn't store your private keys -- they are ephemerially recreated from a signature from your Ethereum wallet 10 | 11 | ## What wallets are supported 12 | 13 | - metamask (+ledger etc.) 14 | - wallet connect: list... 15 | - fortmatic, ports, etc. 16 | - we support both keypair- and smart-contract-based account (e.g. Argent) 17 | 18 | ## What is my zkSync address 19 | 20 | Same as Ethereum address. 21 | 22 | ## How do I get tokens into zkSync 23 | 24 | Two ways: 25 | 26 | - either ask someone to money to your ethereum address 27 | - or deposit from your wallet: link to client 28 | 29 | ## How do I make a transfer 30 | 31 | - explain, link 32 | - you'll need to sign a message -- explain why, link to security section 33 | 34 | ## Who can I send tokens to 35 | 36 | Anybody with an Ethereum account -- see the list of supported wallets. They will be able to immediately send funds inside zkSync or just withdraw tokens to mainnet. 37 | 38 | ## Do I need to own ETH to pay gas 39 | 40 | No, you pay in the tokens being transferred. 41 | 42 | ## How do I withdraw from zkSync 43 | 44 | - explain, link 45 | 46 | ## Is there a block explorer 47 | 48 | - https://zkscan.io/ 49 | 50 | ## I have a different question 51 | 52 | Talk to us! Contact: ... (intercom?) 53 | -------------------------------------------------------------------------------- /drafts/why.md: -------------------------------------------------------------------------------- 1 | # Why should I care about scalability with Zero-knowledge proofs 2 | 3 | The success of your project is contingent on growth. 4 | 5 | Bluntly put, there are only two approaches to scaling your crypto project. 6 | 7 | 1. Introduce trust assumptions. 8 | 9 | 2. Rely on cryptography. 10 | 11 | This is important. Very important. 12 | 13 | links: 14 | 15 | - validity proofs 16 | - zk vs optimistic rollup 17 | 18 | ## move to README: If all you got is 3 minutes 19 | 20 | Read this: [Why should I care about scaling with Zero-Knowledge Proofs?](/userdocs/why/) 21 | 22 | The most valuable piece on this website. 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "zksync-lite-docs", 3 | "description": "zkSync Lite documentation", 4 | "private": true, 5 | "version": "2.8.0", 6 | "license": "MIT", 7 | "author": "Matter Labs", 8 | "homepage": "https://docs.lite.zksync.io/", 9 | "keywords": [ 10 | "zk-rollup", 11 | "web3", 12 | "wallet", 13 | "defi", 14 | "cryptopayments", 15 | "zksync dapps", 16 | "dapp", 17 | "ethers", 18 | "zkSync", 19 | "Matter Labs", 20 | "rollup", 21 | "ZK rollup", 22 | "zero confirmation", 23 | "ZKP", 24 | "zero-knowledge proofs", 25 | "Ethereum", 26 | "crypto", 27 | "blockchain", 28 | "permissionless", 29 | "L2", 30 | "secure payments", 31 | "scalable crypto payments" 32 | ], 33 | "browserslist": { 34 | "production": [ 35 | ">0.2%", 36 | "not dead", 37 | "not op_mini all" 38 | ], 39 | "development": [ 40 | "last 1 chrome version", 41 | "last 1 firefox version", 42 | "last 1 safari version" 43 | ] 44 | }, 45 | "scripts": { 46 | "docs:dev": "NODE_OPTIONS=--openssl-legacy-provider vuepress dev docs", 47 | "docs:build": "NODE_OPTIONS=--openssl-legacy-provider vuepress build docs", 48 | "docs:deploy": "NODE_OPTIONS=--openssl-legacy-provider yarn docs:build && firebase deploy", 49 | "cspell": "cspell lint --no-summary --fail-fast --no-progress --no-must-find-files -c cspell.json docs/**/*.md ", 50 | "md:lint": "markdownlint --config .markdownlintrc ./docs/**/*.md", 51 | "md:fix": "markdownlint --fix -c .markdownlintrc ./docs/**/*.md", 52 | "ci:lint": "yarn cspell && yarn md:lint", 53 | "semantic-release": "semantic-release", 54 | "postinstall": "husky install" 55 | }, 56 | "bugs": { 57 | "url": "https://github.com/matter-labs/zksync-lite-docs/issues" 58 | }, 59 | "dependencies": { 60 | "markdown-it-footnote": "^3.0.3", 61 | "vuepress-plugin-canonical": "^1.0.0", 62 | "vuepress-plugin-fulltext-search": "^2.2.1", 63 | "vuepress-plugin-sitemap": "^2.3.1" 64 | }, 65 | "devDependencies": { 66 | "@commitlint/cli": "^16.2.1", 67 | "@commitlint/config-conventional": "^16.2.1", 68 | "@mr-hope/vuepress-plugin-seo": "^1.28.5", 69 | "@semantic-release/changelog": "^6.0.1", 70 | "cspell": "^5.18.5", 71 | "husky": "^7.0.4", 72 | "lint-staged": "^12.3.4", 73 | "markdownlint": "^0.25.1", 74 | "markdownlint-cli": "^0.31.1", 75 | "semantic-release": "^19.0.2", 76 | "vuepress": "^1.9.7" 77 | }, 78 | "lint-staged": { 79 | "**/*.md": [ 80 | "markdownlint --fix", 81 | "cspell lint --config cspell.json" 82 | ] 83 | }, 84 | "optionalDependencies": { 85 | "fs-extra": "^10.0.1" 86 | }, 87 | "resolutions": { 88 | "highlight.js": "10" 89 | }, 90 | "packageManager": "yarn@3.2.0" 91 | } 92 | --------------------------------------------------------------------------------