This is an initial patch and proposal towards decentralizing substitute
distribution with ERIS.
ERIS (Encoding for Robust Immutable Storage)  is an encoding of content into
uniformly sized, encryped and content-addressed blocks. The original content
can be reconstructed only with access to a read capability, which can be
encoded as an URN.
One key advantage of ERIS is that the encoding is protocol agnostic. Any
protocol that can transfer small (32KiB) sized blocks referenced by the hash of
their content will do. This can be done with things such as GNUNet, IPFS,
OpenDHT, HTTP or a USB stick on a bicycle.
The following patch allows substitutes to be published over IPFS using ERIS.
This is inspired and very similar to previous work on distributing substitutes
over IPFS .
The narinfos served by `guix publish` look like this:
Toggle snippet (16 lines)
References: 2fk1gz2s7ppdicynscra9b19byrrr866-glibc-2.33 81bdcd5x4v50i28h98bfkvvkx9cky63w-hello-2.10 90lbavffg0csrf208nw0ayj1bz5knl47-gcc-10.3.0-lib
For every compressed nar the ERIS URN is computed and added.
If the `--ipfs` is used for `guix publish` then the encoded blocks are also
uploaded to the IPFS daemon. The nar could then be retrieved from anywhere like
Toggle snippet (8 lines)
(eris blocks ipfs))
These patches do not yet retrieve content from IPFS (TODO). But in principle,
anybody connected to IPFS can get the nar with the ERIS URN. This could be used
to reduce load on substitute server as they would only need to publish the ERIS
URN directly - substitutes could be delivered much more peer-to-peer.
Other transports that I have been looking in to and am pretty sure will work
include: HTTP (with RFC 2169 ), GNUNet, OpenDHT. This is, imho, the
advantage of ERIS over IPFS directly or GNUNet directly. The encoding and
identifiers (URN) are abstracted away from specific transports (and also
applications). ERIS is almost exactly the same encoding as used in GNUNet
Blocks can be stored in any kind of databases (see for example the GDBM
A tricky things is figuring out how to multiplex all these different
transports and storages...
The ERIS specification is still considered "experimental". However we feel
confident to stabilize it and intend to do so around February/March 2022 with a
release 1.0.0 of the specification. This will ensure that the identifiers
remain stable for the forseeable future (until the crypto breaks). Before that
there is also a small external security audit of the specification planned
(thanks to NGI0/NLnet!).
This is just a little demo of the idea and some food for thought and
discussion. Give it a try and let me know what you think!
I've also pushed the patches to my personal Guix mirror if you want to check it
out from there:
Also CCing ~email@example.com where there is some general ERIS
publish: Add ERIS URN to narinfo
WIP: gnu: guile-eris: Update to unreleased git version.
publish: Add IPFS support.
configure.ac | 5 ++
gnu/packages/guile-xyz.scm | 10 ++--
gnu/packages/package-management.scm | 1 +
guix/narinfo.scm | 10 ++--
guix/scripts/publish.scm | 79 ++++++++++++++++++++++-------
5 files changed, 79 insertions(+), 26 deletions(-)