Tezos is a decentralized, open-source blockchain network that can execute peer-to-peer transactions and serve as a platform for deploying smart contracts.
CoviDapp was our first try to develop a blockchain-based corruptionless distribution for COVID-19 vaccines. The features of this Dapp are:
- Distribution of vaccines can be done in the systematic top to bottom approach.
- Hospitals/States with emergency cases/surge in cases can send in requests for more vaccines directly to the higher authority, and their request will be in priority of the higher officials, i.e., hospital requests are a higher priority for State Government Officials.
- As we all know, in a blockchain, every transaction is tracked, so all the vaccines that enter the chain through the central government are tracked all the way down to the hospitals receiving it, hence no chances of corruption in between the authorities.
- All the transactions for a specific hash address can be seen available publicly to everyone, to make the taxpayers see where their tax is being invested.
Let’s get to the building part!
- Our first step would be to install the Thanos Wallet extension. You can get that from here.
- Once installed, create a new Wallet.
- For future use purposes, take the backup of your seed phrase and then continue.
- Now go to Tezos faucet to get a Testnet account for testing the Dapp with Thanos wallet and download the JSON file.
- Select import account and upload the Faucet file.
After the confirmation, you will receive some amount of XTZ in Delphi Testnet account.
Now we are ready to build the CoviDapp!
For building a Dapp we first need smart contracts. Smart contracts help in designing custom protocols for the transactions. Tezos smart contracts are based on Michelson Language and for a beginner, it will be really difficult to get started with it. So, to overcome this problem SmartPy is there which is a Python-based library specifically developed to design Michelson contracts. It has good documentation. Also, SmartPy comes with a web-based IDE so you don’t have to install anything in the local system. Since we are designing a COVID-19 distribution system we will need to develop three different contracts, one for Central Government, one for State Government & one for Hospital.
All the codes are available in my CoviDapp GitHub Repository.
There will be three main entry points in the contract,
- For storing the requests from the State Government, this entrypoint will be triggered by the State Government.
- For changing the vaccine count.
- For transferring the vaccine, this entrypoint will trigger another entrypoint in the State Government’s contract which will update the vaccine count available with the State Government automatically.
In the State Government’s contract, there will be four main entrypoints,
- For updating the vaccine count. This will be triggered by the Central Government.
- For requesting the vaccines from the Central Government, this entrypoint will trigger another entrypoint in the Central Government’s contract.
- For storing the hospital’s request, this entry point will be triggered by the hospital.
- For transferring the vaccines to the hospital.
In the Hospital’s contract, there will be two main entrypoint.
- For requesting vaccines from the State Government.
- For updating the vaccine count.
Now we are done with designing the contracts for the Vaccine Distribution!
- First, we will need to create a config.json file which contains the configuration details of the contract. Update the config.json file with the contract address of the generated contract.
- A client-side application that will be used by the State Government hospital to interact with the Dapp. Code for the same can be found here.
A similar procedure can be repeated to develop the React App for the Central Government and the Hospital.
Hurray, we are done with developing the Dapp that can be used to record the details of the vaccine that is being distributed!!!
Furthermore, if you would like to display the details of the transactions happening between the Central Government, State Government & Hospital, you can use the TZKT API.
Code for the same can be found in my repository.
This project was built by me during the Python Week Hackathon.
Special thanks to Tezos India Foundation and GD Soumya, Blockchain Developer Intern at Tezos India for helping us develop this Dapp.
- Arnab Deep - East Singhbhum, Jharkhand, India | Professional Profile | LinkedIn
- Sukesh Seth - Flight Systems Engineer - Student Copter Research Organization | LinkedIn
Join Coinmonks Telegram group and learn about crypto trading and investing
- What is Margin Trading
- The Best Crypto Trading Bot | Grid Trading
- 3Commas Review | Pionex Review | Coinrule review
- AAX Exchange Review | Deribit Review |FTX Exchange Review
- NGRAVE ZERO review | Phemex Review | PrimeXBT Review
- Bybit Exchange Review | Bityard Review | CoinSpot Review
- 3Commas vs Cryptohopper | Earn crypto interest
- The Best Bitcoin Hardware wallet | BitBox02 Review
- Ledger vs Ngrave | Ledger nano s vs x
- Crypto Copy Trading Platforms
- YouHodler Review | BlockFi Review
- The Best Crypto Tax Software | CoinTracking Review
- Best Crypto Lending Platforms | Leveraged Token
- BlockFi vs Celsius | Hodlnaut Review
- Bitsgap review | Quadency Review | Bitbns Review
- Ellipal Titan Review | SecuX Stone Review
- LocalBitcoins Review | Cryptocurrency Savings Accounts
- Best Blockchain Analysis Tools | Earn Bitcoin
- Crypto arbitrage Guide | How to Short Bitcoin
- Best Crypto Charting Tool | Best Crypto Exchange
- How to buy Bitcoin in India? | WazirX Review
- Bitcoin exchange in India | Bitcoin Savings Account
- CoinDCX Review | Crypto Margin Trading Exchanges