Skip to content

Commit

Permalink
add structure for Astar Beta Labs; zkEVM integrators (#460)
Browse files Browse the repository at this point in the history
* create Astar Beta Labs section; expand zkEVM section

* Delete pyth-oracle.md

* spelling and grammar

---------

Co-authored-by: Gregory Luneau <[email protected]>
  • Loading branch information
meganskye and gluneau authored Oct 10, 2023
1 parent b1539eb commit dcb5ca8
Show file tree
Hide file tree
Showing 20 changed files with 345 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/build/Introduction/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Introduction
![General understanding of programming basics](/docs/build/img/introduction.png)
To make use of this documentation effectively, you should possess a general understanding of programming basics. The programming languages used throughout are mainly Rust, Solidity, and JavaScript, for which previous knowledge is not necessary, but would be highly beneficial. In conjunction with improving your understanding of the material contained within these guides, we recommend additionally that you review supplemental material covering these languages, in order to improve your overall understanding of the topics, and practical code examples provided.
To make use of this documentation effectively, you should possess a general understanding of programming basics. The programming languages used throughout are mainly Rust, Solidity, and JavaScript, for which previous knowledge is not necessary, but would be highly beneficial. In conjunction with improving your understanding of the material contained within these guides, we recommend that you review supplemental material covering these languages, in order to improve your overall understanding of the topics and the practical code examples provided.

### Do I need blockchain knowledge to follow this documentation?
Your blockchain knowledge will be useful but if you are reading this that means you are on the right track.

### I'm a Polkadot builder, do I need this?
If you are already a builder on Polkadot/Kusama ecosystem you can most likely skip Introduction chapter. But it is recommended that you read about available Networks.
If you are already a builder on Polkadot/Kusama ecosystem you can most likely skip the Introduction chapter. It is recommended, however, that you read about our available Networks.

### Do I need to be a developer to understand Introduction chapter?
To use this introduction chapter you do not need any programming skills, and it will be useful later when you step into more advanced topics.
4 changes: 4 additions & 0 deletions docs/build/astar-beta-labs/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Astar Beta Labs",
"position": 11
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Account Abstraction",
"position": 1
}
14 changes: 14 additions & 0 deletions docs/build/astar-beta-labs/account-abstraction/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Account Abstraction

## Overview

Here you will find all the information you need to refine the end-user experience and allow for seamless web2-like interactions with dApps and accounts.

Please note that this section is part of Astar Beta Labs and may contain incomplete or outdated information. For production-ready solutions, please refer to material outside the Astar Beta Labs section.

```mdx-code-block
import DocCardList from '@theme/DocCardList';
import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
<DocCardList items={useCurrentSidebarCategory().items}/>
```
12 changes: 12 additions & 0 deletions docs/build/astar-beta-labs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Astar Beta Labs

## Overview

This section is for experimental technologies and features that are still in development that may only be available in testnet environments.

```mdx-code-block
import DocCardList from '@theme/DocCardList';
import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
<DocCardList items={useCurrentSidebarCategory().items}/>
```
4 changes: 4 additions & 0 deletions docs/build/astar-beta-labs/metamask-snaps/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "MetaMask Snaps",
"position": 2
}
7 changes: 7 additions & 0 deletions docs/build/astar-beta-labs/metamask-snaps/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# MetaMask Snaps

## Overview

MetaMask Snaps allows users to add features and functionality to their MetaMask wallet. Individual snaps are features created by third-party developers that MetaMask users can install directly into their wallet. MetaMask Snaps Open Beta is a first look at what's possible when extending the capabilities of the MetaMask wallet. Snaps run in a sandboxed environment and use a permissions model to protect your data and respect your consent. Snaps don’t have access to your MetaMask account data. When installing a Snap, you can always verify the permissions you are granting.

Please note that this section is part of Astar Beta Labs and may contain incomplete or outdated information. For production-ready solutions, please refer to material outside the Astar Beta Labs section.
4 changes: 4 additions & 0 deletions docs/build/zkEVM/faq/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "FAQ",
"position": 9
}
65 changes: 65 additions & 0 deletions docs/build/zkEVM/faq/zkevm-eth-faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
sidebar_position: 2
title: zkEVM and EVM Equivalence FAQs
sidebar_label: EVM Equivalence
---

This document compiles some of the frequently asked questions related to the Astar zkEVM's equivalence with EVM. For more details, check out [Polygon zkEVM documentation](https://wiki.polygon.technology/docs/category/zkevm-protocol/).

---

### What is the difference between EVM Compatibility and EVM Equivalence?

The ultimate goal is not **compatibility**. The ultimate goal is **equivalence**. **Solutions that are compatible enable most existing apps to work, but sometimes with code changes**. Additionally, compatibility may lead to the breaking of developer toolings.

**zkEVM strives for EVM Equivalence because it means that most applications, tools, and infrastructure built on Ethereum can immediately port over to Astar zkEVM with limited to no changes needed**. Things are designed to work 100% on day one. This is critical because:

1. **Development teams don't have to make changes to their code**, which could introduce security vulnerabilities.
2. **No code changes are needed**. You don't need additional audits, which saves time and money.
3. **zkEVM ultimately benefits from the security and decentralization of Ethereum**, since transactions are still finalized on Ethereum.
4. Astar zkEVM **benefits from the already vibrant and active Ethereum community**.
5. Allows for **fast user onboarding**, since dApps built on Ethereum are already compatible.

### Why is EVM Equivalence needed?

Ethereum isn’t just a blockchain. It’s a rich ecosystem of smart contracts, developer tools, infrastructure, and wallets. It’s a vibrant community of developers, auditors, and users.

The best way to scale Ethereum is to strive to maintain equivalence with this ecosystem. Astar zkEVM will give users and developers an almost identical experience to Ethereum L1 with significant scalability and user experience improvements.

### What EVM opcodes are different on Astar zkEVM?

The following EVM opcodes are different in Astar zkEVM: **SELFDESTRUCT**, **EXTCODEHASH**, **DIFFICULTY**, **BLOCKHASH**, and **NUMBER**.

### What precompiled smart contract functions does Astar zkEVM support?

The following precompiled contracts are supported in the zkEVM: **ecRecover** and **identity**.

Other precompiled contracts have no effect on the zkEVM state tree and are treated as a `revert`, returning all gas to the previous context and setting the `success` flag to "0".

### Which precompiled contracts are missing in the current zkEVM version?

Astar zkEVM supports all precompiled contracts except **SHA256**, **BLAKE**, and **PAIRINGS**.

### When will we get Type 2 EVM Equivalence?

Currently, Astar zkEVM has Type 3 equivalence with EVM. It will reach Type 2 and full equivalence when all pre-compiled contracts are supported.

### Can you explain the process of rollbacks and reverts in Astar zkEVM? Are they similar to EVM?

The process of rollbacks and reverts is similar to regular EVMs. Whenever there is an error or a condition that triggers a revert, it uses the `REVERT` instruction to stop the execution and then returns an error message.

Rollbacks can also happen sometimes because of an invalid zk-proof (this triggers something new to Astar zkEVM) which would cause the transaction to be aborted and all the state changes to be undone.

### How does the Astar zkEVM handle events and logging?

Astar zkEVM handles events and logging in a similar way to other EVMs, by emitting events and logging them on the blockchain for future reference.

### How similar are Astar zkEVM error messages with Ethereum?

Astar zkEVM has a high level of compatibility with Ethereum errors. You need to bear in mind that Astar zkEVM has more constraints than Ethereum and also uses different concepts (for example, batches instead of blocks). Therefore, it will give more types of errors with more precision (for example, the concept of gas in Astar zkEVM is more broken down).

### Can Chainlink use their token (ERC677) in Astar zkEVM?

You can deploy any smart contract on Astar zkEVM, just like you would on Ethereum, so you can deploy any token. If you want to send the token to Ethereum, the bridge will convert it to an ERC20 token (bi-directional bridge).

The bridge also has **low-level message passing functionality** that can be used to bridge any type of value, including NFTs and other token standards.
93 changes: 93 additions & 0 deletions docs/build/zkEVM/faq/zkevm-general-faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
sidebar_position: 1
title: General FAQs related to zkEVM
sidebar_label: General FAQs
---
This document compiles some of the frequently asked questions related to the Astar zkEVM. For more details, check out [Polygon zkEVM documentation](https://wiki.polygon.technology/docs/category/zkevm-protocol/).
---

### What is Astar zkEVM?

Astar zkEVM is a layer 2 scaling solution for Ethereum that offers an EVM-equivalent smart contract environment. This means that most of the existing smart contracts, developer tools, and wallets for Ethereum also work with the Astar zkEVM.

Astar zkEVM harnesses the power of Zero-Knowledge proofs to reduce transaction costs and increase throughput on L2, all while inheriting the security of Ethereum L1.

### What are the main features of Astar zkEVM?

- **EVM-equivalence**: Most Ethereum smart contracts, wallets, and tools work seamlessly on Astar zkEVM.
- Inherits its **security from Ethereum.**
- Lower cost compared to L1 and **faster finality compared to other L2 solutions** such as Optimistic Rollups
- **Zero-Knowledge Proof-powered scalability** aiming for similar throughput to PoS.

### What kind of gas fee reduction can users expect from Astar zkEVM?

Compared to Ethereum Layer 1, users can expect a significant reduction in gas fees. Astar's layer 2 scaling solution batches transactions together, effectively spreading the cost of a single layer 1 transaction across multiple layer 2 transactions.

### How do zk Rollups work?

zk Rollups aggregate large batches of transactions and finalize them on the Ethereum network using zero-knowledge validity proofs.

### What is so unique about zkEVMs?

ZkEVMs were thought to be years away; not practical or competitive with other ZK L2s as there seemed to loom an unavoidable tradeoff - Full EVM equivalence or high performance, but not both.

However, given the proving system breakthroughs pioneered by Polygon Labs, full EVM equivalence is now possible while at the same time offering higher performance and lower costs than alternative L1s, optimistic rollups, and other kinds of zk Rollups.

### How do I connect Astar zkEVM to a Metamask Wallet?

In order to add the Astar zkEVM network to your wallet, please check [this guide] (INSERT_LINK) which contains the latest RPC details and videos demonstrating useful functionalities.

### How does Astar zkEVM compare to other zkEVMs in terms of technology and performance? What are the technical advantages there?

The best reference is Vitalik Buterin's comprehensive analysis of zkEVMs [published in his blog](https://vitalik.ca/general/2022/08/04/zkevm.html).

However, the major difference between Astar zkEVM and others is the zkEVM's efficient prover and high Ethereum equivalence. Regarding the design of the prover/verification component: other projects use an arithmetic circuit approach while the Astar zkEVM zkProver uses the State Machine approach.

### Is Astar zkEVM open source?

Yes, [Astar zkEVM is fully open-source](https://polygon.technology/blog/polygon-zkevm-is-now-fully-open-source) and uses Polygon zkEVM solution with an AGPL v3 open-source license.

### Does Astar zkEVM have a separate token?

No. **ETH will be used for gas fees**. It is expected that ASTR will be used for staking and governance in Astar zkEVM in the future.

It is also important to note that Astar zkEVM **natively supports Account Abstraction via ERC-4337**, which will allow users to pay fees with any token (bring your own gas).

### What types of dApps can be deployed on Astar zkEVM?

Any dApp that is compatible with EVM can be deployed, except for those which require a specific precompiled contract that is currently not supported by zkEVM. For more details related to supported precompiled contracts, check out the [Polygon zkEVM documentation](https://wiki.polygon.technology/docs/category/zkevm-protocol/).

### Can this Layer 2 zkEVM work with other chains?

**At the moment, the answer is No**. Aspirationally, the goal in the future is to build one of many chains that allow users' assets to move from layer 2 (L2) to layer 2. With that being said, users will not be able to utilize this functionality at launch, but L2 to L2 movement is included in our future roadmap.

### What are some of the main use cases for Astar zkEVM?

**DeFi Applications**: Because of Astar zkEVM’s high security and censorship resistance nature, it's a good fit for DeFi applications. zkRollups don’t have to wait for long periods for deposits and withdrawals; Astar zkEVM offers better capital efficiency for DeFi dApps/users.

**NFT, Gamefi, and Enterprise Applications**: Low gas cost, high transaction speed, and a greater level of security coupled with Ethereum composability are attractive to blue chip NFTs, GameFi, and Enterprise applications.

**Payments**: Users interested in transacting with each other in real-time within a near-instantaneous and low-fee environment will appreciate the value Astar zkEVM provides.

### When Astar zkEVM publishes a proof on L1, how can someone trust that that proof is accurate and includes all the transactions it claims it does?

Our zkRollup smart contract warranties it. It's trustworthy due to data availability and the fact that the published validity proofs are quick and easily verifiable SNARK proofs.

### Does Astar zkEVM have support for both Solidity and Vyper?

Yes, any language that gets compiled to EVM opcode should work with Astar zkEVM. In other words, if it can run on Ethereum, it can run on the Astar zkEVM.

### What is an RPC node?

**RPC (Remote Procedure Call)** is a JSON-RPC interface compatible with Ethereum. It enables the integration of Astar zkEVM with existing tools, such as Metamask, Etherscan, and Infura. It adds transactions to the pool and interacts with the state using read-only methods.

Additionally, for a software application to interact with the Ethereum blockchain (by reading blockchain data and/or sending transactions to the network), it must connect to an Ethereum node. It works the same way as other nodes such as geth.

Learn how to set up your production zkNode [here] (INSERT_LINK)

### Do you support the JSON-RPC EVM query spec? What are the unsupported queries?

All official queries are supported (`eth_*` endpoints). We are working on support from some "extra official endpoints" such as `debug_*`.

(INSERT_LINK)(../zk-node/setup-production-node.md).
(INSERT_LINK)(../quickstart.md)
Loading

0 comments on commit dcb5ca8

Please sign in to comment.