User consents management using Blockchain technology to guarantee integrity and traceability of private data.
Confluence Page: MODL - EvalBlockchain
Évaluer l’utilisation de la technologie blockchain pour garantir l’intégrité et la traçabilité des données privées.
Table of Contents
The blockchains are intended to contain tracking of Consent changes and resolution. Each blockchain UUID (multiple chains per nodes) represent a potential distinct user for management their Consents.
Starting with version 2.0.1, Consent Subsystems metadata can also be stored in the blockchains to better represented the consented data, and maintain references to any applicable data provider, data source or other policies using customizable metadata.
Following is a visual representation of such Consents using UI endpoints.
Similar details can be retrieved from the API endpoints, as well as further operations on the blockchains and nodes for which process consensus resolution must be executed against in a network of blockchain nodes.
The Consents are generated with a set of demonstration Actions, which can be extended as needed by modifying the
ConsentsAction
enumeration.
Please refer to Updating Consents section for more details regarding applicable consents metadata that can be pushed to a blockchain.
- Make sure Python 3.6+ is installed.
- Install the dependencies in your preferred virtual environment manager (
pipenv
,conda
, etc.)
pip install -e <blockchain-repo-root>
- Generate one or more blockchains:
python blockchain/app.py --port 5002 --db file://<custom-directory> --new
- Run one or more server nodes:
python blockchain/app.py -s secret -p 5001 --db file://<custom-directory> # loads all "<blockchain-id>/chain.json" in directory
python blockchain/app.py -s secret -p 5002 --db file://<custom-directory>/<id>/chain.json # loads only that blockchain
python blockchain/app.py -s secret -p 5003 --db file://<custom-directory>/chains.txt # loads only listed blockchains IDs
python blockchain/app.py -s secret --port 5004 --db <db-impl>://<db-connector> # use an alternate database implementation
When running server nodes, any predefined set of nodes within a shared network should be provided directly
with the --nodes='<node1-url>,<node2-url>,...'
option to allow consensus resolution between nodes.
Otherwise, nodes can be registered after startup using the relevant API endpoints.
When running the above commands to start a server node, uvicorn
ASGI runner is automatically called to serve the
Web Application. Any additional parameters supported by uvicorn
can be specified on the command line.
For example, timeout controls and workers can be configured as follows.
python blockchain/app.py \
--db "file://<custom-directory>" \
--secret 'blockchain-1' \
-N "0.0.0.0:5002" -N "0.0.0.0:5003" -N "0.0.0.0:5004" \
--host "0.0.0.0" \
--port 5001 \
--workers 20 \
--timeout-keep-alive 10
The CLI will automatically handle and redirect relevant parameters for the blockchain and the ASGI runner respectively.
- Once started, refer to the following endpoints for OpenAPI requests and details:
Details about the current blockchain node:
GET localhost:<port>/
OpenAPI description:
GET localhost:<port>/api
- Refer to usage help for further customization options:
python blockchain/app.py --help
Another option for running this blockchain program is to use Docker.
Follow the instructions below to create a local Docker container:
- Clone this repository
- Build the docker container
docker build -t blockchain:2.0.1 .
- Run the container
docker run --rm -p 80:5000 blockchain:2.0.1 <blockchain-parameters>
- To add more instances, vary the public port number before the colon:
docker run --rm -p "81:5000" blockchain:2.0.1 <blockchain-parameters>
docker run --rm -p "82:5000" blockchain:2.0.1 <blockchain-parameters>
docker run --rm -p "83:5000" blockchain:2.0.1 <blockchain-parameters>
Versions 1.1.0 and prior providing the initial Consents multi-blockchain application correspond to the following publication:
Darine Ameyed, Fehmi Jaafar, Francis Charette-Migneault, and Mohamed Cheriet. " Blockchain Based Model for Consent Management and Data Transparency Assurance." In 2021 IEEE 21th International Conference on Software Quality, Reliability and Security Companion (QRS-C). IEEE, 2019.
@article{ Ameyed2021QRS,
title={Blockchain Based Model for Consent Management and Data Transparency Assurance},
author={Ameyed, Darine and Jaafar, Fehmi and Charette-Migneault, Francis and Cheriet, Mohamed},
journal={2021 IEEE 21th International Conference on Software Quality, Reliability and Security Companion (QRS-C)},
year={2021}
}
Version 2.0.1 and any following minor releases correspond to the extension of the previous work with Consents Subsystems. This is associated with the following publication.
This work is licensed under MIT License.
The original implementation is based on dvf/blockchain with the following MIT License. See its corresponding README for more details.
Contributions are welcome! Please feel free to submit a Pull Request.
Following are the reference resources and source code employed to start development of this project.