Skip to content

Commit 152204c

Browse files
authored
Merge pull request 0xPolygon#2459 from 0xPolygon/hosted/cdk-pp-docs-review-env
CDK PP Docs Review Env: DO NOT MERGE!!! (merging due to edits/comments from team in this PR)
2 parents 9606598 + 228e3d8 commit 152204c

File tree

5 files changed

+58
-48
lines changed

5 files changed

+58
-48
lines changed

docs/cdk/architecture/cdk-pp-highlevel-arch.md

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The figure below depicts a simplified, high level view of the CDK PP chain archi
44

55
## Transaction flow
66

7-
Here is a step by step flow of transactions starting from when users submit transactions up to when the transactions are settled in L1.
7+
Here is a step by step flow of transactions starting from when users submit transactions up to when the transactions are settled in L1.
88

99
1. A user connects to the chain via a CDK Erigon RPC node and submits a transaction.
1010
2. CDK Erigon RPC node sends the transaction data to the transaction-pool manager.
@@ -14,49 +14,4 @@ Here is a step by step flow of transactions starting from when users submit tran
1414
6. AggSender gets batch data from the CDK Erigon sequencer, uses the data to generate certificates, and submits the certificates to the JSON-RPC API.
1515
7. The JSON-RPC API checks validity of the certificates against the transaction data in the CDK Erigon RPC node.
1616
8. After validating the certificates, the JSON-RPC API sends a request to generate a proof, together with the necessary data (including the certificates), to the SP1 prover.
17-
9. Once the proof is received from the SP1 prover, the JSON-RPC API sends it to L1.
18-
19-
20-
21-
## Sequential diagram
22-
23-
The flow of data is depicted in the squential diagram below.
24-
25-
1. User submits a tx to the CDK Erigon RPC node.
26-
2. The CDK Erigon RPC node sends tx data to the tx-pool man.
27-
3. The tx-pool man proxies tx data to the CDK Erigon sequencer.
28-
4. CDK Erigon sequencer executes transactions.
29-
5. CDK Erigon sequencer syncs tx data with another CDK Erigon RPC node.
30-
6. AggSender gets batch data from the CDK Erigon sequencer.
31-
7. AggSender submits certificates to the JSON-RPC API.
32-
8. JSON-RPC API checks validity of the certificates.
33-
9. JSON-RPC API requests a proof from SP1 prover.
34-
10. SP1 prover sends back a proof.
35-
11. JSON-RPC API sends proof to L1.
36-
37-
38-
39-
```mermaid
40-
sequenceDiagram
41-
participant User
42-
participant ErigonRPC1 as RPC node 1
43-
participant tx-pool-man as tx-pool manager
44-
participant Sequencer as Sequencer node
45-
participant ErigonRPC2 as RPC node 2
46-
participant AggSender as AggSender
47-
participant API as JSON-RPC API
48-
participant SP1-prover as SP1 prover
49-
participant L1 as L1
50-
51-
User->>ErigonRPC1: submits tx
52-
ErigonRPC1->>tx-pool-man: sends tx data
53-
tx-pool-man->>Sequencer: proxies tx data
54-
Sequencer->>Sequencer: sequences transactions
55-
Sequencer->>ErigonRPC2: syncs data
56-
AggSender->>Sequencer: reads batch data
57-
AggSender->>API: sends certificates
58-
API->>ErigonRPC2: checks validity
59-
API->>SP1-prover: requests proof
60-
SP1-prover->>API: returns proof
61-
API->>L1: submits proof
62-
```
17+
9. Once the proof is received from the SP1 prover, the JSON-RPC API sends it to L1.

docs/cdk/getting-started/cli-tool.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ Options:
7272
cdk erigon --config /etc/cdk/cdk-node-config.toml --chain genesis.json
7373
```
7474

75+
```
76+
cdk erigon --config /etc/cdk/cdk-node-config.toml --chain genesis.json
77+
```
78+
7579
### `cdk versions`
7680

7781
The above command generates all the required configuration files for cdk-erigon on the fly and runs the node.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Developers can use the CDK stack to build layer 2 chains that are natively connected to the AggLayer (**CDK sovereign chains**).
2+
3+
Out of the box, CDK sovereign chains are built to connect to the AggLayer, and so they rely on a type of ZK-proof called a _pessimistic proof_ to finalize transactions.
4+
5+
## What is a pessimistic proof?
6+
7+
A *pessimistic proof* (PP) is a zero-knowledge proof attesting to the correctness of a chain’s bridge transitions and the collateralization of all withdrawals.
8+
9+
These proofs enable CDK sovereign chains that interoperate via the [unified bridge](../../zkEVM/architecture/unified-LxLy/index.md) to achieve trustless cross-chain security.
10+
11+
Pessimistic proofs ensure that CDK sovereign chains connected to the [AggLayer](../../agglayer/overview.md) interoperate securely, providing a robust mechanism for cross-chain interactions.
12+
13+
---
14+
15+
## CDK sovereign chain components
16+
17+
The architectural components of CDK sovereign chains are detailed in the table below:
18+
19+
| Component | CDK Stack | Notes |
20+
| ------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
21+
| Node = RPC and sequencer | [cdk-erigon](https://github.com/0xPolygonHermez/cdk-erigon) | Customizable, commonly:<br/>\- Sequencer = 1 node<br/>\- RPC = multiple nodes |
22+
| Contracts | <a href=https://github.com/0xPolygonHermez/zkevm-contracts>zkevm-contracts</a> | Includes L1 contracts for functionality |
23+
| CLI | [cdk](https://github.com/0xPolygon/cdk) | Included in [CDK](https://github.com/0xPolygon/cdk) repo |
24+
| AggSender | <a href=https://github.com/0xPolygon/cdk>cdk</a> | A sub-component of the CDK client that sends certificates to the AggLayer node |
25+
| Tx pool manager | <a href=https://github.com/0xPolygon/zkevm-pool-manager>zkevm-pool-manager</a> | Manages transaction storage |
26+
27+
---
28+
29+
## Component descriptions
30+
31+
Here are brief descriptions of the key CDK components:
32+
33+
- **CDK Erigon Node**: A fork of [Erigon](https://github.com/ledgerwatch/erigon), providing:
34+
- Multiple RPC nodes for transaction submission.
35+
- A sequencer for executing transactions, and creating blocks and batches.
36+
- **Contracts**: Smart contracts deployed on L1 to ensure full implementation and functionality:
37+
- `PolygonRollupManager`
38+
- `PolygonZkEVMBridgeV2`
39+
- `PolygonZkEVMGlobalExitRootV2`
40+
- `FflonkVerifier`
41+
- `PolygonZkEVMDeployer`
42+
- `PolygonZkEVMTimelock`
43+
- **CLI tool**: A command-line tool that simplifies deploying and configuring CDK components.
44+
- **AggSender**: A functionality within the CDK client that aggregates necessary data and sends certificates to the AggLayer node for proof generation. It works in conjunction with other sub-components, such as the bridge syncer.
45+
- **Transaction pool manager**: Handles storage of user-submitted transactions.
46+
- **Succinct's SP1 prover**: A cryptographic tool that generates ZK-proofs using Rust-based inputs. The prover resides in the AggLayer and is not directly connected to CDK sovereign chains.
47+
- **AggLayer node**: A critical component of the AggLayer that interfaces between CDK sovereign chains and the SP1 prover. It handles certificate validation and proof requests.
48+
49+
The AggSender within the CDK client communicates with the AggLayer node to facilitate proof generation and finalization of transactions.
50+
51+
See the high level view of the architecture [here](../architecture/cdk-pp-highlevel-arch.md)
2.2 MB
Loading

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,4 +273,4 @@ hide:
273273
</div>
274274
</div>
275275
</section>
276-
</div>
276+
</div>

0 commit comments

Comments
 (0)