0G and creating AI DApps

The described 0G system architecture provides a decentralized and secure method for storing and retrieving data. Let’s break down the key components and processes involved:

  1. 0G Storage:
    • The 0G Storage system utilizes a decentralized storage approach.
    • Consensus mechanisms ensure the ordering of uploaded data blocks and validate storage mining through smart contracts.
    • Uploaded data blocks are organized into batches with associated metadata and KZG commitments.
    • Batches are stored in 0G Storage nodes, and their integrity is verified using merkle trees.
  2. 0G DA (Data Availability):
    • The 0G DA layer ensures the availability of data blocks.
    • Validators independently perform data availability sampling to verify the presence of data blocks in storage.
    • Consensus among validators confirms successful sampling results, ensuring data availability.
    • Data is considered available once the majority of validators agree on its presence.
  3. Blob Dispersal:
    • Users submit data blobs to a Disperser service.
    • The Disperser encodes the data, constructs metadata, and stores blobs and metadata in an s3 bucket.
    • A Batcher encodes multiple blobs into batches, along with KZG commitments and merkle trees.
    • The merkle root of each batch is sent to the on-chain 0G Storage contract, while the full batch is sent to a 0G Storage node.
  4. Blob Retrieval:
    • Data retrieval can occur through two approaches:
      • Trusting an existing disperser service: Users directly request data from the disperser, skipping data verification for efficiency.
      • Setting up a retriever service: Users verify metadata and merkle proofs before fetching data chunks, ensuring security.
    • Retrievers download and verify KZG commitments for each data chunk before returning the complete data blob to the user.

This architecture balances security and efficiency, allowing users to retrieve data quickly while ensuring its integrity through decentralized storage and verification mechanisms. Additionally, the separation of disperser and retriever services provides flexibility for users based on their trust preferences.