~z0/ipfshs

Haskell modules for the InterPlanetary Filesystem (IPFS)
b7d42ab8 — Zoey McBride 29 days ago
update readmes
c2ed6557 — Zoey McBride 29 days ago
add haskell.org link
023983b8 — Zoey McBride 30 days ago
update README lists

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~z0/ipfshs
read/write
git@git.sr.ht:~z0/ipfshs

You can also use your local clone with git send-email.

#ipfshs builds.sr.ht status

Welcome to ipfshs, this project is a work in progress of what strives to one day be a full stack implementation of the IPFS protocol written in Haskell.

The project is in still a relatively early state, but progress has been made in supporting components of the protocol. Currently, the ipfshs submodules implement the following features of IPFS:

#Multiformats:

A collection of protocols which aim to future-proof systems

  • Encoding and decoding digit strings to binary data with prefixes defined in multibase.
  • Parsing CIDs from multibase encoded strings, and extracting and serialization functions for CID binaries.
  • Verifying multicodec values.
  • Providing an interface for creating hash digests via multihash codec values.
  • Reading unsigned-varints values in binary data.
#InterPlanetary Linked Data:

Formats and data structures for building applications that can be fully decentralized

  • Sum-type of kinds/nodes forming an abstract data model.
  • Encoder and decoder type-classes which provide an interface with the option of implementing individual parsers by kind or in a single function.
  • A codec type-class which provides basic IO functionality and a way of specifying an encoder/decoder pairing.
  • Implements codec for DAG-CBOR.

#Submodules

#ipldm: IPLD data model specifications

Modules for working with the IPLD data model. It defines the IPLD kinds and provides codecs for reading and encoding formats such as DAG-CBOR.

#mfmts: Multiformats implementation

Provides implementation of multiformats: multicodec, mulithash, multibase, unsigned varints and content identifiers (CIDs).

#basesystems: Digit encodings

Implements encoders and decoders for strings of digits for basesystems: base64, base32, base58btc, base16, and more.

#xcodec: Generics for codec data

Type-class interfaces for building generic encoders and decoders for various binary data-types, with instances for the bytestring package.

#Development

All of the unit tests for all of the ipfshs libraries live in the testing directory. Python scripts are utilized to generate tests in bulk into JSON format. This repository holds the source for all the Python utility scripts, Haskell unit tests, and open source data required for the these tests. See the licensing section for more information.

The pages linked above in submodules are also included as git submodules each tracking the main branch via CI builds. Since the libraries are included as submodules and continuously updated, the entire source tree for IPFS can be downloaded with a few git commands, and then a branch can either be created or selected for each initialized submodule:

$ git clone https://git.sr.ht/~z0/ipfshs
$ cd ipfshs
$ git submodule update --init --recursive

Here is an example of initializing ipldm for local git development:

$ cd ipfshs/ipldm
$ git checkout main # follow the main branch at the current hash
$ git pull # and pull any new changes
$ git branch localdev # also make our own branch
$ git checkout localdev # and make changes there instead

The project can now be built and unit tested using these commands in the cloned ipfshs directory:

$ cabal build all
$ cd testing
$ cabal test all

Bugs can be reported via the ticket tracker and patches can be submitted with git send-email within the module's directory.

#Licensing

Each submodule comes with its own LICENSE.txt when used by itself. The ipfshs project, and the compilation provided in this repository, are licensed under the terms of the AGPLv3, included in this repository's LICENSE.txt.

This project uses open source data and scripts for unit testing and to generate library code. The copyright information, licensing terms, and how each project is used within ipfshs can be found in CREDITS.md.

Copyright © 2026 Zoey McBride | zoeymcbride@mailbox.org