Inheritance Switch

Decentralized dead man’s switch for $PYUSD$ and encrypted messages.

Inheritance Switch

Created At

ETHOnline 2025

Project Description

Project Description

This project implements a decentralized Dead Man’s Switch leveraging blockchain technology to automate the secure transfer of digital assets and confidential data upon user inactivity. The system allows an owner to lock a specific amount of $PYUSD$ stablecoins and optionally store an encrypted message’s Lighthouse CID within a smart contract deployed on an EVM-compatible blockchain.

The contract requires the owner to check in on-chain at fixed intervals—typically every six months—to confirm their continued presence and control over the account. Each successful check-in updates an on-chain timestamp, effectively resetting the timer. If the owner fails to check in before the deadline expires, a designated beneficiary can trigger a verification process to prove inactivity. Upon successful verification, the contract automatically releases the locked $PYUSD$ to the beneficiary.

In addition, the smart contract stores an immutable reference (CID) to an encrypted message uploaded to Lighthouse, a decentralized storage network. The decryption key for this message is shared privately and off-chain by the owner with the intended beneficiary. This design ensures that sensitive content remains confidential, tamper-proof, and accessible only under predefined conditions.

By combining on-chain logic, tokenized assets, and off-chain encryption, this DApp ensures a trustless, autonomous, and secure inheritance mechanism. It eliminates the need for intermediaries, legal custodians, or centralized services, reducing the risk of censorship, mismanagement, or unauthorized access. The system provides a verifiable and transparent framework for posthumous asset transfer and data delivery, all governed by immutable smart contract rules.

Key Features

Automated Inactivity Detection: The smart contract continuously monitors the owner’s activity through on-chain check-ins. Failure to check in within the defined period (e.g., six months) automatically triggers the eligibility of the beneficiary to claim the locked assets.

Secure Asset Transfer: Locked $PYUSD$ stablecoins are held in the contract and released only under verifiable inactivity, ensuring a fully trustless and transparent transfer mechanism.

Encrypted Message Storage: An optional Lighthouse CID allows the owner to link an encrypted message stored off-chain. The message remains confidential and can only be decrypted by the beneficiary using a key shared privately by the owner.

Full Decentralization: The process operates without intermediaries or centralized control. Both the asset lock and claim mechanisms are executed entirely via immutable smart contract logic.

Data Privacy & Integrity: Sensitive information never resides on-chain. The encrypted message remains tamper-proof in decentralized storage, while blockchain ensures authenticity and traceability of every transaction.

User Flexibility: The owner can update the beneficiary, modify the CID, or extend the check-in duration anytime before inactivity detection, offering complete control and adaptability.

How it's Made

How It’s Made

This project was built as a full-stack decentralized application (DApp) that integrates smart contract automation, tokenized assets, and decentralized storage to create a trustless “Dead Man’s Switch.” The development process combined both on-chain and off-chain components to ensure security, transparency, and usability.

  1. Smart Contract Development

The core logic was written in Solidity and deployed on an EVM-compatible test network using Remix and Hardhat for development and testing. The contract implements functions for:

Locking and holding $PYUSD$ (ERC-20 token) securely.

Recording the owner’s last check-in timestamp on-chain.

Allowing the beneficiary to claim funds after a verified inactivity period.

Storing an optional Lighthouse CID to link an encrypted message.

We used OpenZeppelin libraries to ensure safe and standardized token interactions (e.g., SafeERC20, Ownable) and to minimize security vulnerabilities.

  1. Off-Chain Encryption & Storage

The message component uses Lighthouse, a decentralized storage network built on IPFS. The owner encrypts their message locally in the frontend (using AES encryption) and uploads the ciphertext to Lighthouse, receiving a content identifier (CID). This CID is stored on-chain within the smart contract. The encryption key is never uploaded or stored, ensuring end-to-end confidentiality.

  1. Frontend & User Interface

The DApp frontend was built using React and Ethers.js, allowing seamless interaction with the deployed contract. Users can:

Connect their wallet via MetaMask.

Lock $PYUSD$, set the beneficiary, and define the check-in interval.

Upload encrypted messages to Lighthouse and store the CID.

Perform check-ins or claim actions directly through the web interface.

The frontend handles message encryption before uploading, ensuring privacy by design and preventing plaintext data exposure.

  1. Deployment & Testing

Testing was carried out locally and on testnets using Hardhat scripts and Chai/Mocha for unit testing. Key scenarios such as on-time check-ins, inactivity detection, and token transfers were verified extensively. We also tested CID storage, data retrieval, and event emission for transparency.

  1. Integrations & Benefits

Partner technologies like Lighthouse provided a secure, decentralized method to handle off-chain message storage. OpenZeppelin ensured reliable smart contract standards, while Hardhat simplified deployment and testing pipelines. Together, these components enabled a smooth integration of on-chain logic and off-chain data management.

  1. Notable / Hacky Implementations

Implemented a time-based claim system using block.timestamp to simulate real-world inactivity detection without relying on external oracles.

Designed the encryption workflow to occur entirely client-side, preventing any server from ever accessing sensitive user content.

Integrated Lighthouse uploads directly from the DApp, automatically linking CIDs with smart contract storage to ensure data immutability and verifiable integrity.

background image mobile

Join the mailing list

Get the latest news and updates