Eris_lwt
Encoding for Robust Immutable Storage (ERIS)
ERIS is an encoding of arbitrary content into a set of uniformly sized, encrypted and content-addressed blocks as well as a short identifier that can be encoded as an URN. The content can be reassembled from the blocks only with this identifier. The encoding is defined independent of any storage and transport layer or any specific application
ERIS uses two block sizes which must be specified when encoding content.
module Read_capability : sig ... end
A read capability contains the necessary information to decode some encoded content from blocks. A read capability can be encoded as a binary string or as an URN.
Type of a reference to a block. A reference to a block is the Blake2b-256 hash of the block.
Type of a block. Length of a block is either 1024 bytes (for block size `Small
) or 32678 bytes (for block size `Large
).
Inputs to the encoding process are:
The output is a read capability and a set of blocks.
The null convergence-secret (32 bytes of zeroes). This may be used if the known attacks against convergent encryption are well understood and the advantages of deterministic identifiers and de-duplication outweigh.
module Encoder : sig ... end
This module provides a streaming encoder that can be used to efficiently encode content piece-wise. The memory used is proportional to the level of the encoded content. The level is related logarithmicly to the size of the content.
val encode_string :
convergence_secret:string ->
block_size:block_size ->
string ->
(ref * block) list * Read_capability.t
encode_string ~convergence_secret ~block_size content
encodes content
using the provided convergence-secret and block size and returns a list of blocks as well as a read capability.
Content can be decoded given the read capability and access to blocks.
module Decoder : sig ... end
This module provides a random-access decoder that can be used to efficiently decode pieces of content at given positions.
val decode_string :
block_get:(ref -> block Lwt.t) ->
Read_capability.t ->
string Lwt.t
decode_string ~block_get read_capability
returns the entire decoded content as string.