Skip to content

Handle IPFS Objects with links #1

@nginnever

Description

@nginnever

Currently the README states that this verifier is limited to IPFS objects with no links. This is because the protobuf byte definition will change if an object has defined a links array in the protobuf message.

We may be stuck on being able to verify IPFS objects with links since an IPFS chunk is currently hard coded to 256k, meaning the file is already pretty large if it has links and the input data will cause large overhead in the sha256 hashing. I am interested in seeing what the max input data size is for this verifier, perhaps at peak optimization and only doing sha256 hashing and comparison without conversions.

However if we reduce the fixed size of an IPFS chunk and found the hard limit on data input we could perhaps handle the protobuf definition for an IPFS object with links.

Proposal:

  • test for upper bound on data input size (total with links)
    • document gas cost bottleneck(s) (probably sha256)
  • create a fixed sized chunker in verifyIPFS.sol (not immediatly obvious how to do this)
    • ipfs fsc: 256k through stream to chunk
    • if data input > fixed chunk size, create links
    • find max length data the contract can handle as a chunk size
  • create a method for concatenation of the links protobuf hex

These are just quick thoughts but I would love to take a stab a PR on this if we hammer this out a bit more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions