Skip to content

Commit 6accf76

Browse files
Merge pull request 0xPolygon#296 from 0xPolygon/cdk/agglayer-fix
Full AggLayer integration how to
2 parents 35da3de + 35c5d29 commit 6accf76

File tree

5 files changed

+132
-22
lines changed

5 files changed

+132
-22
lines changed

docs/cdk/how-to/agglayer/configure.md

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Polygon AggLayer is a ZK-powered interoperability solution that enables a shared state across multiple chains. It receives zero-knowledge proofs from CDK chains and checks their soundness before sending them on to the L1 for verification.
2+
3+
This document shows you how to integrate and configure the AggLayer into your stack.
4+
5+
!!! important
6+
- Polygon manages the AggLayer in production at the current time.
7+
- In the future, the AggLayer will be decentralized.
8+
9+
!!! warning
10+
- The AggLayer is in development and subject to architectural changes.
11+
- The code is still being audited.
12+
13+
## Prerequisites
14+
15+
You should have already deployed a CDK chain stack which has integrated the bridge service.
16+
17+
Please check our [get started](../../get-started/quickstart-validium.md) section for guidance, quickstarts, and deployment tutorials for more information.
18+
19+
!!! important
20+
- If you want to register your chain on the uLXLY bridge, follow the [instructions here](../register-configure-ulxly.md).
21+
- However, you may only be interested in integrating the AggLayer with your chain, in which case you do not have to register for the uLXLY bridge.
22+
23+
## Configure your chain to use the AggLayer
24+
25+
To access the Polygon AggLayer, you need to update your node configuration.
26+
27+
Open the `config.toml` file and include the following:
28+
29+
```sh
30+
[Aggregator]
31+
### Agglayer
32+
SettlementBackend = "agglayer"
33+
AggLayerURL = "http://agglayer-001.{{ base_dn }}:{{ zkevm_agglayer_server_port }}"
34+
AggLayerTxTimeout = "30s"
35+
SequencerPrivateKey = {Path = "/etc/zkevm/sequencer.key", Password = "{{ zkevm_keystore_password }}"}
36+
SenderAddress = ""
37+
```
38+
39+
- `SettlementBackend` defines how a final zk-proof is settled. All chains connected to the AggLayer use the `agglayer` value.
40+
- `AggLayerTxTimeout` is the interval a transaction is mined on the AggLayer.
41+
- `AggLayerURL` is the url of the agglayer service. Supplied by Polygon.
42+
- `SequencerPrivateKey` is the private key of the trusted sequencer. Only a CDK trusted sequencer can interact with the AggLayer.
43+
- `SenderAddress` is the address specified by the aggregator when it creates a proof. Supplied by Polygon.
44+
45+
You now have a fully integrated AggLayer in your Polygon CDK stack.
46+
47+
</br>

docs/cdk/how-to/agglayer/openrpc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Try out the AggLayer OpenRPC methods using playground below.
88
!!! tip
99
- Click the full screen icon to hide the code on the left.
1010

11-
<embed type="text/html" src="https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/0xPolygon/agglayer/1c61515c98c07d91ee14dc3987839722ed0696e5/docs/openrpc.json" width="100%" height="1000px">
11+
<embed type="text/html" src="https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/0xPolygon/agglayer/1c61515c98c07d91ee14dc3987839722ed0696e5/docs/openrpc.json?uiSchema[appBar][ui:input]=false&uiSchema[appBar][ui:splitView]=false" width="100%" height="1000px">
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
This document describes how to register with Polygon, and configure your CDK chain to use the Polygon uXLXY bridge.
2+
3+
!!! tip "Prerequisites"
4+
- You should have already deployed a CDK chain stack which has integrated the bridge service.
5+
- Please check our [get started](../get-started/quickstart-validium.md) section for guidance, quickstarts, and deployment tutorials for more information.
6+
7+
## Step 1: Attach a chain to the uLXLY bridge
8+
9+
1. If your CDK chain is not yet registered with Polygon, [make a request to register your chain](https://discord.gg/XvpHAxZ).
10+
11+
We will ask you for the following data:
12+
13+
```json
14+
"rollupTypeID": 0,
15+
"chainID": 0000,
16+
"admin": "0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
17+
"sequencer": "0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
18+
"gasTokenAddress": "0x0000000000000000000000000000000000000000",
19+
"sequencerURL": "https://rpc.chain.name",
20+
"networkName": "chain name"
21+
```
22+
23+
!!! note
24+
- If you are using a wrapped-token on the bridge, we use the original token address.
25+
- You can use any token on any network that is attached to the LxLy bridge, including those from the Ethereum mainnet.
26+
27+
2. Once registered, we provide you with the following network parameters:
28+
29+
- `rollupID`
30+
- `rollupAddress`
31+
32+
3. We also give you a pre-configured `genesis.json` file to use.
33+
34+
4. You will need the Polygon bridge configuration details.
35+
36+
```sh
37+
[NetworkConfig]
38+
GenBlockNumber = 1
39+
PolygonBridgeAddress = "0xCca6ECD73932e49633B9307e1aa0fC174525F424"
40+
PolygonZkEVMGlobalExitRootAddress = "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"
41+
PolygonRollupManagerAddress = "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e"
42+
PolygonZkEvmAddress = "0x8dAF17A20c9DBA35f005b6324F493785D239719d"
43+
L2PolygonBridgeAddresses = ["0xCca6ECD73932e49633B9307e1aa0fC174525F424"]
44+
```
45+
46+
5. Configure your nodes with the data.
47+
48+
!!! info "Configure your nodes"
49+
- Add the `rollupID` and `rollupAddress` parameters to the `L1config` section of the `genesis.json` file of the CDK node. For example:
50+
51+
```sh
52+
{
53+
"rollupTypeID": 1,
54+
"chainID": 3776,
55+
"admin": "0xxxxx",
56+
"sequencer": "0xxxxx",
57+
"gasTokenAddress": "0x0000000000000000000000000000000000000000",
58+
"sequencerURL": "https://rpc.xxx",
59+
"networkName": "xxx zkEVM",
60+
}
61+
```
62+
63+
6. Polygon registers the CDK chain on the uLxLy bridge.
64+
65+
7. Chain owners then need to add POL and ETH tokens to the sequencer on the CDK chain.
66+
67+
## Step 2: Polygon configuration
68+
69+
!!! important
70+
- These steps are done by Polygon.
71+
72+
Once registered, Polygon creates a permissionless node that points to the corresponding L2 full node.
73+
74+
We then add your details to our AggLayer configuration file [`../agglayer/docker/data/agglayer.toml`](https://github.com/0xPolygon/agglayer/blob/main/docker/data/agglayer/agglayer.toml); specifically these configurations:
75+
76+
* `[FullNodeRPCs]` points to the corresponding L2 full node.
77+
* `[L1]` points to the corresponding L1 chain.
78+
* The `[DB]` section has the managed database details.
79+
80+
Your chain is now set up on the Polygon uXLXY bridge.
81+
82+
<br/>

mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ nav:
8484
- Connect to CDK testnet: cdk/get-started/connect-testnet.md
8585
- How to:
8686
- Use a native token: cdk/how-to/use-native-token.md
87+
- Use the uXLXY bridge: cdk/how-to/register-configure-ulxly.md
8788
- Use the AggLayer:
88-
- Configure the AggLayer: cdk/how-to/agglayer/configure.md
89+
- Integrate the AggLayer: cdk/how-to/agglayer/integrate.md
8990
- AggLayer OpenRPC: cdk/how-to/agglayer/openrpc.md
9091
- Local installation: cdk/how-to/agglayer/local-install.md
9192
- Manage allowlists with policies: cdk/how-to/manage-policies.md

0 commit comments

Comments
 (0)