Implements multiformats specification.
Implments the multiformats specification used in IPFS and other distributed systems.
mfmts
This project contains my implementation of the multiformats specifiation split across several individual libraries.
mfmts-multibase - Multibase BaseSystems encoding + decoding
Implements encoders and decoders for numeric basesytems and mutliformats specification for multibase prefix encoded strings.
References:
- Multibase GitHub - https://github.com/multiformats/multibase
mfmts-varints - Unsigned VarInts
Provides parsing and serialization for multiformats unsigned binary varints.
References:
- Varint GitHub - https://github.com/multiformats/unsigned-varint
mfmts-multicodec - Magic Number specifications
Provides lookup table and query functions for codecs defined from multiformats multicodec. These are magic numbers that represent certain data encoded within CIDs, mulithash and other related projects. This module uses a python script to generate haskell code from the freshest table.csv on multicodec's GitHub.
References:
- Multicodec GitHub - https://github.com/multiformats/multicodec
- Multicodec Table CSV - https://github.com/multiformats/multicodec/blob/master/table.csv
mfmts-multihash - Multicodec hash function identifiers
Provides a lookup table for hash functions in the mfmts-codec table and validates they have an implementation backend. This module is also used to verify the Multihash's Multicodec as part of decoding ContentIDs.
References:
- Multihash GitHub - https://github.com/multiformats/multihash
- Go implementation - https://github.com/multiformats/go-multihash/blob/master/multihash.go
mfmts-cid - CID/ContentID
Provides Parsing (from String), Extracting (from ByteString) and Serialization (to ByteString) for ContentIDs/CIDs.
References:
- CID GitHub - https://github.com/multiformats/cid
- Go implementation - https://github.com/ipfs/go-cid
Unit testing
Some modules in this directory have unit tests that are generated within the python folder as JSON formats. Code for unit tests sets are found at the main ipfshs repo.
Reporting bugs
Report bugs to the ipfshs ticket tracker. Please include a detailed description of your issue and steps or inputs to reproduce it.
Licensing
The mfmts project and its modules are free software and licensed under the AGPLv3 license. See LICENSE.txt.
Copyright (C) 2026 Zoey McBride )