ipfs / ipfs/kubo

Limited support for `--mhlen` in high level commands like `ipfs add`

Open
#10,831 6 comments 0 reactions 0 assignees View on GitHub
effort/days exp/intermediate kind/feature P3
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

### Checklist

- [x] My issue is specific & actionable.
- [x] I am not suggesting a protocol enhancement.
- [x] I have searched on the [issue tracker](https://github.com/ipfs/kubo/issues?q=is%3Aissue) for my issue.

### Description

Currently I can't define the multihash prefix which is ``.
See: https://multiformats.io/multihash/#the-multihash-format
I can define the `` for all the commands listed below, but I cannot specify the `` to use:
`ipfs add`
`ipfs cid format`
`ipfs dag put`
`ipfs files chcid`
`ipfs files mkdir`
`ipfs files write`

This is the only command where I can define the full multihash prefix.
`ipfs block put` (available with `--mhtype` and `--mhlen`)

Example / Motivation:
The XRP Ledger uses SHA512Half hash for all Objects, transactions, ledgers, ...
See: https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes
SHA512Half has the same security level like SHA2-256 but it's much faster.

SHA512Half according multiformat:
``: SHA2-512 (code in hex: `0x13`)
``: 32 (code in hex `0x20`)
That means the multiformat prefix is `1320`.

I want to store some transaction hashes and ObjectID hashes on ipfs with the same multiformat, but this is currently not possible because the `` is missing for many commands.

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.