Skip to content

deepaknailwal/cryptowill

Repository files navigation

🔐 CryptoWill — Crypto Inheritance System

Smart contract based solution for automatic crypto asset transfer when owner becomes inactive.


🚨 Problem

Millions of dollars worth of crypto assets are permanently lost every year because:

  • Owner dies or becomes incapacitated
  • No one knows the private key
  • No inheritance system exists in Web3

✅ Solution

CryptoWill is a smart contract based wallet that:

  • Lets owner set a beneficiary address
  • Starts an inactivity countdown timer (e.g. 30 days)
  • Owner sends a periodic "I'm Alive" ping to reset the timer
  • If owner does NOT ping within the set period → contract automatically transfers funds to beneficiary

⚙️ How It Works

Owner deploys contract → Sets beneficiary + inactivity period
        ↓
Owner pings "I'm Alive" every 30 days
        ↓
If no ping received after 30 days...
        ↓
Anyone can trigger executeWill()
        ↓
Funds automatically sent to beneficiary ✅

🛠️ Tech Stack

Layer Technology
Smart Contract Solidity ^0.8.19
Blockchain Polygon Mumbai Testnet
Development Hardhat v2.22
Frontend HTML + JavaScript
Wallet MetaMask

📁 Project Structure

cryptowill/
├── contracts/
│   └── CryptoWill.sol      ← Main smart contract
├── artifacts/              ← Compiled contract + ABI
├── scripts/
│   └── deploy.js           ← Deployment script
├── test/
│   └── CryptoWill.test.js  ← Unit tests
├── index.html              ← Working demo
└── hardhat.config.js

🚀 Run Locally

# Install dependencies
npm install

# Compile contract
npx hardhat compile

# Run demo
# Just open index.html in browser!

📜 Smart Contract Functions

Function Description
iAmAlive() Owner resets the inactivity timer
executeWill() Transfers funds to beneficiary after timer expires
timeRemaining() Returns seconds left before execution

👨‍💻 Made for Hackathon

Built to solve the real problem of lost crypto inheritance using trustless smart contracts.


📄 License

MIT

About

Smart contract based crypto inheritance system

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors