Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Verification with MerkleDAG #88

Open
hopeyen opened this issue May 8, 2024 · 0 comments
Open

Feat: Verification with MerkleDAG #88

hopeyen opened this issue May 8, 2024 · 0 comments
Assignees
Labels
p1 High priority size:x-large Very large type:feature New or enhanced functionality

Comments

@hopeyen
Copy link
Collaborator

hopeyen commented May 8, 2024

Problem statement

To use File CID directly, we need to add additional interaction between the data provider and consumers.

Expectation proposal

Data Structure for MerkleDAG

  • A HashMap of File CID to the corresponding DAG
  • A recursive structure to represent DAG. A block, identified by block hash, also contains a list of blocks, potentially an enum that is a parent block, or data content (leave blocks)
  • Function to return DAG without leave blocks
  • Function to return leave blocks by File CID and position

File Hasher

  • Create MerkleDAG for files, matching the same schemes as IPFS files
  • Validate a DAG from root to all children blocks
  • Validate specific data content to a specific block of the DAG

File Service

  • Expose a function or a dedicated endpoint for providing DAG to clients for a File CID (serialize in json object)
  • Returns specific data content for a request that contains a File CID and a range

Downloader

  • Given a File CID, request for the DAG to available file services
  • Once receiving a DAG, de-serialize it and validate top to bottom without leave blocks
  • For each request, predetermine the position, data range, and the correct hash from DAG
  • For each content response, validate the content with respect to the correct hash

Make sure that File CID created matches exactly with IPFS CID v0

Alternative considerations
Reference existing implementation

@hopeyen hopeyen added size:x-large Very large p1 High priority type:feature New or enhanced functionality labels May 8, 2024
@hopeyen hopeyen self-assigned this May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1 High priority size:x-large Very large type:feature New or enhanced functionality
Projects
None yet
Development

No branches or pull requests

1 participant