An Ethereum smart-contract for creating a decentralized record service using the on chain currency. This project is part of Health Nexus, the public permissioned blockchain for healthcare.
Features:
- Create services by registering service urls
- Create and issue keys for services
- Permission keys for sharing, selling, and trading
- Share keys & services with multiple accounts
- Sell keys for on chain currency
- Trade keys
This smart-contract enables the registration of data services bound to unique endpoint urls. Registering a service creates an immutable record of that service and associated owner. Service owners can then create and issue keys for that service.
Keys are unique ownable records that can be used to verify the identity of valid service consumers though a process that requires authenticating messages signed by the key owner. Service owners can permission keys extending the functionality to enable trading, sharing, and the selling of keys using on chain currency.
To clone and use this smart contract, you'll need Git and Node.js (which comes with npm), Truffle, and a local development Ethereum node on your computer (Geth, Parity).
From your command line:
# Clone this repository
$ git clone https://github.com/Health-Nexus/drs.git
# Go into the repository
$ cd drs
# Install dependencies
$ npm install
# Compile contracts
$ truffle compile
# Deploy contracts
$ truffle migrate
Running the the test suite requires your dev node have two unlocked accounts provisioned with sufficient ether to pay the transaction costs. About TestRPC, the tests were not written for TestRPC which handles contract throws differently than geth or parity. This is a known issue.
From your command line:
# Run Test Suite
$ truffle test
This repository holds the code for the smart-contract portion of a three-part system consisting of:
- A smart-contract for maintaining decentralized records of trusted entities via issuable keys and auditable access logs.
- Decentralized application that uses this smart-contract for issuing and managing keys and storing related service data for those keys.
- An off-chain service that runs concurrently with an Ethereum node that uses signed transactions and keys to verify and route requests and log data access.
Health DRS is developed with the functionality to support many different dapp/services as most of the key functionality is permissioned. For example, selling, trading, and sharing of keys are all permissioned and left off by default allowing for a simple single-issuer application. In addition allowing the service to set arbitrary key data for each key enables the dapp to extend the provided functionality however needed.
For example, one could create keys with limited uses, or that expired at a specific time, or that required two-factor authentication.
For an overview of the smart-contract's functionality review the wiki. On day one, users will be able to access this programmatically or through the Mist Ethereum wallet. An open source server client and UI are also in the works.
This smart contract has been audited by Hosho Group.
"We are grateful to have been given the opportunity to work with the SimplyVitalHealth team on this project and audit. They have been very receptive to our feedback and were agreeable in correcting the small numbers of issues found.
During the initial static analysis, several possible vulnerabilities were noted, and the SVH team was very quick to patch these and return the updated code. They implemented the required fixes to ensure the long-term health and stability of the HealthDRS system as it works within the Ethereum ecosystem. It was also noted that there were some code paths that were not executable during dynamic testing and the SVH team corrected these to a functional state.
Even beyond the small issues found, the SVH team implemented some of our suggested improvements. We wish the SVH team well with the HealthDRS system going forwards."
Yo Sub Kwon, Founder Hosho Group
Read the complete audit report. Read the updated audit report.
Major dependencies:
Contributors:
- Lucas Hendren - lhendre
- David Akers - davidmichaelakers
- Kevin Cheli - kcheli
- Ninad P.Chaudhari - ninadpchaudhari