Blockchain application development

We build applications on Hyperledger Fabric, including the APIs and interfaces people use to record and verify transactions. In SwasthyaSetu, that means patient consent, prescriptions and pharmacy dispensing.

Decide what needs to be recorded

We start with the events participants need to verify: who gave permission, who issued a record and what happened next. We define who can submit each transaction and which checks must pass before it is accepted.

The ledger is one part of the application. Sign-in, document storage and user interfaces still need their own design. We decide where each responsibility belongs before writing the smart contracts.

SwasthyaSetu: consent and prescription history

Blockchain was part of the SwasthyaSetu brief. We used a permissioned Hyperledger Fabric network to record consent, consultation and prescription events. Smart contracts check permitted actions, and verification compares a record’s fingerprint with the one held on the ledger.

Consent to record a consultation and consent to share health data through ABDM serve different purposes. The integration keeps those permissions separate. A grant for one operation is not automatically permission for the other.

SwasthyaSetu is in development. It has progressed through two stages and received two rounds of funding under the Blockchain India Challenge, implemented by C-DAC with support from MeitY.

Explore this work ↗︎

Keep documents and ledger records separate

A document can be stored separately while its hash—a fingerprint of its contents—is recorded on the ledger. Comparing the hashes can reveal a change to the document.

Transaction history also needs review. Storing only a hash in the current ledger record does not keep a document private if its contents were included in the transaction itself. We examine what is submitted as well as what the application later displays.

Test the smart contracts and upgrades

SwasthyaSetu’s prescription tests cover partial dispensing, return visits and attempts to collect more than the prescribed quantity. They also check that records created under an older format can still be verified after an upgrade.

Integration checks exercise the API and ledger together: submit a transaction, read it back and verify it. Tests also check that missing or withdrawn consent is rejected and that retrying a request does not create a second transaction.