Skip to content

Instantly share code, notes, and snippets.

@cory2067
Last active May 17, 2019 02:41
Show Gist options
  • Save cory2067/fad3af928c7df4785cbee46ad0ea3c50 to your computer and use it in GitHub Desktop.
Save cory2067/fad3af928c7df4785cbee46ad0ea3c50 to your computer and use it in GitHub Desktop.
Solid Aggregation Service

Solid Aggregation Service

The Solid Aggregation Service allows for the computation of aggregate values over many user pods. Researchers can submit an aggregation request to the system (e.g. "what is the average age of ..."). Users can then submit encrypted values (e.g. their age, their height) to studies via an online interface. A third party computes an aggregate, but through the use of homomorphic encryption, learns nothing about the users' data (not even the aggregate result). Finally, the researcher will be given an encrypted aggregate result that only they can decrypt, without learning anything else about the users.


The Solid Aggregation Service is comprised of three main repositories:

system diagram

General Workflow

  • Users visit the deployed cory2067/node-solid-server, register for a pod, and upload some private .ttl files.
  • Researcher visits the solid-aggregator web interface (or uses the solid-researcher CLI) and registers a new study
  • Users visit the solid-aggregator web interface, and consent to studies, inputting URIs of files they permit the aggregator to extract data from.
  • Researcher uses solid-researcher CLI to request an aggregate, and receives an encrypted result can be decrypted by the researcher's private key.

Homomorphic Encryption

To enable the use of homomorphic encryption, these programs use Microsoft's SEAL library. Since SEAL runs in C++, but the Solid Aggregation code is written JavaScript, I created a (feature-incomplete) JavaScript wrapper, seal.js.

Try It

Current Limitations

  • Only integer values can be aggregated over.
  • When requesting average or ratio, the researcher can determine the number of users participating in the study
  • With very large number of participants, an aggregate result may overflow. To resolve this, the plaintext modulus used by SEAL must be manually increased.

Video Demonstration

Additional Info

Please visit the individual repos for additional documentation.

Cory Lynch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment