project screenshot 1
project screenshot 2
project screenshot 3

DigitalWill

The Digital Will DApp allows users to securely manage and distribute their digital assets, such as cryptocurrencies and NFTs, after they pass away. Through this decentralized application, users can create a digital will by specifying assets and beneficiaries, appoint an execut

DigitalWill

Created At

ETHOnline 2024

Project Description

The Digital Will DApp is a decentralized application designed to facilitate the management and transfer of digital assets, such as cryptocurrencies and NFTs, in a secure and transparent manner after a user's death. Utilizing blockchain technology, the application allows users to create a digital will, detailing the allocation of their digital assets to designated beneficiaries. An appointed executor is responsible for carrying out the will’s instructions. The system offers an efficient and tamper-proof solution to digital estate planning, providing peace of mind to users in the management of their online wealth. This innovative approach eliminates the need for intermediaries and ensures that assets are distributed according to the creator’s exact wishes, while also offering privacy and immutability inherent in decentralized systems.

How it's Made

What I’ve built is a Digital Will DApp (Decentralized Application) that allows users to create, update, and execute wills for their digital assets on the blockchain. The DApp facilitates the secure transfer of ERC20 tokens (such as cryptocurrencies) and ERC721 tokens (like NFTs) to designated beneficiaries upon the owner's death or incapacitation.

  1. Smart Contract - DigitalWill.sol I developed a Solidity smart contract that manages the core logic of the will system on the Ethereum blockchain. Creating a Will: I designed the contract to let users create wills by specifying beneficiaries, along with ERC20 tokens, their amounts, and ERC721 tokens (NFTs) and their respective token IDs. The smart contract stores this information securely on the blockchain, linked to the owner’s address. Executing a Will: In the event of death or incapacitation, I implemented functionality where the beneficiary can execute the will, transferring all assets (ERC20 and ERC721 tokens) to themselves. The contract checks that the will hasn’t been executed before and ensures the caller is the designated beneficiary. Updating a Will: I included an update function, allowing the will creator to modify the will—changing beneficiaries or altering the assets to be transferred—as long as the will hasn't been executed. Viewing Will Details: I also implemented a way to view a will's details, including the beneficiary, the listed tokens, and whether the will has been executed.
  2. Frontend (HTML + Ethers.js) To make the DApp user-friendly, I developed a frontend using HTML and integrated Ethers.js to interact with the blockchain. Creating a Will (UI Form): I created a simple form where users can input the beneficiary’s address, token details, and submit it. This interacts with the smart contract's createWill function, which registers the will on the blockchain. Executing a Will (UI Form): I added functionality so that the beneficiary can input the will owner’s address and claim their assets by executing the will through the frontend, triggering the executeWill function on the smart contract. Viewing Will Details: Users can input the owner’s address to retrieve and view will details, including token information and execution status.
  3. MetaMask and Ethers.js Integration I integrated MetaMask into the DApp for authentication and signing transactions, while Ethers.js facilitates blockchain interaction. MetaMask Integration: I ensured that users can connect their MetaMask wallet to the DApp, allowing them to interact with their Ethereum accounts to create or execute wills. Ethers.js for Smart Contract Interaction: Using Ethers.js, I linked the frontend to the smart contract on Ethereum, enabling users to execute functions like createWill, executeWill, and getWill by interacting with the smart contract directly from the UI.
  4. Key Features Decentralization: Since wills are stored on the blockchain, the system is entirely decentralized and immutable. I ensured that once a will is created, it cannot be altered by any third party. Security of Digital Assets: I built the system to securely transfer digital assets (ERC20 and ERC721 tokens) to the designated beneficiaries upon will execution. Automation and Finality: After a will is executed, the assets automatically transfer to the beneficiary, eliminating the need for legal intermediaries. Summary: With this project, I’ve built a decentralized will management platform, leveraging Ethereum's blockchain technology. The DApp allows users to create, update, and execute wills for their digital assets in a secure, transparent, and automated manner. By integrating Solidity, MetaMask, and Ethers.js, I’ve ensured that the system offers a seamless experience for users to manage their wills and digital assets without relying on intermediaries.
background image mobile

Join the mailing list

Get the latest news and updates