https://github.com/crim-ca/blockchain
Explore extensions and applicability of Blockchain technology to guarantee integrity and traceability of private data.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.1%) to scientific vocabulary
Keywords
Repository
Explore extensions and applicability of Blockchain technology to guarantee integrity and traceability of private data.
Basic Info
Statistics
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 4
- Releases: 0
Topics
Metadata Files
README.md
User-Data Consents Management Blockchain
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
Blockchain 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.
Installation
- Make sure Python 3.6+ is installed.
- Install the dependencies in your preferred virtual environment manager (
pipenv,conda, etc.)
shell
pip install -e <blockchain-repo-root>
Generate one or more blockchains:
shell python blockchain/app.py --port 5002 --db file://<custom-directory> --newRun one or more server nodes:
shell 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.
shell
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:
http request
GET localhost:<port>/
OpenAPI description:
http request
GET localhost:<port>/api
- Refer to usage help for further customization options:
shell python blockchain/app.py --help
Docker
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
shell
docker build -t blockchain:2.0.1 .
- Run the container
shell
docker run --rm -p 80:5000 blockchain:2.0.1 <blockchain-parameters>
- To add more instances, vary the public port number before the colon:
shell
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>
Citation
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.
bibtex
@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.
License
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.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Resources
Following are the reference resources and source code employed to start development of this project.
Owner
- Name: crim-ca
- Login: crim-ca
- Kind: organization
- Repositories: 79
- Profile: https://github.com/crim-ca
GitHub Events
Total
Last Year
Dependencies
- fastapi *
- fastapi-mako *
- importlib-metadata *
- pydantic *
- python-dateutil *
- python-magic *
- pyyaml *
- requests *
- requests_toolbelt *
- uvicorn *
- webargs *
- python 3.9-slim build