> For the complete documentation index, see [llms.txt](https://docs.2pm.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2pm.network/node-framework/modular-architecture.md).

# Modular Architecture

The 2PM.Network Node Framework is a modular, decentralized system designed for privacy-preserving computations across a peer-to-peer network. This framework is particularly geared towards multiple data holders who establish nodes to connect and utilize their own data securely.&#x20;

### **Core Components**

<figure><img src="/files/3LChySXenfZfyp5bnTGa" alt=""><figcaption></figcaption></figure>

1. **Blockchain Node**:
   * **Function**: Acts as the backbone for the P2P networking, managing digital identities and node discoveries.
   * **Features**: Supports the decentralized nature of the network, enabling nodes to freely join or leave without affecting overall network functionality. It uses smart contracts for task distribution and result reporting, ensuring consistent rule enforcement across the network.
2. **2PM Node**:
   * **Function**: Handles the computation tasks, connecting to the blockchain node through the Chain Connector.
   * **Features**: Engages in the network for task dissemination, result submission, and execution of privacy-preserving computations like Secure Multi-Party Computation (SMPC) and Private Set Intersection (PSI).

### **Modular Design of 2PM Node Framework**

1. **Chain Connector**:
   * **Function**: Serves as a modular link between the 2PM Node and the blockchain node, facilitating seamless integration and communication. It allows for easy switching between different blockchain systems and manages cryptographic operations required for privacy-preserving tasks.
2. **Task Management**:
   * **Server Side Function**: Manages the registration and distribution of computing tasks. It aggregates results from various client nodes to form the final outcome, ensuring data privacy and security throughout the process.
   * **Client Side Function**: Monitors blockchain for new tasks, retrieves the execution code from the server side, and performs local computations. It engages in SMPC with other client nodes to ensure data privacy during computation.
3. **Data Connector**:
   * **Function**: Connects the 2PM Node to the local data storage or 0G storage nodes, supporting various data formats like files, relational databases, and big data storage systems. It also ensures that data used in computations meets the necessary standards and conditions, adding an extra layer of data integrity and validation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.2pm.network/node-framework/modular-architecture.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
