D2.1 -- MVP Alpha (DROMEDAR)

We are very happy to announce an initial alpha release of ocaml-dmc. ocaml-dmc is an OCaml implementation of the DMC specification that we previously presented.

Introduction

As part of DREAM we are researching and developing data models that enable peer-to-peer group collaboration.

We believe that to enable decentralized and collective control over information new data models need to be researched and developed.

Based on our previous work we have implemented an OCaml library and a command-line interface tool that can be used to collectively manage a collection of data.

Implementation

dmc-logo_64x64

An alpha version of ocaml-dmc is available in the Git repository: 0.1.0-alpha.

The implementation consists of a OCaml library and a Unix command-line-interface that can be used to to experiment with DMC containers from the comfort of your Unix shell.

Try it

You can try the DMC implementation in a suitable development environment by using Guix. Please see the repository README for detailed instructions.

Highlights

Irmin

Our DMC implementation uses the Irmin database. This allows the implementation to be portable and usable on many platforms that have working Irmin backends. This includes MirageOS, Web (via irmin-indexeddb) and Unix.

Irmin also provides distribution and synchronization functionality and allows direct implementation of CRDTs. We, however, do not use those functionalities of Irmin. We use Irmin as a portable key-value store. We do not rely on Irmin specific implementation details and allow other compatible implementations that are written in other languages and do not Irmin

Datalog

The DMC specification defines the computation of container state as Datalog programs. These rules (which are the core of the container logic) are used almost verbatim in the ocaml-dmc implementation (src/dmc/dmc.ml · main · DREAM / DROMEDAR / ocaml-dmc · GitLab). ocaml-dmc includes a Datalog engine that computes the specification.

The Datalog engine can also be used for rich and interesting application level queries on data in DMC containers as well as for logical inference. We hope to explore and demonstrate this more clearly in future work.

ocaml-rdf

DMC uses RDF as underlying data model. The data model is very simple, well-adapted for distributed systems, allows the re-use of many existing vocabularies and ontologies and allows a high-level of compatibility with existing RDF systems (e.g. ActivityPub).

For this Alpha release we have developed an OCaml RDF library (DREAM / DROMEDAR / ocaml-rdf · GitLab). This RDF library includes basic RDF types and datastructures as well as support for the RDF/JSON and RDF/Turtle serialization formats.

ocaml-eris

DMC uses the Encoding for Robust Immutable Storage (ERIS) for transport-optimized content-addressing.

As part of the Alpha release we have developed an OCaml implementation of ERIS (DREAM / DROMEDAR / ocaml-eris · GitLab)

Outlook

Much work is still required to make the work practically usable and this is what we intend to work towards in the next months.

Transports

Currently the implementation allows writing and loading container state to/from CBOR. This allows out-of-band transport and synchronization of containers (e.g. as attachment to an e-mail).

Further work is required to research and develop more efficient and in-built means of transporting and synchronizing container state across networks.

Delegated Authorization

The implementation allows authorizing additional keys to mutate containers. We believe that this is a core functionality that allows collective control over data.

However, currently it is not yet possible to revoke the authorization from a public key. Further work is required to document and implement a revocation system.

Registers

This alpha implementation only implements the Set container (allowing multiple elements to be member of a container). This is already very useful for many applications and can be used to implement things like a map.

The DMC specification also defines a register that holds a single value. This is currently not yet implemented in our OCaml implementation. More work is required to overcome some technical limitations (representation of Literals in the RDF library and aggregation in the Datalog engine) to implement registers.

Queries and inference

Our DMC implementation contains a Datalog engine which is used to compute container state. Datalog is also capable of evaluating complex application-level queries as well as doing logical inference on data.You can get a small glimpse of the possibilities by starting up the Datalog REPL builtin to the CLI tool (see README.md · main · DREAM / DROMEDAR / ocaml-dmc · GitLab).

We believe that this is a key functionality of DMC and our implementation. Further work is required to highlight and demonstrate this functionality.

Thank you!

We welcome feedback and criticism! Our forum is open for friendly cooperation among #dream-catchers. Do not hesitate to contact us and contribute to the code: our research is made to improve the digital commons.

@pukkamustard I’ll let you describe the tasks or link the repositories when they’re ready (I linked to the repo list for DROMEDAR).

When you think the topic is ready you can publish the shared draft and then add the d21 tag.

1 Like

We’ve been showing @spacekookie the DMC specs and she seems enthusiastic about it. We’ll be looking further into it and how it could be useful to various transports.

I see there’s still a lot of TODOs in the first post. Maybe you’d like to synchronize a bit and give a pass together @pukkamustard.

1 Like

Just gave it another pass. Feedback very welcome.

Remaining todos:

  • Tag and release ocaml-dmc
  • publish top post.

I made a couple of editions to the first post:

  • Change link to ‘our previous work’ to match the published page instead of the discussion
  • Add DMC logo linking to ocaml-dmc repository
  • Adjust titles of ocaml-rdf, Datalog, and ocaml-eris to be under Highlights
  • Add link to DMC spec for register
  • Add Thank you section at the end

Note: the tag link should be https://gitlab.com/public.dream/dromedar/ocaml-dmc/-/tree/$alpha with $alpha explicitly mentioning the word ‘alpha’ so there’s no ambiguity. Further releases should keep this -alpha suffix until beta. An alternative would be to ‘move’ an alpha tag along but that means it would shift commits and this can become confusing. What do you think?

1 Like

I would move the ‘Try it’ section under ‘Implementation’, before the ‘Highlights’ since it’s small and useful at this point for people looking forward to get their hands into it.

1 Like

Perfect. Thanks!

I would use the tag 0.1.0-alpha for the initial release tomorrow ($alpha = 0.1.0-alpha). I think that is clear enough?

I think moving tags would be very confusing. But keeping the -alpha suffix until beta sounds good to me.

1 Like

D2.1 is completed. :tada:

1 Like

Congratulations! Let’s celebrate! :partying_face:

Many congratulations @arie @nemael @pukkamustard on the amazing work.

Incredible, congratulations!