Multiple hash single file

say I have a single music file that I’d like to give 100 people rights to,
is there a way to upload that single file and receive 100 different hashes?

So far my solution is to use --chunker as such:

ipfs add --chunker=size-1024 file.mp4
ipfs add --chunker=size-1025 file.mp4
..
ipfs add --chunker=size-1124 file.mp4

Is this the only way to do this?

You could also put the file in a directory along with a unique file. The directory will have a unique hash (although the file will always have the same hash).

If you want every chunk of the file to have a different hash, you’ll need to either do what you’re doing there or, even better, just encrypt the file to each recipient.

Thanks for that - How would one encrypt the file? Could you direct me to some documentation?

IPFS does not have any built-in support for file encryption (yet).

What do you mean by “give rights to”?

Ive been reading about NFT music, where people are given the right to use their music without copyright infringement - I am assuming that they implement this 1 single file multiple hashes concept… but I am not entirely sure.

There’s no reason you’d need multiple hashes for what you’re doing. You could give out multiple NFTs, indicating that multiple parties have “licenses” to use the content. Of course, this won’t actually enforce anything but it will let people prove that they are licensed to “have” the content.

You’d only need a unique hash if you’re trying to sell unique “ownership” of the content (not license it to multiple parties). In that case, you’d have a unique hash by definition.

So if I were to create 100 licenses, I’d upload the song once, include the unique IPFS hash for that in the metadata, and in addition differentiate the 100 licenses in the NFT metadata e.g. an index between 0-100. So when someone purchases the license, they receive a metadata pointing to the same IPFS hash but different indices. Is that right?

Label 721
{
   POLICYID_HASH: {
      SONG_NAME: {
         song: "ipfs://IPFS_HASH",
         name: "song_name",
         index: "LICENSE_INDEX"
      }
   }
}