DDX-project 
Tags: database, blockchain, opensource, javascript
Published: 2020-11-28 17:04:18

## Introductions
DDX stands for Distribute Database of Anything. It is an experimental project that uses the [Open Index Protocol (OIP)](openindexprotocol.com) to read and write the metadata of real-world records to the [FLO blockchain](flo.cash).

The major goal is to build a truly public digital space on the internet that is affordable, secure, and accessible.

It is in its infancy but also under heavy development by the [Jensen Lab at Caltech](jensenlab.caltech.edu) and [Alexandria Labs](https://www.alexandrialabs.com).

## Definitions
Let's chat about some of the jargons we will use for herein:

### Records
We call **records** any metadata of a real-world data or _thing_. For example, if you have a cat, then you can make a `record` of your cat. For example:
```json
{
  name: "Sophie",
  description: "Short hair, indoor",
  dataOfBirth: 2012
}
```

that is what we call a _record of Sophie as a cat_ in the OIP context. It is the metadata about Sophie.


### Record Templates
As in most projects aiming to become a repository of data, DDX has a way to organize information. We call it **record templates**. These record templates are basically the metadata schema of a particular type of data. For example, a schema for records of the type `cat` would be:
```json
{
  name: "string",
  description: "string",
  dateOfBirth: "date"
}
```

It basically defines the fields of the records of type `cat` and explains what type of data should be in it.

### Open Index Protocol (OIP)
<img src="https://dev-to-uploads.s3.amazonaws.com/i/h8lhjy14a55cvt799ory.jpe" alt="oip logo" width="20%"/>

The ideas of `records` and `record templates` are the building blocks of DDX. In the DDX ecosystem, this information is stored in the FLO blockchain using the Open Index Protocol.

The OIP defines how we write `records` and `record templates` to the blockchain. It also refines how we read them.

In another post we will go through it in more detail, but for now, OIP uses a mix of encoders (including Google's [protobuf](https://developers.google.com/protocol-buffers/) to serialize data and add to the FLO blockchain.

This task of adding information to the blockchain is facilitated by the FLO data field called `floData`.

<img src="https://dev-to-uploads.s3.amazonaws.com/i/wgnawfo4yxik4rpak679.jpeg" alt="flo logo" width="20%"/>

> The FLO blockchain is a OG blockchain launched in 2013 with no ICO, no pre-mining and remains active to this day.

<img src="https://dev-to-uploads.s3.amazonaws.com/i/6c16b3slefa3x0f09854.png" alt="alexandria logo" width="40%"/>

The Alexandria Labs built a daemon that monitor the FLO blockchain for transactions with `floData` that follows the OIP standards and dynamically builds an [ElasticSearch](elastic.co) instance with the records according to the record templates it finds.

<img src="https://dev-to-uploads.s3.amazonaws.com/i/2afmqemq9ng3ue8n55z4.png" alt="alexandria logo" width="33%"/>

The daemon also exposes a REST API so the content of the database can be easily searchable.

The Alexandria team keep a public instance of this REST API at [api.oip.io](api.oip.io)

And documentation on how to query it can be found here:
https://github.com/oipwg/oip/blob/master/api.md

## DDX and OIP

Now that we defined the basics, let's wrap it up.

Think of DDX as a database of anything and each `record template` as the schema of a table in this database.

If we want to add a new "table" on DDX, all we need to do is to follow these 3 simple steps:

1- Define a schema
2- Encode following the Open Index Protocol standard
3- Broadcast it to the FLO blockchain

To add a record in this new table all we need to do is to follow another 3 simple steps:

1- Build a record with the metadata according the schema defined by the template
2- Encode it following the Open Index Protocol standards
3- Broadcast it to the FLO blockchain

We are working on supporting software to facilitate these steps and how to perform them will be the subject of the next posts.

Some of the code can be found here:
[OIP](https://github.com/oipwg/)

## DDX-gateways

We are also working on a series of gateways to facilitate the interaction of humans and this data: the DDX-gateways. They are client-side static react apps that use public API to read and **write** data on the blockchain.

There are two of them online now:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/g75nahx9syz6rppsy7bs.png)
[DD-People](people.ddx.rocks)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/oh9kqm1g0popbm0zzt4y.png)
[DD-Organizations](org.ddx.rocks)


## Final remarks

This was a very brief kick-off overview of the DDX-project and how it leverages the OIP and FLO blockchain to build a persistent, truly public, digital space on the Internet.

Stay tuned for the next posts! 

☀️ + ⚜️ = 🚀🚀🚀