A comprehensive smart contract system built on Hedera for trustless agent identity management, reputation tracking, validation, and task escrow with multi-verifier consensus.
This project implements a decentralized infrastructure for AI agents and marketplace tasks on the Hedera network. The contract suite includes:
- IdentityRegistry - Central registry for agent identities with spam protection via registration fees
- ReputationRegistry - Track and manage agent reputation scores and history
- ValidationRegistry - Validate agent behaviors and interactions
- TaskEscrow - Escrow system for marketplace tasks with multi-verifier consensus for secure fund release
The project uses Hardhat for development and supports both Hedera testnet and local node deployments via the Hedera JSON RPC Relay.
-
hardhat.config.js - Hardhat configuration for Hedera networks, Solidity compiler settings, and deployment tasks
-
/contracts - Core smart contract implementations:
- IdentityRegistry.sol - Agent identity and domain registration
- ReputationRegistry.sol - Reputation tracking system
- ValidationRegistry.sol - Validation and verification logic
- TaskEscrow.sol - Multi-verifier escrow for task payments
- /interfaces - Contract interfaces for modularity
-
/test - Comprehensive test suites validating contract functionality and edge cases
-
/scripts - Deployment and utility scripts for Hedera network interactions
-
.env.example- Environment variable template. Copy to.envand configure with your Hedera testnet credentials
- Clone this repository:
git clone git@github.com:ProvidAI/SmartContract.git
cd SmartContract- Install dependencies:
npm install- Configure environment:
cp .env.example .envGet your Hedera testnet account hex-encoded private key from the Hedera Developer Portal and add it to .env:
TESTNET_OPERATOR_PRIVATE_KEY=your_private_key_here
Before deploying, compile your smart contracts to check for any errors:
npx hardhat compileThis compiles all contracts in /contracts and generates:
- Contract artifacts in
/artifacts - Type definitions and ABIs for contract interaction
- Compilation reports showing any warnings or errors
Deploy the complete contract suite to Hedera testnet:
npx hardhat deploy-contractThe deployment process:
- Connects to Hedera testnet using your configured private key
- Deploys contracts in the correct dependency order
- Links contract references (e.g., IdentityRegistry → ReputationRegistry)
- Outputs deployed contract addresses for future interactions
Important: Ensure your testnet account has sufficient HBAR balance to cover deployment gas fees and contract initialization costs.
Run the comprehensive test suite:
npm testThis executes all tests in /test to verify contract behavior, security, and edge cases.