Solidity is the language of choice for creating smart contracts on blockchain platforms like Celo. One of the applications of these smart contracts is to create a decentralized system for verifying identities, enhancing privacy, and reducing reliance on centralized authorities. In this challenge, you will build a simple identity verification system using Solidity.
Design a smart contract that facilitates a basic decentralized identity verification system with the following requirements:
- The contract should allow users to register their identity, specifying details like name, date of birth, and a government-issued ID number.
- The contract should allow authorized verifiers to confirm the identity details submitted by the users.
- Once verified, the contract should mark the user’s address as verified.
- The contract should allow anyone to check the verification status of an address but not the identity details.
- The contract should prevent identity details from being altered once they are verified.
- Use a
structto define an identity with attributes like name, date of birth, and government-issued ID number.
mappingto link addresses with their respective identity data.
msg.senderto assign identities and verification statuses.
modifierfunctions to enforce restrictions such as preventing changes after verification.
- Correctness: The contract should compile without errors and meet all the requirements.
- Readability: The contract should be well-documented, with comments explaining the code.
- Testability: You should also provide examples of how to test each function of the contract.
Remember, managing identity information requires high standards of security and privacy. This challenge does not cover all aspects of a robust decentralized identity system.
For a comprehensive understanding of Celo smart contracts and Solidity, please refer to the Celo and Solidity tutorials.
Please reply with a link to your PR on GitHub - celo-academy/Decentralized-Identity-Verification-using-Solidity-Coding-Challenge, including your identity verification contract. Also, include any notes or comments you think are necessary to understand your design and choices. Lastly, provide a brief explanation about how each function of the contract should be tested.