A blockchain-based age verification system that empowers parents to protect their children online while maintaining privacy and ensuring accountability from online services.
Online services often claim they "don't know" a user's real age, allowing them to avoid responsibility for child safety. Children can easily lie about their age during registration, and parents have no way to enforce accurate age reporting.
KidSafe creates an immutable, parent-controlled age verification system on the blockchain where:
- Parents register their children's real birth dates
- Online services can verify age requirements without accessing personal data
- Companies can no longer claim ignorance about user ages
- Complete audit trail ensures accountability
- Birth dates stored immutably on blockchain
- Cryptographic proof of authenticity
- Real-time age calculation using blockchain timestamps
- Parents maintain full control until child reaches 18
- Transfer custody capabilities for family changes
- Bulk management of multiple children
- Services only receive pass/fail verification results
- No personal data (birth dates, exact ages) shared
- Zero-knowledge proof architecture
- All verification requests logged on-chain
- Transparent accountability for services
- Historical verification data for compliance
- RESTful API for seamless service integration
- Multiple verification modes (single age, age ranges)
- Comprehensive rate limiting and security
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Parent App โ โ Service API โ โ Smart Contract โ
โ โ โ โ โ โ
โ โข Register kids โโโโโบโ โข Age verify โโโโโบโ โข Store records โ
โ โข Manage perms โ โ โข Audit logs โ โ โข Calculate age โ
โ โข Transfer ctrl โ โ โข Rate limiting โ โ โข Event logging โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโ
โ Blockchain โ
โ โ
โ โข Ethereum โ
โ โข Polygon โ
โ โข Other EVM โ
โโโโโโโโโโโโโโโโโโโ
- Node.js 18+ and npm
- Git
- MetaMask or compatible wallet
git clone https://github.com/yourusername/kidsafe-age-verification.git
cd kidsafe-age-verification
chmod +x scripts/setup.sh
./scripts/setup.shcp .env.example .env
# Edit .env with your configuration:
# - Add your wallet private key
# - Configure RPC endpoints
# - Set API security keys# Terminal 1: Start local blockchain
npx hardhat node
# Terminal 2: Deploy contracts
npm run deploy
# Terminal 3: Start development servers
npm run dev- Parent Interface: http://localhost:3001
- API Documentation: http://localhost:3000/health
- Contract Address: Check console output from deploy command
- Open the parent interface
- Click "Connect Wallet"
- Approve connection in MetaMask
Child's Wallet Address: 0x742d35Cc6634C0532925a3b8D43Cc6fe7C3C8904
Birth Date: 2010-05-15
Document Hash: (auto-generated or provide birth certificate hash)
- View all registered children
- Transfer parental control (custody changes)
- Deactivate records when child reaches 18
curl -X POST http://localhost:3000/api/register-service \
-H "Content-Type: application/json" \
-d '{
"serviceAddress": "0x8ba1f109551bD432803012645Hac136c4cccccccc",
"serviceName": "YourPlatform",
"contactEmail": "compliance@yourplatform.com"
}'const verifyAge = async (childAddress, minimumAge) => {
const response = await fetch('/api/verify-age', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'your-api-key',
'x-service-address': 'your-service-address'
},
body: JSON.stringify({
childAddress,
minimumAge,
returnActualAge: false // Privacy-preserving mode
})
});
const result = await response.json();
return result.verified; // true/false
};// Check multiple age thresholds at once
const checkAgeRanges = async (childAddress) => {
const response = await fetch('/api/verify-age-range', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'your-api-key',
'x-service-address': 'your-service-address'
},
body: JSON.stringify({
childAddress,
ageRanges: [13, 16, 18] // Check 13+, 16+, 18+
})
});
const result = await response.json();
// Returns which thresholds the child meets
return result.verificationResults;
};All service endpoints require:
x-api-key: Your service API keyx-service-address: Your registered Ethereum address
Register a new child in the system.
Request:
{
"childAddress": "0x742d35Cc6634C0532925a3b8D43Cc6fe7C3C8904",
"birthTimestamp": 1589155200,
"documentHash": "0x1234...",
"parentAddress": "0x8ba1f109551bD432803012645Hac136c4cccccccc"
}Response:
{
"success": true,
"message": "Child registered successfully",
"childAddress": "0x742d35Cc6634C0532925a3b8D43Cc6fe7C3C8904",
"age": 15,
"transactionHash": "0xabc123...",
"registrationDate": "2024-01-15T10:30:00.000Z"
}Verify if a child meets minimum age requirement.
Request:
{
"childAddress": "0x742d35Cc6634C0532925a3b8D43Cc6fe7C3C8904",
"minimumAge": 13,
"returnActualAge": false
}Response:
{
"verified": true,
"minimumAge": 13,
"timestamp": "2024-01-15T10:30:00.000Z",
"transactionHash": "0xdef456..."
}Get all children registered by a parent.
Response:
{
"children": [
{
"address": "0x742d35Cc6634C0532925a3b8D43Cc6fe7C3C8904",
"age": 15,
"isActive": true,
"registrationDate": "2024-01-15T10:30:00.000Z"
}
]
}Get verification audit logs for your service.
Response:
{
"logs": [
{
"timestamp": "2024-01-15T10:30:00.000Z",
"childAddress": "0x742d35Cc6634C0532925a3b8D43Cc6fe7C3C8904",
"serviceAddress": "0x8ba1f109551bD432803012645Hac136c4cccccccc",
"minimumAge": 13,
"verified": true,
"transactionHash": "0xabc123..."
}
],
"total": 1
}- Immutable Records: Birth dates cannot be altered once stored
- Cryptographic Verification: All data protected by blockchain cryptography
- Decentralized: No single point of failure
- Rate Limiting: 100 requests per 15 minutes per IP
- API Key Authentication: Secure service verification
- Input Validation: All inputs sanitized and validated
- CORS Protection: Configurable allowed origins
- Minimal Data Exposure: Services only receive verification results
- No Personal Data Storage: API doesn't store sensitive information
- Audit Transparency: All verifications logged for accountability
npm testcd backend
npm test# Test age verification
curl -X POST http://localhost:3000/api/verify-age \
-H "Content-Type: application/json" \
-H "x-api-key: demo-key" \
-H "x-service-address: 0x742d35Cc6634C0532925a3b8D43Cc6fe7C3C8904" \
-d '{
"childAddress": "0x742d35Cc6634C0532925a3b8D43Cc6fe7C3C8904",
"minimumAge": 13
}'npx hardhat node # Start local blockchain
npm run deploy # Deploy contracts locally
npm run dev # Start frontend + backend# Configure .env with testnet RPC URL and private key
npx hardhat run scripts/deploy.js --network sepolia# โ ๏ธ Ensure thorough testing before mainnet deployment
npx hardhat run scripts/deploy.js --network mainnetcd backend
npm install --production
NODE_ENV=production npm start- Ethereum Mainnet: Production deployment
- Polygon: Lower cost alternative
- Arbitrum: Layer 2 scaling
- Optimism: Layer 2 scaling
- Sepolia: Ethereum testnet
- Mumbai: Polygon testnet
- Contract optimized for minimal gas usage
- Batch operations for multiple children
- Efficient storage patterns
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Run the test suite:
npm test - Commit your changes:
git commit -m 'Add amazing feature' - Push to your fork:
git push origin feature/amazing-feature - Submit a pull request
- Follow existing code style
- Add tests for new features
- Update documentation
- Ensure security best practices
This project is licensed under the MIT License - see the LICENSE file for details.
Important: This is a proof-of-concept implementation designed to demonstrate blockchain-based age verification. Before production use:
- Conduct thorough security audits
- Review legal compliance requirements
- Test extensively on testnets
- Consider professional smart contract auditing
- Documentation: Check this README and inline code comments
- Issues: Create a GitHub issue for bugs or feature requests
- Community: Join our Discord for community support
Q: Contract deployment fails
A: Check your private key and RPC URL in .env
Q: Frontend can't connect to MetaMask A: Ensure MetaMask is connected to the correct network
Q: API returns 401 Unauthorized A: Verify your API key and service address headers
Q: Age verification returns false for valid child A: Check that the child is registered and birth date is correct
- Basic age verification smart contract
- Parent registration interface
- Service API with authentication
- Zero-knowledge proof implementation
- Selective disclosure protocols
- Enhanced anonymization
- Mobile app for parents
- WordPress/Shopify plugins
- Social media platform SDKs
- Multi-parent/guardian support
- International legal compliance
- Cross-chain compatibility
- Peace of Mind: Know your child's real age is being used online
- Control: Maintain authority over your child's digital presence
- Transparency: See which services have verified your child's age
- Compliance: Meet age verification requirements with confidence
- Liability Protection: Demonstrable due diligence in age verification
- User Trust: Show commitment to child safety
- Safety: Appropriate content and interaction filtering
- Privacy: Personal data not shared with services
- Growth: Automatic permission updates as they age
Built with โค๏ธ for child safety and digital privacy
"In a world where children's safety online is paramount, KidSafe provides the tools parents need to protect their children while respecting privacy and ensuring accountability."