Skip to content

Commit

Permalink
updated PP arch
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchpolygon committed Jan 7, 2025
1 parent ef5ec65 commit a5f5694
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
20 changes: 12 additions & 8 deletions docs/cdk/architecture/high-level-views.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The diagram below depicts a simplified architectural layout of the CDK FEP confi

---

### Component interactions
### Component Interactions

- The **CLI tool** is the starting point. Developers, or chain administrators in particular, use the CLI tool to build and configure chains in various modes of operation, such as validiums and rollups.
- Once a chain is configured with the CLI, users can submit transactions through the **CDK Erigon RPC node**. These transactions are relayed to the `tx-pool manager` before the sequencer selects and executes them.
Expand All @@ -18,13 +18,15 @@ The diagram below depicts a simplified architectural layout of the CDK FEP confi

---

### User data flow
### User Data Flow

The following diagram sequentially depicts the user data flow for the CDK FEP config in validium mode using a mock prover and an Agglayer connection.

![High level view of CDK user data flow](../../img/cdk/cdk-user-data-flow.svg)

#### Sequential interactions
---

### Sequential Interactions

1. The user sends a transaction to the **CDK Erigon RPC node**.
2. The **CDK Erigon RPC node** proxies the data to the **CDK Erigon sequencer node** and syncs the batch data between the sequencer and the RPC nodes.
Expand All @@ -39,6 +41,8 @@ The following diagram sequentially depicts the user data flow for the CDK FEP co

---

### Mermaid Sequence Diagram

```mermaid
sequenceDiagram
participant User
Expand All @@ -54,11 +58,11 @@ sequenceDiagram
User->>ErigonRPC: Send transaction
ErigonRPC->>Sequencer: Proxy and sync transaction data
Sequencer->>Sequencer: Sequence transaction batches
SeqSender->>ErigonRPC: Reads batches
SeqSender->>ErigonRPC: Read batches
SeqSender->>DACNodes: Persist transaction data (validium mode only)
SeqSender->>L1: Sequence batches into L1 Smart Contracts
Aggregator->>Prover: Send batches to Prover
Prover->>Aggregator: Return proofs
Aggregator->>Aggregator: Aggregate the proofs
SeqSender->>L1: Sequence batches into L1 Smart Contracts
Aggregator->>Prover: Send batches to Prover
Prover->>Aggregator: Return proofs
Aggregator->>Aggregator: Aggregate proofs
Aggregator->>Agglayer: Submit final proof
Agglayer->>L1: Submit final proof to L1 Smart Contract Domain
18 changes: 9 additions & 9 deletions docs/cdk/concepts/pessimistic-proofs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Pessimistic Proofs (PP) are zero-knowledge proofs that validate the correctness of bridge transitions and ensure the collateralization of all withdrawals. They provide a trustless mechanism for secure cross-chain interactions between chains configured with the CDK Sovereign Config and the Agglayer.

#### Key features:
#### Key Features:
- **Bridge validation:** Ensures transactions processed through the unified bridge are correct.
- **Withdrawal collateralization:** Confirms all withdrawals are properly collateralized, preventing unauthorized asset transfers.
- **Trustless interoperability:** Facilitates secure and seamless cross-chain communication.
Expand All @@ -21,19 +21,19 @@ Pessimistic Proofs enable developers to build robust, secure, and interoperable

### How Pessimistic Proofs work

Pessimistic Proofs validate cross-chain transactions using cryptographic proofs, ensuring trustless and secure interactions between chains configured with the Sovereign Config and the Agglayer.
Pessimistic Proofs validate cross-chain transactions by using cryptographic zero-knowledge proofs to ensure secure and trustless interactions between chains. These proofs safeguard the integrity of bridge operations and withdrawal processes.

#### Workflow:
1. **Transaction submission:** Transactions are sent to the chain’s sequencer.
2. **Certificate generation:** The AggSender aggregates chain data and sends certificates to the Agglayer node.
2. **Certificate generation:** The AggSender aggregates transaction data and sends certificates to the Agglayer node.
3. **Proof generation:** The SP1 prover in the Agglayer generates zero-knowledge proofs based on the certificates.
4. **Validation:** The Agglayer node validates the proofs and finalizes the transactions.

This ensures all transactions are secure, transparent, and trustlessly verified.
This ensures that all transactions are secure, trustlessly verified, and transparently executed.

---

### Architectural components of Sovereign Configs with Pessimistic Proofs
### Architectural Components of Sovereign Configs with Pessimistic Proofs

| Component | Repository | Notes |
|--------------------------|---------------------------------------------------------------------------------------------|-------------------------------------------------------------|
Expand All @@ -47,7 +47,7 @@ This ensures all transactions are secure, transparent, and trustlessly verified.

---

### Component descriptions
### Component Descriptions

- **Node (RPC and Sequencer):** A fork of [Erigon](https://github.com/ledgerwatch/erigon) responsible for managing multiple RPC nodes and running a sequencer to execute transactions and create blocks and batches.
- **Contracts:** Smart contracts deployed on Layer 1 to implement bridge transitions and withdrawal collateralization:
Expand All @@ -65,11 +65,11 @@ This ensures all transactions are secure, transparent, and trustlessly verified.

---

### Support services
### Support Services

#### Bridge services
#### Bridge Services
- [Bridge service](https://github.com/0xPolygonHermez/zkevm-bridge-service): A backend service enabling interactions with bridge contracts via Merkle proofs.
- [Bridge UI](https://portal.polygon.technology/): A user-friendly portal for managing deposits and withdrawals.

#### Explorer services
#### Explorer Services
- [Blockscout](https://github.com/0xPolygonHermez/blockscout): Recommended for inspecting transactions and cross-chain operations. Alternative explorers can also be integrated.

0 comments on commit a5f5694

Please sign in to comment.