A production-grade blockchain-backed registry system for immutable property records, legal agreements, and court-admissible evidence generation with comprehensive spatial integrity and institutional compliance.
BhoomiChain represents a groundbreaking advancement in property registry technology, combining blockchain immutability with legal compliance to create the world's first court-admissible, cryptographically verifiable property management system. Our research addresses critical challenges in property law, spatial data integrity, and institutional transparency.
- Blockchain-Legal Integration: First system to achieve mathematical certainty in property records with court-admissible evidence generation
- Spatial Conservation Enforcement: Novel =99% area conservation algorithms ensuring geometric integrity across property subdivisions
- Vertical Property Hierarchy: Deterministic ownership resolution for complex land?building?flat relationships
- Fraud Detection Primitives: Machine learning-based anomaly detection for suspicious property activities
- Institutional Archival: End-of-system guarantees with offline-verifiable data structures for perpetual legal compliance
- Mathematical Certainty: Deterministic canonical hashing with keccak256 ensures identical results across all platforms
- Cryptographic Integrity: Merkle tree anchoring provides tamper-evident proof of all property records
- Legal Admissibility: Court-grade affidavits with embedded QR verification meet international legal standards
- Spatial Accuracy: GIS-validated geometry with coordinate precision monitoring and drift detection
- Audit Defense: Comprehensive failure categorization with explicit remediation guidance for regulatory compliance
- FastAPI 0.104.1: High-performance async web framework with automatic API documentation
- Python 3.9+: Primary backend language with type safety and modern async support
- SQLAlchemy: Advanced ORM with connection pooling and hierarchical data support
- PostgreSQL: Primary database with spatial extensions and JSONB support
- Alembic: Database migration management with version control
- Web3.py: Production-grade Ethereum client with retry mechanisms and connection pooling
- Hardhat: Ethereum development environment with comprehensive testing framework
- Solidity 0.8+: Smart contract language with OpenZeppelin security libraries
- IPFS: Distributed content addressing with ipfshttpclient integration
- cryptography: Advanced ECDSA signatures and cryptographic operations
- PyJWT: JSON Web Token implementation with secure authentication
- bcrypt: Password hashing with salt for credential security
- merkletools: Merkle tree construction and inclusion proof generation
- Shapely: Geometric operations and spatial analysis with precision validation
- GeoPandas: Advanced geospatial data analysis and coordinate transformations
- Folium: Interactive map generation and spatial visualization
- scikit-learn: Machine learning for fraud detection and pattern analysis
- ReportLab: Professional PDF generation for court-grade affidavits
- QRCode: Verification payload encoding for offline validation
- Jinja2: Legal document template rendering with jurisdiction support
- React 18+: Modern UI framework with TypeScript integration
- TypeScript: Type-safe JavaScript with comprehensive error checking
- Web3.js/Ethers.js: Blockchain interaction with wallet integration
- Leaflet/MapBox: Interactive spatial mapping and property visualization
- RegistryResolver: Core property registry with immutable record management
- AgreementLedger: Comprehensive legal agreement lifecycle management
- MerkleAnchor: Cryptographic proof anchoring with blockchain verification
POST /registry/create # Create new property record
GET /registry/list # List all property records
POST /registry/transfer # Transfer property ownership
GET /registry/verify/{record_hash} # Verify property record
POST /registry/subdivide # Create property subdivisionPOST /agreements # Create legal agreement
GET /agreements/{agreement_hash} # Get agreement details
POST /agreements/{id}/activate # Activate pending agreement
POST /agreements/{id}/terminate # Terminate active agreement
GET /agreements/by-subject/{hash} # Get subject agreementsPOST /properties/land # Register land parcel
POST /properties/building # Register building under land
POST /properties/flat # Register flat under building
GET /properties/{hash}/hierarchy # Get complete hierarchy
GET /flats/{hash}/agreements # Get flat-specific agreementsPOST /court/evidence/bundle/{hash} # Generate court evidence bundle
GET /court/judicial/verify/{hash} # Judicial-grade verification
POST /court/independent/package/{hash} # Registry-independent evidence
GET /verify/merkle/{hash} # Merkle inclusion verification
POST /fraud-detection/analyze/{hash} # Comprehensive fraud analysisGET /explorer/entities # Public entity discovery
GET /explorer/search # Advanced property search
GET /explorer/geographic/bounds # Spatial property queries
GET /explorer/agreements/active # Public agreement visibility
GET /explorer/analytics/summary # Registry analyticsGET /gis/audit/{hash} # Complete GIS audit report
POST /gis/validate # Validate geometry before creation
GET /gis/heatmap/ownership # Ownership distribution heatmap
GET /gis/conservation/{parent_hash} # Area conservation verification
POST /spatial/drift-detection # Geometric drift monitoringPOST /archival/institutional/freeze # Prepare institutional freeze
GET /archival/merkle/final-structure # Generate final Merkle structure
POST /archival/offline/package/{hash} # Create offline-verifiable package
GET /archival/end-of-system/certificate # Get archival guarantees- Node.js 18+ with Bun package manager
- Python 3.9+ with pip
- PostgreSQL 14+ with PostGIS extension
- Git for version control
- Docker (optional, for containerized deployment)
-
Clone Repository & Navigate
git clone https://github.com/your-org/title-vault.git cd title-vault/backend -
Create Virtual Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Environment Configuration Create
backend/.envfile:# Database Configuration DATABASE_URL=postgresql://username:password@localhost:5432/BhoomiChain # Blockchain Configuration WEB3_PROVIDER_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY PRIVATE_KEY=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef REGISTRY_CONTRACT_ADDRESS=0x742d35Cc6634C0532925a3b8D4C2C4e4C4C4C4C4 AGREEMENT_CONTRACT_ADDRESS=0x8ba1f109551bD432803012645Hac136c5C1234567 # IPFS Configuration IPFS_API_URL=http://localhost:5001 IPFS_GATEWAY_URL=http://localhost:8080 # Authentication & Security JWT_SECRET_KEY=your-super-secret-jwt-key-here-min-32-chars JWT_ALGORITHM=HS256 JWT_ACCESS_TOKEN_EXPIRE_MINUTES=60 JWT_REFRESH_TOKEN_EXPIRE_DAYS=7 # Rate Limiting RATE_LIMIT_ENABLED=true REDIS_URL=redis://localhost:6379/0 # GIS & Spatial SPATIAL_REFERENCE_SYSTEM=EPSG:4326 AREA_CONSERVATION_THRESHOLD=0.99 # Legal & Compliance DEFAULT_JURISDICTION=INDIA REGISTRAR_PRIVATE_KEY=0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
-
Database Setup
# Create database createdb BhoomiChain # Run migrations alembic upgrade head # Create test users python create_test_users.py
-
Start Backend Server
uvicorn app:app --reload --host 0.0.0.0 --port 8000
-
Navigate to Frontend
cd ../frontend -
Install Dependencies
bun install
-
Environment Configuration Create
frontend/.envfile:# API Configuration VITE_API_BASE_URL=http://localhost:8000 VITE_WS_URL=ws://localhost:8000/ws # Blockchain Configuration VITE_CHAIN_ID=11155111 VITE_CHAIN_NAME=Sepolia VITE_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY VITE_BLOCK_EXPLORER=https://sepolia.etherscan.io # Contract Addresses VITE_REGISTRY_CONTRACT=0x742d35Cc6634C0532925a3b8D4C2C4e4C4C4C4C4 VITE_AGREEMENT_CONTRACT=0x8ba1f109551bD432803012645Hac136c5C1234567 # Map Configuration VITE_MAPBOX_TOKEN=pk.eyJ1IjoieW91ci1tYXBib3gtdXNlcm5hbWUiLCJhIjoiY2xrNXM4... VITE_DEFAULT_MAP_CENTER_LAT=40.7128 VITE_DEFAULT_MAP_CENTER_LNG=-74.0060 VITE_DEFAULT_MAP_ZOOM=10 # Feature Flags VITE_ENABLE_SPATIAL_FEATURES=true VITE_ENABLE_COURT_FEATURES=true VITE_ENABLE_FRAUD_DETECTION=true
-
Start Frontend Development Server
bun dev
-
Navigate to Hardhat Directory
cd ../hardhat -
Install Dependencies
npm install
-
Environment Configuration Create
hardhat/.envfile:# Network Configuration SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY MAINNET_RPC_URL=https://mainnet.infura.io/v3/YOUR_INFURA_KEY # Deployment Keys DEPLOYER_PRIVATE_KEY=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef REGISTRAR_PRIVATE_KEY=0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890 # Etherscan Verification ETHERSCAN_API_KEY=ABC123DEF456GHI789JKL012MNO345PQR678STU # Gas Configuration GAS_PRICE_GWEI=20 GAS_LIMIT=8000000 # Contract Configuration INITIAL_REGISTRAR=0x742d35Cc6634C0532925a3b8D4C2C4e4C4C4C4C4 MERKLE_ANCHOR_INTERVAL=3600
-
Compile Contracts
npx hardhat compile
-
Deploy to Local Network
npx hardhat node # In separate terminal npx hardhat run scripts/deploy.js --network localhost -
Deploy to Sepolia Testnet
npx hardhat run scripts/deploy.js --network sepolia npx hardhat verify --network sepolia DEPLOYED_CONTRACT_ADDRESS
cd backend
pytest tests/ -v --cov=. --cov-report=html
python -m pytest tests/test_auth.py -v
python -m pytest tests/test_registry.py -v
python -m pytest tests/test_agreements.py -vcd frontend
bun test
bun test:e2e
bun test:coveragecd hardhat
npx hardhat test
npx hardhat test --grep "Registry"
npx hardhat coverage# Start all services
docker-compose up -d
# Run integration tests
cd backend
python -m pytest tests/integration/ -v
# Load testing
cd tests/load
python load_test.py# Build and start all services
docker-compose -f docker-compose.prod.yml up -d
# Scale backend services
docker-compose -f docker-compose.prod.yml up -d --scale backend=3
# Monitor logs
docker-compose logs -f backend frontend# Apply configurations
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/configmap.yaml
kubectl apply -f k8s/secrets.yaml
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/ingress.yaml
# Monitor deployment
kubectl get pods -n BhoomiChain
kubectl logs -f deployment/BhoomiChain-backend -n BhoomiChain# Production Database
DATABASE_URL=postgresql://prod_user:secure_password@db.example.com:5432/BhoomiChain_prod
# Production Blockchain
WEB3_PROVIDER_URL=https://mainnet.infura.io/v3/YOUR_PRODUCTION_INFURA_KEY
REGISTRY_CONTRACT_ADDRESS=0x1234567890123456789012345678901234567890
# Security
JWT_SECRET_KEY=your-production-jwt-secret-key-minimum-32-characters-long
CORS_ORIGINS=["https://app.BhoomiChain.com","https://admin.BhoomiChain.com"]
# Performance
REDIS_URL=redis://prod-redis.example.com:6379/0
DATABASE_POOL_SIZE=20
DATABASE_MAX_OVERFLOW=30
# Monitoring
SENTRY_DSN=https://your-sentry-dsn@sentry.io/project-id
LOG_LEVEL=INFO
METRICS_ENABLED=trueVITE_API_BASE_URL=https://api.BhoomiChain.com
VITE_CHAIN_ID=1
VITE_RPC_URL=https://mainnet.infura.io/v3/YOUR_PRODUCTION_INFURA_KEY
VITE_REGISTRY_CONTRACT=0x1234567890123456789012345678901234567890- Backend:
GET /health- System health and database connectivity - Blockchain:
GET /blockchain/status- Web3 connection and contract status - IPFS:
GET /ipfs/status- IPFS node connectivity and storage status
- Prometheus: Metrics collection for performance monitoring
- Grafana: Operational dashboards and alerting
- Sentry: Error tracking and performance monitoring
- ELK Stack: Centralized logging and log analysis
- API Response Time: <200ms for 95th percentile
- Blockchain Sync: <5 second lag from chain events
- Spatial Queries: <500ms for complex geometric operations
- PDF Generation: <2 seconds for court-grade affidavits
- JWT Tokens: 60-minute access tokens with 7-day refresh tokens
- Role-Based Access: Admin, user, and registrar role hierarchies
- Rate Limiting: 10 login attempts/minute, 100 API calls/hour
- Password Security: bcrypt hashing with salt
- Private Key Management: Hardware Security Module (HSM) integration
- Multi-Signature: Critical operations require multiple signatures
- Gas Optimization: Efficient contract interactions with gas estimation
- Reentrancy Protection: SafeMath and checks-effects-interactions pattern
- Encryption at Rest: AES-256 encryption for sensitive data
- Encryption in Transit: TLS 1.3 for all API communications
- GDPR Compliance: Data anonymization and right-to-deletion support
- Audit Trails: Comprehensive logging of all system interactions
- Interactive Docs: Available at
/docs(Swagger UI) - ReDoc: Available at
/redoc(Alternative API documentation) - OpenAPI Spec: Machine-readable API specification
- Court Admissibility Guide: Legal standards and evidence requirements
- Jurisdiction Compliance: Multi-jurisdictional legal framework support
- Expert Witness Support: Technical documentation for legal proceedings
- SDK Documentation: Python and JavaScript SDK usage guides
- Integration Examples: Sample code for common integration patterns
- Troubleshooting Guide: Common issues and resolution procedures
- Python: PEP 8 compliance with Black formatting
- TypeScript: ESLint and Prettier for consistent code style
- Solidity: Solhint for smart contract best practices
- Testing: Minimum 90% code coverage requirement
- Fork repository and create feature branch
- Implement changes with comprehensive tests
- Run full test suite and linting
- Submit pull request with detailed description
- Code review and automated testing
- Merge after approval and CI/CD validation
- Bug Reports: Use GitHub issues with reproduction steps
- Feature Requests: Detailed use cases and acceptance criteria
- Security Issues: Private disclosure via security@BhoomiChain.com
- React application with TypeScript and modern hooks
- Blockchain-integrated UI with Web3 wallet support
- Interactive spatial mapping and property visualization
- Real-time activity monitoring and notifications
- React Native mobile app for iOS and Android
- Offline verification capabilities
- Mobile-optimized property management
- Push notifications for agreement updates
- REST API SDK for enterprise systems
- Bulk import/export capabilities
- Custom branding and white-label solutions
- Enterprise SSO integration
- Machine learning fraud detection
- Predictive property valuation
- Market trend analysis
- Regulatory compliance automation
This project is licensed under the MIT License - see the LICENSE file for details.
- This software is provided for educational and research purposes
- Users are responsible for compliance with local property laws
- Legal advice should be sought for production deployments
- Blockchain transactions are irreversible - use with caution
- Novel algorithms and methods may be subject to patent protection
- Open source license does not grant patent rights
- Commercial use may require additional licensing agreements
Special thanks to:
- Ethereum Foundation for blockchain infrastructure
- OpenZeppelin for security-audited smart contract libraries
- FastAPI community for excellent web framework
- React team for modern frontend development tools
- PostGIS for advanced spatial database capabilities
demo project url - https://youtu.be/mbiOKDtx69s
