Hyperledger Iroha: Tokenization of Human body organs
The process of substituting a sensitive data with a non sensitive equivalent is Tokenization, this has several advantages such as Security, Safe transactions, Simplifying compliance, Improved trust among transactors etc. Here I make an effort to Tokenize Human body organs for easy management of transactions between donors and recipients. The code can be found on this Github link.
Hyperledger Iroha is a simple and easy to incorporate distributed ledger technology, it features a simple construction, modular, domain-driven C++ design, emphasis on client application development and a new, crash fault tolerant consensus algorithm, called YAC (Yet Another Consensus) which is a practical Byzantine fault tolerant consensus algorithm(Original paper).
Some of the Important differences between Fabric and Iroha:
1. Iroha framework does not enable smart contracts or any other form of a complex business logic.
2. Iroha has Role based access control, whereas Fabric user Access Control List
3. YAC is high-performance consensus algorithm and allows for finality of transactions with low latency
4. Unlike Fabric where peers polls for validation, Iroha applications interacts with peers in a simple client-server fashion
5. Fabric has Pluggable consensus which allows the platform to rely on CFT (crash fault-tolerant) or BFT (byzantine fault-tolerant)
HOW TO REPRODUCE THIS PROJECT LOCALLY
Prerequisites: Docker Engine, Python 3, Flask, Iroha (pip3 install iroha).
Clone the Repo:
git clone https://github.com/rietesh/Organ-Donation-IROHA.gitsudo bash quicksetup.sh
This Script will pull latest Iroha and Postgres images and creates the required network and persistent volume store and runs both the containers in the detached mode (Guide).
You can check the running containers with “ docker ps ” command, if Iroha container isn’t running:
docker rm irohadocker run --name iroha -d -p 50051:50051
-v $(pwd)/myconfig:/opt/iroha_data -v blockstore:/tmp/block_store --network=iroha-network -e KEY='node0' hyperledger/iroha:latest
The Iroha network is up and running you can test the network by opening a terminal in the Iroha container
docker exec -it iroha /bin/bash#Play with the iroha-cli:
iroha-cli --account_name admin@odwa
To completely remove the setup “ sudo bash teardown.sh ”
To run the flask web application
sudo python3 ./flaskapp/app.py
Navigate to http://localhost in your web browser and done you are ready.
Architecture
The architecture consists of Two domains “odwa” and “patient”, two set of roles “admin” and “patients”, Asset is the organ and it belongs to “organ” domain the genesis block looks like this:
Here I have created the assets and added created a user admin and added him to “odwa” domain and appended his role to admin. All my assets are created with precision zero which means that there is no decimal part, only integers.
I have given can_transfer, can_recieve permissions for patient domain so as to receive and transfer assets.
Workflow
I have summarized the workflow in the below diagram:
The app.py used for flask web app:
The most important file used to talk to iroha api using the iroha-python SDK is saved as iroha_sdk.py
A demo for the successful transaction with lungs as an asset:
This is a simple application that can be improved greatly so please if you have any suggestions, complaints, Queries or ways to improve this project ping me or leave a comment below Thank you for reading.