ipfs / ipfs/kubo

Ability to specify known hash when adding

Open
#1,957 1 comment 0 reactions 0 assignees View on GitHub
help wanted kind/enhancement
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

`ipfs add` should have an option that lets the user specify a hash that is known ahead of time. Then when IPFS computes the hash, if they don't match, adding should fail with an error.

This defends against corruption during adding, or lets the user detect that the file was corrupted before it was added at all (for example, a truncated download).

In theory this can also be an optimization, where if the IPFS repo already has a file with the given hash, the file doesn't need to be hashed or added at all.

This depends on the user being able to compute the hash in advance. If the file came from IPFS, then that's not a problem. Otherwise, applications need to be able to compute IPFS hashes for themselves (see #1953).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.