InheritX enables users to create secure inheritance plans using smart contracts on the Lisk blockchain. The platform automates asset transfers based on selected timeframes and provides a complete solution for digital legacy management.
- π Secure Plan Creation - Create inheritance plans with encrypted claim codes and hashed beneficiary data
- β° Flexible Distribution - Choose from Lump Sum, Monthly, Quarterly, or Yearly distributions
- β KYC Verification - Built-in identity verification system with admin approval
- π§ Automated Notifications - Cron jobs send claim notifications when plans become due
- π‘οΈ Privacy-First - Beneficiary information is hashed (keccak256) before on-chain storage
- π₯ Multi-Beneficiary Support - Up to 10 beneficiaries per plan with custom allocations
- π UUPS Upgradeable - Smart contract can be upgraded without losing state
inheritx_dapp/
βββ contracts/ # Solidity smart contracts
β βββ InheritX.sol # Main inheritance contract
β βββ MockERC20.sol # Test tokens
βββ client/ # Next.js frontend
β βββ app/ # App router pages
β βββ src/ # Components, hooks, utilities
β βββ public/ # Static assets
βββ server/ # Node.js backend
β βββ src/ # API routes, services
β βββ prisma/ # Database schema
β βββ cron/ # Scheduled tasks
βββ scripts/ # Deployment scripts
- Node.js 18+
- PostgreSQL 14+
- npm or yarn
- MetaMask or compatible wallet
git clone https://github.com/your-repo/inheritx_dapp.git
cd inheritx_dapp
# Install client dependencies
cd client && npm install
# Install server dependencies
cd ../server && npm installClient (client/.env.local):
NEXT_PUBLIC_CONTRACT_ADDRESS=0x...
NEXT_PUBLIC_API_URL=http://localhost:3001/api
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your-project-idServer (server/.env):
DATABASE_URL="postgresql://user:password@localhost:5432/inheritx"
JWT_SECRET="your-jwt-secret-min-32-chars"
JWT_CLAIM_CODE_SECRET="your-claim-code-secret"
SMTP_HOST="smtp.gmail.com"
SMTP_USER="your-email@gmail.com"
SMTP_PASS="your-app-password"
FRONTEND_URL="http://localhost:3000"cd server
npm run prisma:generate
npm run prisma:migrate
npm run prisma:seedcd client
npm run deploy:lisk-sepolia# Terminal 1 - Backend
cd server && npm run dev
# Terminal 2 - Frontend
cd client && npm run devVisit http://localhost:3000 π
- User connects wallet
- Signs message to authenticate
- Submits KYC documents (ID, personal info)
- Admin reviews and approves/rejects KYC
- Plan Details: Enter name, description, asset type, amount
- Distribution Method: Choose Lump Sum, Monthly, Quarterly, or Yearly
- Beneficiaries: Add up to 10 beneficiaries with percentage allocations
- Review & Create:
- Backend stores unhashed data + encrypted claim code
- Frontend sends hashed data to smart contract
- Plan is created on-chain
- When transfer date arrives, cron job sends email notifications
- Beneficiary visits claim page with link from email
- Enters claim code + personal details (name, email, relationship)
- System verifies data by hashing and comparing to on-chain values
- If valid, beneficiary can claim their share via smart contract
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PLAN CREATION β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Frontend β Backend: Plain text data (stored encrypted) β
β Frontend β Contract: Hashed data (keccak256) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STORAGE LOCATIONS β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Backend DB: Plan name, description, beneficiary details, β
β encrypted claim code, email addresses β
β β
β Smart Contract: Plan hashes, beneficiary hashes, β
β claim code hash, asset amounts β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLAIM PROCESS β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 1. Cron decrypts claim code β Sends to beneficiary email β
β 2. Claimer enters plain text data β
β 3. Contract hashes input β Compares with stored hashes β
β 4. If match β Assets transferred β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
// Create inheritance plan with hashed data
function createInheritancePlan(
bytes32 planNameHash,
bytes32 planDescriptionHash,
BeneficiaryInput[] calldata beneficiaries,
uint8 assetType,
uint256 assetAmount,
uint8 distributionMethod,
uint64 transferDate,
uint8 periodicPercentage,
bytes32 claimCodeHash
) external returns (uint256);
// Claim inheritance by providing original unhashed data
function claimInheritance(
uint256 planId,
string calldata claimCode,
string calldata beneficiaryName,
string calldata beneficiaryEmail,
string calldata beneficiaryRelationship,
uint256 beneficiaryIndex
) external;
// KYC management
function submitKYC(bytes32 kycDataHash) external;
function approveKYC(address user) external;
function rejectKYC(address user) external;event PlanCreated(uint256 indexed globalPlanId, uint256 indexed userPlanId, address indexed owner, ...);
event InheritanceClaimed(uint256 indexed planId, address indexed claimer, uint256 amount, ...);
event KYCStatusChanged(address indexed user, KYCStatus oldStatus, KYCStatus newStatus, ...);| Method | Endpoint | Description |
|---|---|---|
| GET | /api/auth/nonce |
Get nonce for wallet signature |
| POST | /api/auth/login |
Login with wallet signature |
| GET | /api/auth/me |
Get current user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/kyc/status |
Get KYC status |
| POST | /api/kyc/submit |
Submit KYC documents |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/plans |
Get user's plans |
| POST | /api/plans |
Create new plan |
| PUT | /api/plans/:id/status |
Update plan status |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/claim/plan/:id |
Get plan info for claiming |
| POST | /api/claim/verify |
Verify claim data |
| POST | /api/claim/complete |
Mark claim complete |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/admin/stats |
Dashboard statistics |
| GET | /api/admin/kyc |
List KYC applications |
| POST | /api/admin/kyc/:id/approve |
Approve KYC |
| POST | /api/admin/kyc/:id/reject |
Reject KYC |
| Route | Description |
|---|---|
/ |
Landing page |
/dashboard |
User dashboard |
/dashboard/plans |
Manage plans |
/dashboard/kyc |
KYC verification |
/claim/:planId |
Claim page for beneficiaries |
/admin |
Admin dashboard |
/admin/kyc |
Admin KYC management |
/admin/users |
User management |
- Claim Codes: Encrypted with JWT secret in backend, hashed on-chain
- Beneficiary Data: Hashed (keccak256) before on-chain storage
- KYC Data: Only hash stored on-chain, full data in secure database
- Access Control: RBAC with ADMIN and SUPER_ADMIN roles
- Rate Limiting: API endpoints protected against abuse
- CORS: Configured for frontend origin only
Key models:
User- Wallet addresses and rolesKYC- Identity verification dataPlan- Inheritance plans with encrypted claim codesBeneficiary- Plan beneficiaries (hashed + unhashed data)Distribution- Periodic distribution schedulesActivity- Audit log
# Run smart contract tests
cd client && npm test
# Run backend tests
cd server && npm testMIT License - see LICENSE for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing) - Open a Pull Request
- Documentation: docs.inheritx.io
- Discord: discord.gg/inheritx
- Twitter: @InheritX
Built with β€οΈ on Lisk
Secure your digital legacy today