Credichain V2 is an advanced decentralized platform for secure verification and credential issuance, featuring enhanced security, batch operations, reputation systems, and comprehensive analytics. Building on the foundation of V1, this version introduces multi-role access control, credential expiration, institution reputation tracking, and gas-optimized batch operations.
- Multi-role Access Control: Separate roles for admins, institution verifiers, and emergency responders
- Reentrancy Protection: All state-changing functions protected against reentrancy attacks
- Emergency Pause: Circuit breaker functionality for emergency situations
- Input Validation: Comprehensive input validation with custom errors for gas optimization
- Batch Operations: Issue up to 50 credentials in a single transaction
- Credential Expiration: Support for time-limited credentials
- Institution Reputation System: Dynamic reputation scoring based on credential issuance and revocation
- Credential Types: Support for degrees, certificates, diplomas, licenses, and badges
- Enhanced Metadata: IPFS integration and comprehensive credential metadata
- Platform Statistics: Real-time analytics on credential issuance and platform usage
- Institution Categories: Classification system for different types of institutions
- Credential Validation: Built-in validity checks for expired or revoked credentials
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β IdentityManager β β CrediChainCore V2β β SoulBoundNFT β
β (World ID) ββββββ€ (Core Logic) βββββΊβ (Credentials) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β² β² β²
β β β
ββββββΌβββββ ββββββΌβββββ ββββββΌβββββ
βStudents β βPlatform β βMetadata β
β(Users) β β Admin β βStorage β
βββββββββββ βββββββββββ βββββββββββ
- Foundry Suite: Complete development environment
- Forge: Testing and deployment framework
- Anvil: Local Ethereum node for development
- Cast: Command-line tool for contract interaction
- OpenZeppelin Contracts: Security-audited contract libraries
- Base OnchainKit: Smart wallet integration
- World ID: Privacy-preserving identity verification
- IPFS: Decentralized metadata storage
- Purpose: Manages institutions, credential issuance, and platform governance
- Key Features:
- Multi-role access control (Admin, Institution Verifier, Emergency)
- Batch credential issuance (up to 50 per transaction)
- Institution reputation system
- Credential expiration support
- Emergency pause functionality
- Purpose: Manages World ID-based verification for users and institutions
- Key Features:
- Integration with World ID protocol
- Identity verification status tracking
- Privacy-preserving authentication
- Purpose: Non-transferable NFTs representing academic credentials
- Key Features:
- Soulbound token implementation
- Metadata storage with IPFS support
- Revocation functionality
| Contract | Address | Block Explorer |
|---|---|---|
| IdentityManager | 0x436fB1cd4852235459D4806DD1d4958e7692E461 |
View Contract |
| CrediChainCore V2 | TBD |
Coming Soon |
| SoulBoundNFT | 0x123C83BCbC38934BB033ea24d9DD6d98B7F1f552 |
View Contract |
- Node.js (v16 or higher)
- Git
- Foundry (latest version)
# Clone the repository
git clone https://github.com/your-repo/credichain-v2
cd credichain-v2
# Install Foundry dependencies
forge install
# Install Node.js dependencies (if any)
npm install# Compile all contracts
forge build
# Generate documentation
forge doc# Run all tests
forge test
# Run tests with gas reporting
forge test --gas-report
# Run specific test file
forge test --match-contract CrediChainCoreV2Test
# Run with verbosity for debugging
forge test -vvv# Generate gas snapshots
forge snapshot
# Compare gas usage
forge snapshot --diff .gas-snapshot# Start local Anvil node
anvil
# Deploy contracts to local network
forge script script/DeployV2.s.sol:DeployV2Script --rpc-url http://localhost:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --broadcast
# Interact with contracts using Cast
cast call $CREDICHAIN_CORE "totalCredentialsIssued()(uint256)" --rpc-url http://localhost:8545Credichain addresses the problem of secure institutional data verification by leveraging blockchain technology, decentralized identity, and non-transferable token standards. Institutions must be verified by the platform's owner, and students must authenticate with World ID to engage with the platform and transact credentials.
The platform provides the following key functionalities:
- Institution Verification: Institutions need to be verified by the Credichain owner to enlist and issue credentials.
- Credential Issuance: Verified institutions can issue Soulbound NFTs to students, representing academic credentials that are tied permanently to the student's identity.
- Credential Revocation: Institutions can revoke credentials in case of fraudulent activity or errors.
- Student Verification: Students use World ID to authenticate their identity before receiving credentials.
- Forge: Testing and deployment framework for Ethereum smart contracts.
- Anvil: Local Ethereum node for testing and simulation.
- Cast: Utility for interacting with contracts and sending transactions.
- Base OnchainKit: Smart wallets to manage user credentials and transactions.
- OpenZeppelin: Standard libraries for implementing Soulbound NFTs.
- World ID: Privacy-preserving decentralized identity solution for authenticating students.
-
IdentityManager.sol
Manages World ID-based verification for students and institutions, ensuring only verified users can participate in the platform. -
CrediChainCore.sol
Core contract that handles institution verification, credential issuance, and revocation. -
SoulBoundNFT.sol
Implements Soulbound NFTs using OpenZeppelinβs non-transferable token standard, ensuring credentials are permanently linked to the recipient's identity.
- IdentityManager.sol: https://base-sepolia.blockscout.com/address/0x436fB1cd4852235459D4806DD1d4958e7692E461?tab=write_contract
- CrediChainCore.sol: https://base-sepolia.blockscout.com/address/0x65EfAe4dBF1A5765636B2704b5Fa039Dc7515558?tab=write_contract
- SoulBoundNFT.sol: https://base-sepolia.blockscout.com/address/0x123C83BCbC38934BB033ea24d9DD6d98B7F1f552?tab=write_contract=
Clone the repository and install dependencies:
$ git clone https://github.com/your-repo/credichain
$ cd credichain
$ forge installTo compile the smart contracts:
$ forge buildWe use Forge for testing the contracts to ensure the system is secure and functions as expected. Run the following command to execute all tests:
$ forge testThis will run a suite of tests to check the integrity of the credential issuance process, institution verification, student authentication, and NFT minting.
To track gas usage during contract interactions, use:
$ forge snapshotThis helps ensure the platform is optimized for minimal gas consumption during credential issuance and verification.
To simulate local Ethereum transactions and test smart contract interactions, you can start an Anvil local node:
$ anvilYou can use Cast to interact with the contracts directly. For example, to verify an institution on the platform:
$ cast send <CrediChainCore_Address> "verifyInstitution(address institutionAddress)" --private-key <your_private_key>After deploying, paste the deployed contract addresses here:
- IdentityManager.sol:
__Paste_IdentityManager_Address__ - CrediChainCore.sol:
__Paste_CrediChainCore_Address__ - SoulBoundNFT.sol:
__Paste_SoulBoundNFT_Address__
-
Student Verification with World ID
Students authenticate using World ID, ensuring privacy-preserving and decentralized identity verification. -
Institution Verification
Institutions are verified by the platform owner using the CrediChainCore contract. Once verified, they can issue credentials. -
Credential Issuance (Soulbound NFTs)
Verified institutions issue Soulbound NFTs to students, representing their academic credentials. These tokens are non-transferable and permanently linked to the student's OnchainKit smart wallet. -
Credential Revocation
In case of fraudulent activity or data correction, institutions can revoke issued credentials through the CrediChainCore contract.
We use a combination of fuzz testing and unit testing to simulate real-world scenarios and edge cases:
- Fuzz Testing: Stress-tests the contracts to identify any potential breakdowns under various conditions.
- Unit Testing: Verifies the core functionality of student verification, institution verification, credential issuance, and revocation.
You can run all tests using the forge test command.
Credichain leverages blockchain and decentralized identity solutions to provide a secure and efficient platform for student credential verification. With the use of Soulbound NFTs, World ID, and Base OnchainKit, the system ensures a tamper-proof, scalable, and incentivized approach to managing institutional data, offering significant benefits for students and institutions alike.