project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5

Afterwise

Trustless Inheritance Vaults for your loved ones and yourself

Afterwise

Created At

ETHGlobal Lisbon

Project Description

Afterwise offers a trustless platform specifically designed for transferring digital inheritances and safeguarding digital wealth. With Afterwise, users can securely deposit and invest their digital assets through the Afterwise Safe Vault. What sets Afterwise apart is its remarkable flexibility, allowing users to designate beneficiaries as desired, even including themselves.

A key Afterwise feature is its dead man switch functionality. This feature ensures a automated and seamless distribution of assets to intended recipients. With Afterwise, users can have peace of mind knowing that their digital wealth will be transferred to their chosen beneficiaries in a reliable and efficient manner.

Overall, Afterwise offers a comprehensive and robust platform that addresses the critical needs of securely managing and transferring digital inheritances. By leveraging blockchain technology and providing user-friendly functionalities, Afterwise empowers individuals to safeguard their digital assets and ensure their smooth transfer to future generations.

How it's Made

The Afterwise platform's tech stack integrates wallets "wagmi" with "rainbowKit" in order to make it compatible with a variety of wallets when it comes to the frontend and more easily interact with "ethers.js". We also leveraged the "safe-core-sdk" in order to interact with Safe contracts. A small hacky thing to mention with these libraries is that we had to downgrade both "wagmi" and "rainbowkit" (from v1 to the latest non-v1), because their latest version make use of "viem" instead of "ethers.js", and the "safe-core-sdk" has no adapters for "viem"; on that note, we also had to downgrade "ethers.js" (from v6 to v5.7.2) to also make it compatible with the "safe-core-sdk", crypto tech moves fast!

On the smart contract part, we made our own custom Safe module for the dead-man switch mechanism. This meant making use of the Solidity "@gnosis.pm/zodiac" libraries which contains the "Module.sol" contract that our custom module needed to inherit from. This custom module has two main functions, and one auxiliary:

  • "extendValidity" which allows the related Safe (and only the Safe) to add seconds to the expiration variable, this is the core of the dead-man switch; when the Safe owner calls this function, they are signalling that they still have access to their key

  • "claimSafe" which allows the beneficiary (and only the beneficiary) to execute any arbitrary transaction to the Safe only after the expiration timestamp has passed; we decided to make it any arbitrary transaction because we wanted to let the beneficiary decide whatever they wanted (becoming the Safe owner, transferring all assets, ...), however it's important to note that the frontend gives, to the beneficiary, the transaction data to become the owner

  • "setBeneficiary" which is only useful if the owner decides to update the beneficiary

We think these are the most important functions for this hackathon, but of course this module could be improved by making the beneficiary private, or by having a list of beneficiaries who will become the Safe owners.

Overall, when a user creates a vault on the frontend, they deploy a 1/1 Safe (meaning they are the only owner/signer of the Safe), a Safe module, which they then initialize with their beneficiary and first expiration (small technical point: we could do the initialization when deploying the Safe module but which focused on dev simplicity for this hackathon in order to have a working prototype). They do a final transaction to link the module to the Safe. All these steps are presented nicely in the frontend to guide the user. After which they have access to a nice dashboard where they can start depositing assets to their Safe, extend the validity and update beneficiary.

To recap, the frontend mainly uses "wagmi" and the "safe-core-sdk" while the backend makes use of Safe and Safe module contracts.

background image mobile

Join the mailing list

Get the latest news and updates