Skip to content

Commit 92a8b33

Browse files
Merge branch 'main' into nadim/pos
2 parents f355488 + 5a038ab commit 92a8b33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2808
-33094
lines changed

README.md

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,61 @@
1-
# polygon-docs
1+
# Polygon docs
22

3-
Polygon Docs website, built using [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/).
3+
Welcome to the Polygon Docs website, built with [the Material theme for MkDocs](https://squidfunk.github.io/mkdocs-material/).
44

55
## Instructions for use
66

7-
Please open a branch and we will approve each other's work for now.
7+
Work on a local branch and request a review from a teammate.
88

9-
## Running Locally
9+
## How to run the site locally
1010

11-
### Python
11+
### Clone the repo
1212

13-
You must have Python 3.11, `pip3` and the `virtualenv` Python package installed. Then, simply run:
13+
```sh
14+
git clone https://github.com/0xPolygon/polygon-docs.git
15+
cd polygon-docs
16+
```
17+
18+
### Run with Python
19+
20+
1. Download and install Python 3.11: https://www.python.org/downloads/
21+
22+
2. Install the `virtualenv` package:
23+
24+
```sh
25+
pip install virtualenv
26+
```
27+
28+
3. Build and serve the html
1429

15-
```bash
30+
```sh
1631
./run.sh
1732
```
1833

19-
### Docker
34+
The site runs at: http://127.0.0.1:8000/
35+
36+
### Run with Docker
37+
38+
1. Run the following commands from the project root:
39+
40+
```sh
41+
docker build -t polygon-docs .
42+
docker compose up
43+
```
44+
45+
### Run manually
46+
47+
1. Download and install Python, as above, and ensure you have installed all the packages listed in `requirements.txt`, e.g.:
48+
49+
```sh
50+
pip install markdown-include==0.8.1
51+
```
52+
53+
2. Run the following from the project root to bring up the site:
54+
55+
```sh
56+
mkdocs serve --strict
57+
```
58+
59+
## Questions
2060

21-
* `docker build -t polygon-docs .`
22-
* `docker compose up`
61+
Feel free to contact the team any time: `#disc_tkd_techdocs`

docs/cdk/concepts/dac.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
1-
!!! note
2-
fix this: https://medium.com/coinmonks/what-is-data-availability-and-why-do-we-need-it-7993c039fc44
1+
Data availability in blockchain technology refers to whether or not transaction data is available on-chain or off-chain.
32

3+
If data is available on-chain, then each node has to store every piece of data related to every transaction. This can be costly for node operators as hardware and storage requirements are high. Moving data off-chain streamlines node architecture and operations.
44

5-
A data availability committee (DAC) is an optional offchain network of nodes that provides data to a blockchain network. The advantages are:
5+
!!! info "Recommended resource"
6+
See Ethereum.org's discussion on [data availability](https://ethereum.org/en/developers/docs/data-availability/).
67

7-
- **Lower transaction fees**: Reduced computational requirements lead to lower fees.
8-
- **State privacy**: A secure copy of state transitions ensures data integrity and privacy.
8+
## What is a validium?
99

10-
DACs store the data required to reconstruct the state of the blockchain and make that data accessible so that, if the blockchain goes down, users can still access their assets and data.
10+
Validiums are blockchain solutions that do not store transaction data.
1111

12-
Delegating blockchain data to a DAC in this way can be costly. However, a DAC improves finality and thus supports Enterprise use cases which require cheap and fast transactions with a private and secure data layer.
12+
!!! info "Recommended resource"
13+
See Ethereum.org's glossary [definition of validiums](https://ethereum.org/en/developers/docs/scaling/validium/).
14+
15+
## What is a DAC?
16+
17+
Polygon's CDK validium has an optional data availability committee (DAC).
18+
19+
A DAC is an off-chain network of nodes that implements a data storage layer in a modular chain architecture like CDK. Some advantages are:
20+
21+
- **Lower transaction fees**: Reduced computational requirements lead to lower fees and faster finality on the main network.
22+
- **Privacy and security**: The DAC stores secure and private transaction data.
23+
- **Trustless**: Data owners do not have to trust the blockchain operator.
24+
- **Scalable**: Decoupling data storage from the main chain supports more scalable networks.
25+
26+
DACs store the data required to reconstruct the state of the blockchain and make that data accessible so that, if the main blockchain network goes down, users can still access their assets and data.
27+
28+
Setting up a DAC can be costly and therefore DACs mostly support Enterprise use cases which require cheap and fast transactions with a private and secure data layer.
1329

1430
The CDK validium DAC is a secure consortium of nodes that ensures off-chain data access.
1531

@@ -31,5 +47,4 @@ The DAC works together with the sequencer to control the flow of data. The proce
3147

3248
6. **Verification on Ethereum**: A designated smart contract on Ethereum verifies the submitted signatures against a list of valid DAC members and confirms that sufficient approval has been provided for the batch hash.
3349

34-
7. **Final settlement with zero-knowledge proof**: The aggregator prepares a proof for the batch via the prover and submits it to Ethereum. This proof confirms the validity of the batch's transactions without revealing their details. The chain state updates on Ethereum.
35-
50+
7. **Final settlement with zero-knowledge proof**: The aggregator prepares a proof for the batch via the prover and submits it to Ethereum. This proof confirms the validity of the batch's transactions without revealing their details. The chain state updates on Ethereum.

docs/cdk/edge-suggestion.md

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
!!! note "Recommendation"
2+
Follow the [quickstart](quickstart-rollup.md) for a hands-on introduction to CDK in rollup mode.
3+
4+
## Deploy a CDK rollup locally
5+
6+
The [zkEVM deployment quickstart documentation](../..//zkEVM/step1-fullzkevm.md) shows you how to deploy a zkEVM rollup on your local machine.
7+
8+
!!! question
9+
What makes this CDK?
10+

docs/cdk/get-started/deploy-validium.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
!!! important "Recommendation"
2-
Follow the [Quickstart](quickstart-validium.md) for a hands-on introduction to CDK in validium mode.
2+
Follow the [quickstart](quickstart-validium.md) for a hands-on introduction to CDK in validium mode.
33

44
Follow the steps below to deploy a CDK validium instance.
55

@@ -21,4 +21,7 @@ Follow the instructions in the [CDK validium node repository's README](https://g
2121

2222
Finally, once the CDK validium node is operational, set up and run the data availability node.
2323

24-
Instructions for this can be found in the [<ins>CDK DA Node GitHub repository's README</ins>](https://github.com/0xPolygon/cdk-data-availability).
24+
Instructions for this can be found in the [<ins>CDK DA Node GitHub repository's README</ins>](https://github.com/0xPolygon/cdk-data-availability).
25+
26+
!!! question
27+
What makes this CDK?

docs/cdk/get-started/overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ CDK users choose a chain architecture specific to their needs and use cases.
1212
!!! info
1313
For the latest updates, follow our official GitHub repositories.
1414

15-
- [Rollup node](https://github.com/0xPolygonHermez/zkevm-node)
16-
- [Validium node](https://github.com/0xPolygon/cdk-validium-node)
17-
- [Data availability committee](https://github.com/0xPolygon/cdk-data-availability)
18-
- [zkEVM smart contracts](https://github.com/0xPolygonHermez/zkevm-contracts)
19-
- [Validium smart contracts](https://github.com/0xPolygon/cdk-validium-contracts)
15+
- [Rollup node](https://github.com/0xPolygonHermez/zkevm-node).
16+
- [Validium node](https://github.com/0xPolygon/cdk-validium-node).
17+
- [Data availability committee](https://github.com/0xPolygon/cdk-data-availability).
18+
- [zkEVM smart contracts](https://github.com/0xPolygonHermez/zkevm-contracts).
19+
- [Validium smart contracts](https://github.com/0xPolygon/cdk-validium-contracts).
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
Spin up an zkEVM ...
1+
## Run a CDK rollup locally
22

3-
Then ...
3+
The following documentation is a quickstart guide for deploying a CDK rollup on your local machine.
4+
5+
[https://github.com/0xPolygonHermez/zkevm-node/blob/develop/docs/running_local.md](https://github.com/0xPolygonHermez/zkevm-node/blob/develop/docs/running_local.md)
6+
7+
!!! question
8+
What makes this CDK?

docs/cdk/get-started/quickstart-validium.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
This quickstart guides you through the process of setting up a CDK validium on your local machine.
22

3-
!!! danger "Is it true?"
4-
Please note that the current Data Availability (DA) configuration in Polygon CDK is using a Data Availability Committee (DAC) node with a local Geth client as the L1. However, the integration with Layer 1 testnets, including Sepoilla, is actively being pursued.
5-
63
## Prerequisites
74

85
### System requirements
@@ -12,7 +9,7 @@ This quickstart guides you through the process of setting up a CDK validium on y
129
- An AMD64 architecture system.
1310

1411
!!! warning
15-
CDK does not support ARM-based Macs
12+
CDK does not support ARM-based Macs.
1613

1714
### Software requirements
1815

@@ -41,7 +38,7 @@ cp .env.example .env
4138
sudo docker-compose pull
4239
```
4340

44-
2.2 After pulling the images, start your local CDK Validium:
41+
2.2 After pulling the images, start your local CDK validium:
4542

4643
```bash
4744
sudo make run
@@ -98,7 +95,7 @@ zkevm-bridge-ui /bin/sh /app/scripts/deploy.sh Up
9895
```
9996
</details>
10097

101-
2.3.1 If a service isn't running (i.e. it is in Exit 1 state), investigate further using the logs:
98+
2.3.1 If a service isn't running (i.e. it is in `Exit 1` state), investigate further using the logs:
10299

103100
```bash
104101
sudo docker-compose logs <container_name>
@@ -121,6 +118,9 @@ To restart all services:
121118
sudo make restart
122119
```
123120

121+
!!! note
122+
This local deployment runs on an L1 Geth instance.
123+
124124
## 3. Test validium
125125

126126
3.1 Verify the block explorer is running by navigating to [localhost:4001](http://localhost:4001/).
@@ -131,7 +131,7 @@ You should see a page similar to this:
131131
<img src="/img/cdk/cdk-block-explorer-empty.png" alt="bridge" width="90%" height="30%" />
132132
</div>
133133

134-
### 4. Add the network to a Web3 wallet
134+
## 4. Add the network to a Web3 wallet
135135

136136
4.1 Follow MetaMask's instructions on [how to set up a network manually](https://support.metamask.io/hc/en-us/articles/360043227612-How-to-add-a-custom-network-RPC).
137137

@@ -159,6 +159,9 @@ You should see a page similar to this:
159159
<img src="/img/cdk/cdk-metamask-import-account.png" alt="bridge" width="90%" height="30%" />
160160
</div>
161161

162+
!!! danger
163+
Today, 21/11, I got stuck here with pending transfers that weren't picked up by blockexplorer.
164+
162165
4.4 Transfer some tokens to another account:
163166

164167
<div align="center">
@@ -181,55 +184,55 @@ You should see a page similar to this:
181184

182185
CDK has a native bridge with UI that allows you to transfer funds between the L1 and the L2 validium.
183186

184-
### L1 to L2
187+
### 5.1 L1 to L2
185188

186-
5.1 Add the L1 RPC to MetaMask:
189+
5.1.1 Add the L1 RPC to MetaMask:
187190

188191
<div align="center">
189192
<img src="/img/cdk/cdk-metamask-add-l1.png" alt="bridge" width="90%" height="30%" />
190193
</div>
191194

192-
5.2 Switch to the L1 network and you will see the previously imported account with ~999 POL on the L1 chain.
195+
5.1.2 Switch to the L1 network and you will see the previously imported account with ~999 POL on the L1 chain.
193196

194-
5.3 Verify the bridge UI by navigating to [localhost:8088](http://localhost:8088/).
197+
5.1.3 Verify the bridge UI by navigating to [localhost:8088](http://localhost:8088/).
195198

196-
5.4 Click on **Connect a wallet > MetaMask**.
199+
5.1.4 Click on **Connect a wallet > MetaMask**.
197200

198201
<div align="center">
199202
<img src="/img/cdk/cdk-bridge.png" alt="bridge" width="90%" height="30%" />
200203
</div>
201204

202-
5.5 Select the previously imported account (0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266). Once you are connected, you should see a page like this:
205+
5.1.5 Select the previously imported account (0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266). Once you are connected, you should see a page like this:
203206

204207
<div align="center">
205208
<img src="/img/cdk/cdk-bridge-connected.png" alt="bridge" width="90%" height="30%" />
206209
</div>
207210

208-
5.6 Enter the amount (e.g. 5) to bridge and click **Continue**, you will see the **Confirm Bridge** page.
211+
5.1.6 Enter the amount (e.g. 5) to bridge and click **Continue**, you will see the **Confirm Bridge** page.
209212

210-
5.7 Click **Bridge** and approve the transaction on the MetaMask pop-up:
213+
5.1.7 Click **Bridge** and approve the transaction on the MetaMask pop-up:
211214

212215
<div align="center">
213216
<img src="/img/cdk/cdk-bridge-confirm.png" alt="bridge" width="90%" height="30%" />
214217
</div>
215218

216-
5.8 Once bridging is complete, you should see the **Activity** page:
219+
5.1.8 Once bridging is complete, you should see the **Activity** page:
217220

218221
<div align="center">
219222
<img src="/img/cdk/cdk-bridge-completed-l1-to-l2.png" alt="bridge" width="90%" height="30%" />
220223
</div>
221224

222-
### L2 to L1
225+
### 5.2 L2 to L1
223226

224-
5.9 Switch network on MetaMask to your validium chain and navigate back to [localhost:8088](http://localhost:8088/).
227+
5.2.1 Switch network on MetaMask to your validium chain and navigate back to [localhost:8088](http://localhost:8088/).
225228

226-
5.10 You should see both the updated L1 and L2 balances:
229+
5.2.2 You should see both the updated L1 and L2 balances:
227230

228231
<div align="center">
229232
<img src="/img/cdk/cdk-bridge-l2-to-l1.png" alt="bridge" width="90%" height="30%" />
230233
</div>
231234

232-
5.11 Enter an amount and follow the same process to bridge the fund back to the L1.
235+
5.2.3 Enter an amount and follow the same process to bridge the fund back to the L1.
233236

234237
!!! note
235238
You cannot bridge back fund more than what you have previously bridged from L1 to the L2.
@@ -240,12 +243,15 @@ The L2->L1 bridging is slightly different than L1->L2 and you will see the **Act
240243
<img src="/img/cdk/cdk-bridge-l2-to-l1-on-hold.png" alt="bridge" width="90%" height="30%" />
241244
</div>
242245

243-
5.12 Click **Finalise** and approve the transaction (Note: MetaMask will pop up a window to ask you to switch to the L1 network first). Then you will see this once the bridging is completed:
246+
5.2.4 Click **Finalise** and approve the transaction (Note: MetaMask will pop up a window to ask you to switch to the L1 network first). Then you will see this once the bridging is completed:
244247

245248
<div align="center">
246249
<img src="/img/cdk/cdk-bridge-l2-to-l1-completed.png" alt="bridge" width="90%" height="30%" />
247250
</div>
248251

249252
!!! urgent
250253
- First time, I had an error on step 5.12 -> cannot estimate gas.
251-
- Second time, I had an error much earlier on, but that's probably because I didn't clear the images up, even though I restarted.
254+
- Second time, I had an error much earlier on, but that's probably because I didn't clear the images up, even though I restarted.
255+
256+
!!! question
257+
What makes this CDK?
File renamed without changes.

docs/tools/using-web3modal.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
:::caution Risks
3+
4+
Check the list of potential risks associated with the use of Polygon zkEVM in the [<ins>Risks FAQ</ins>](/zkevm/risk-disclosure.md) section.
5+
6+
:::
7+
8+
9+
## Get Started with Web3Modal
10+
11+
:::caution Content disclaimer
12+
13+
Please view the third-party content disclaimer [<ins>here</ins>](https://github.com/0xPolygon/wiki/blob/master/CONTENT_DISCLAIMER.md).
14+
15+
:::
16+
17+
### Overview
18+
19+
[<ins>Web3Modal</ins>](https://web3modal.com/) is a simple and intuitive SDK that provides a drop-in UI to enable users of any wallet to seamlessly log in to applications, offering a unified and smooth experience. It features a streamlined wallet selection interface with automatic detection of various wallet types, including mobile, extension, desktop, and web app wallets.
20+
21+
### Code Sandbox for Polygon
22+
23+
The Web3Modal team has prepared a [<ins>Polygon Code Sandbox</ins>](https://codesandbox.io/p/sandbox/web3modal-v3-polygon-7264l5?file=/src/main.tsx:9,19-9,50). It’s a straightforward way for developers to integrate and get hands-on experience with Polygon.
24+
25+
### How to Integrate
26+
27+
1. **Visit Web3Modal:** Go to [<ins>Web3Modal's official website</ins>](https://web3modal.com/) to explore its features and capabilities.
28+
2. **Explore the Code Sandbox:** Utilize the [<ins>Polygon Code Sandbox</ins>](https://codesandbox.io/p/sandbox/web3modal-v3-polygon-7264l5?file=/src/main.tsx:9,19-9,50) to demo and understand the integration process.
29+
3. **Follow the Documentation:** Refer to the provided documentation and instructions to integrate Web3Modal into your projects and leverage its features effectively.
30+
31+
## zkEVM Support
32+
33+
If you need help with anything related to the Polygon zkEVM, you can raise a ticket on the [Polygon Support](https://support.polygon.technology/support/tickets/new) portal, and check out the [Knowledge base](https://support.polygon.technology/support/solutions/folders/82000694871) to view the most common queries about the zkEVM. Additionally, you can reach out to the support team available on the **#zkevm-support** channel on the [Polygon Discord server](https://discord.com/invite/XvpHAxZ). Instructions for raising a zkEVM support ticket are as follows:
34+
35+
1. Join the **Polygon Discord** server [here](https://discord.gg/0xPolygon).
36+
2. Accept the invite sent via DM.
37+
3. Take the **Member** role under **#roles**.
38+
4. Navigate to the **#zkevm-support** channel.
39+
40+
You can now contact the zkEVM support staff with your questions and concerns. We will actively monitor for issues and work to resolve them as soon as possible.

0 commit comments

Comments
 (0)