More than 700 million people, or 11% of the world population, still live in extreme poverty and are struggling to fulfil the most basic needs such as education or health. Access to good health and well-being is a human right, and that is why Avicenna offers a new chance to ensure that everyone can access the highest standards of health and health care—not just the wealthiest.

Avicenna provides an inexpensive distributed technology which is able to aid in patients´ diagnoses, based on their complete medical history. Medical records can also be created and/or modified in order to provide the medical staff with the most updated information. Avicenna offers a unique certification system to ensure each medical record is authentic, immutable and unhackable.

Different from other Electronic Healthcare Records (EHR), Avicenna uses a hybrid mechanism which is able to work in communities with low technology or without internet access. A typical patient’s medical record usually encompasses hundreds of pages and might even run into the thousands in the most extreme cases. Healthcare settings using Avicenna are able to generate a modular passport for patients or legal guardians which includes their identity, their medical record and their prescriptions in a single unhackable document developed by smart contracts and distributed technology.


  1. Avicenna assumes that at least the medical staff have access to a minimum technology infrastructure: smartphones or computers with a WebLN provider such as Lightning Joule; an IPFS private network which allows the offline interoperability among health-care facilities; an IPFS node that provides the immutability data protections of patient encrypted data and, proactive staff to be instructed about how to use Avicenna.
  2. Patients or legal guardians do not need any computer skills as Avicenna is designed by core to survive in the most reduced infrastructural environments. So as to provide poor communities with access to the highest standards of health and health care using a p2p network using IPFS, Bitcoin to sign and verify digital signatures and Lightning Network to use bitcoin as a means of payment for certification purposes.

Medical Passport Modules


Avicenna passport provides an identity module where patients or legal guardians can have access to a self-sovereign identity built on top of the Bitcoin chain.

Medical Record

Avicenna passport grants accurate, updated and complete information about patients or legal guardians at healthcare settings.

Medical Prescription

Avicenna passport contains a health-care program implemented by a physician or any other qualified practitioner in the form of detailed instructions that govern the plan of care for an individual patient.

Certification of Authenticity

Avicenna passport produces a provable certification of the patient's data using on a hybrid system based on the Blockstream Satellite and Open Time Stamps.

Your keys, Your bitcoin

Avicenna is designed by core to allow the health-care facilities to have the full control of their private keys. In the ‘.env’ file the user can add their node details (‘GRPC Endpoint’, ‘macaroon’ and ‘TLS certificate’) when deploying Avicenna. In case of not having a bitcoin and lightning full node, you can still use Avicenna through Open Node.

Qualified health-care practitioner signature

Avicenna passport includes a signature provided by a qualified practitioner that can be proven using the Bitcoin Public Ledger through the passport validation guidelines.

Health-care donation page

Non-custodial feature that allows health-care facilities to receive donations using the invoice macaroon. Like tippin.me, but with a non-custodial option.


Flow-chart Diagram

Only qualified health-care practitioners added by the health-care administrators who have deployed Aviccena in their facility are able to log in. This enables a closed network where only professional medical staff are added from inside. When a doctor is issuing an Avicenna medical passport is required that the patient inputs a password to encrypt his/her data.

This creates an interesting ethical data behaviour because only qualified health-care practitioners are able to generate passports for patients but only patients are able to unencrypt it to access and read their medical health records. This allows patients or legal guardians to be the real owners of their data. However, patients can physically decide to store their private keys to unencrypt their health records at their clinics, becoming the clinics the custodians of their patient's data if patients decide it. code2flow_AYbo4W

UML Sequence Diagram

Avicenna is divided into 3 different layers:

Layer 1 | User Experience (UX) Layer

This layer is at the application level to create an intuitive user experience from the web browser. This layer is based on simplicity and designed to have full functionalities even on a smartphone device.

Layer 2 | Immutability Layer

This layer is at the protocol-stack level of the IPFS network. It requires to (a) have an IPFS node or (b) IPFS API access (such as Infura.io) to secure the immutability of the data through Kademlia tools, hashing mechanics and data gateways. This layer is in charge to secure the patient's data integrity and provide an offline network.

Layer 3 | Certification Layer

This layer is at the application-stack level of a hybrid system based on using the Satellite API provided by Blockstream or open time stamps. It requires to query the Blockstream satellite API through the Layer 1 (UX Layer) to upload the hashed data of the IPFS node to the satellite paying with lightning. This layer is in charge to store the proof of immutability (IPFS hash) from the patient medical passport into the Blockstream satellite.


Tech Stack

Avicenna uses and bitcoin distributed infrastructure for security, accountability and connectivity. The tech stack contains:

  • IPFS - for distributed p2p file sharing and encrypting
  • Lightning Network - for tips and micro-payments
  • Blockstream Satellite - for data integrity certification
  • Open Time Stamps - for data integrity certification
  • MySQL - for relative data management
  • Pdfkit - for PDF document generation
  • Axios - for backend http requests
  • LN-service - for non-custodial lightning management
  • Open Node - For custodial lightning management
  • Sudo-js - for system management (Self-destruct sensitive data from the system)
  • WebLN - for client bitcoin management (digital signatures)

Gettings Started

  1. Clone the repository: sudo git clone https://github.com/whiteyhat/Avicenna
  2. Install the dependencies: npm i
  3. Create a .env with the contents from the .env.example file
  4. Customize your enviromental variables in the file .env
  5. Run the DB migrations to your local database js adonis migration:run
  6. Run the DB seeder to your local database js npm run db
  7. Start the web app: npm start

Project Wiki

Hey! There is a fruitful wiki with more details about the problem we are solving, deployment instructions and additional information.

Enjoy a video about the development of Avicenna

![YouTube Git Video]video avicenna)

Deploy Avicenna in your health-care facility

Built With

Share this project: