> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cultura.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Typical Dapp Architecture

> Overview of the common components used when building a Dapp on Cultura.

### Interaction Diagram (Simplified)

```mermaid theme={null}
flowchart LR
    A["Dapp <br/> (Frontend)"] --> B("Cultura SDK")
    B -- Provides Mock --> H
    A --> H("Licensing SDK")
    H --> G
    subgraph OnChain["Cultura L2 Blockchain"]
        direction LR
        C["Proof of Rights Protocol<br/>(CAS, Verifier Module, etc.)"]
        G["Licensing Protocol"]
    end
    subgraph OffChain["Off-Chain Services"]
        direction LR
        D["Subgraph <br/> (Indexed Data)"]
        E["IPFS <br/> (Metadata/Files)"]
    end

    %% Interactions
    B --> C
    B --> D
    B --> E

    C --> D

    C --> E

    G --> C

    D --> A

    %% Styling
    classDef frontend fill:#f9f,stroke:#333,stroke-width:2px
    classDef sdk fill:#ccf,stroke:#333,stroke-width:2px
    classDef onchain fill:#cfc,stroke:#333,stroke-width:2px
    classDef offchain fill:#ffc,stroke:#333,stroke-width:2px

    class A frontend
    class B sdk
    class C,G onchain
    class D,E offchain
```

## Components

1. **Dapp (Frontend):**

   * The user interface built with standard web technologies (React, Vue, etc.).
   * Interacts with the user's wallet (e.g., MetaMask).
   * Uses the **Cultura SDK** to initiate transactions (write operations) and fetch data.
   * Uses the **Licensing SDK** to initiate licensing transactions and query data about available Licensable Digital Assets.
   * **Cultura SDK** provides a mock licensing sdk.
   * May directly query the **Subgraph** for optimized read-only data displays (e.g., asset galleries).

2. **Cultura SDK:**

   * A TypeScript library simplifying interactions with Cultura's backend components.
   * Provides methods for minting, attestation, royalty management, and data querying.
   * Acts as the primary interface between the frontend and the on-chain/off-chain services.
   * Connects to the **Proof of Rights Protocol** contracts, **Digital Asset Contracts**, **Mock Licensing Protocol**, **Subgraph**, and **IPFS**.

3. **Backend Components:**
   * **On-Chain (Cultura Network):**
     * **Proof of Rights Protocol:** The core logic managing asset verification. Includes:
       * **Cultura Attestation Service (CAS):** Handles attestations, bonding, verification levels, and grades.
       * **Rights Bound Account (RBA):** Smart wallet deployed per attestation, managing claims and royalty splits.
       * **Verifier Module:** Manages rewards for verifiers.
       * **Schema Registry:** Stores attestation data structures.
     * **Licensing Protocol (External or Mock):** Facilitates formal licensing agreements for Level 2 assets. The SDK includes a **[Mock Licensing Protocol client](../sdk-reference/mocks/mock-licensing-protocol)** for testing.
     * **CulturaDigitalAsset NFT:** The primary NFT contract for original assets, implementing the **[Licensed ERC Standard](../smart-contracts-reference/concepts#licensed-erc-standard)**.
     * **LicensedCreativeAsset NFT:** NFT contract (often using `CulturaDigitalAsset` itself) for assets created *after* licensing, linking back to parent(s).
     * **Blockchain Network (Cultura L2):** The underlying Layer 2 network securing transactions and contract execution.
   * **Off-Chain Services:**
     * **Subgraph (The Graph):** Indexes events from on-chain contracts, providing a fast GraphQL API for reading structured data (assets, attestations, etc.). Queried by the SDK and potentially the frontend.
     * **IPFS:** Decentralized storage for large files like NFT metadata (`termsURI` content, images) and potentially the creative works themselves. Contracts store IPFS CIDs.

## Interactions Summary

* **Frontend -> Cultura SDK:** User actions trigger SDK calls.
* **Frontend -> Licensing SDK:** Query and perform licensing actions.
* **Cultura SDK -> On-Chain Contracts:** Executes transactions (minting, attesting, licensing, claiming) and reads contract state.
* **Cultura SDK -> Subgraph:** Fetches indexed, structured data for display or logic.
* **Cultura SDK -> IPFS:** Uploads/retrieves metadata files.
* **On-Chain Contracts -> Blockchain Network:** Transactions are recorded and state is secured.
* **On-Chain Contracts -> Subgraph:** Emit events that the Subgraph indexes.
* **On-Chain Contracts -> IPFS:** Store/retrieve CIDs pointing to off-chain data.
* **Subgraph -> Frontend/SDK:** Provides efficient read access to indexed data.

## Core Process Flows

To understand the specific interactions for key processes, refer to these detailed guides which include focused diagrams:

* **[Verification & Attestation Flow](../building-on-cultura/core-sdk-workflows/verification-attestation):** How assets achieve Level 1 and Level 2 (Licensable).
* **[Licensing & Minting Flow](../building-on-cultura/core-sdk-workflows/licensing-and-minting):** The end-to-end process of licensing a Level 2 asset and creating a Licensed Creative Asset.
* **[Royalty Payments Flow](../building-on-cultura/core-sdk-workflows/royalty-payments):** How royalties are reported, processed, and claimed.
* **[Querying Assets & Rights](../building-on-cultura/core-sdk-workflows/querying-assets):** How the SDK interacts with the Subgraph.

For a broader view of all actors and potential integrations, see the [Cultura Ecosystem Architecture](./cultura-ecosystem-architecture).
