- Method Registration: Register cryptographic methods (e.g., SHA-256, MD5) with specifications
- External ID Management: Manage external identifiers (e.g., RSA-2048, ECDSA, HMAC) with signature size hints
- Claim Management: Create and manage claims with fingerprints, metadata, and external signatures
- Batch Operations: Support for batch claiming multiple items at once
- Admin Controls: Admin-only functions with optional locking mechanism
- Registry Creation: Deploy new GeneralizedClaimRegistry instances with a simple function call
- Registry Management: Update names, descriptions, and activation status of created registries
- Registry Discovery: Find and track all created registries by creator or globally
- Batch Creation: Create multiple registries in a single transaction
- Comprehensive Testing: Full test suite covering all contract functionality
├── contracts/
│ ├── GeneralizedClaimRegistry.sol # Main smart contract
│ └── ClaimRegistryFactory.sol # Factory contract for creating registries
├── test/
│ ├── GeneralizedClaimRegistry.test.js # Test suite for registry contract
│ └── ClaimRegistryFactory.test.js # Test suite for factory contract
├── scripts/
│ ├── deploy.js # Factory deployment script
│ ├── createRegistry.js # Script to create registries via factory
│ └── verify.js # Contract verification script
├── hardhat.config.js # Hardhat configuration
├── package.json # Dependencies and scripts
└── README.md # This file
-
Install dependencies:
npm install
-
Install Hardhat (if not already installed):
npm install --save-dev hardhat
npm run compilenpm test-
Start local Hardhat node:
npm run node
-
Deploy factory contract (in another terminal):
npm run deploy:local
-
Create a new registry through the factory:
FACTORY_ADDRESS=0x... npm run create-registry:local
- Method: Represents a cryptographic method (e.g., SHA-256, MD5)
- ExternalID: Represents an external identifier (e.g., RSA-2048, ECDSA, HMAC)
- Claim: Represents a claim with fingerprint, metadata, and signature data
registerMethod(): Register a new cryptographic methodregisterExternalID(): Register a new external identifiersetMethodActive(): Enable/disable a methodsetExternalIDActive(): Enable/disable an external IDlockAdmin(): Permanently lock admin functions
claim(ClaimParams): Create a claim with optional external signature (RSA, HMAC, etc.)
- Admin functions are protected and can be permanently locked
- Duplicate claims are prevented
- Signature size validation prevents oversized signatures
- Only active methods and external IDs can be used for claims
MIT License - see the contract source code for details.
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
For questions or issues, please open an issue in the repository.
Framework overview: Google Doc