Home

Awesome

<div align="center"> <h1 align="center">Candide Contracts</h1> </div>

atelier-meta-web

About

Candide Wallet is a smart contract wallet for Ethereum Mainnet and EVM compatible rollups.<br/> This repo includes the smart contracts used by Candide Labs.

Features

Account Recovery

In this section, we highlight and explain the SocialRecoveryModule.sol contract.

The Account Recovery module is designed to work for both a single-owner account and an n-m multi-sig account. In the case of the single-owner account, the signer key is typically stored on the user's device. More specifically, owners can add recovery addresses (also known as Guardians) to change the ownership of the account, in case their signer key is lost or compromised.

Recovery methods are typical Ethereum accounts. They can be:

Normal operations of the Account do not require the approval of added Guardians in the module.

Owners of the account decide the threshold for the number of guardians needed for recovery, as well as the number of guardians. A typical single-owner account can have 3 guardians with a threshold of 2. This decreases the likelihood that a single guardian can overtake the account.

Owners are encouraged to ask their guardians to provide fresh addresses. This makes them private and eliminates the possibility of malicious guardians cooperating against an owner. By design, a guardian does not need to necessarily store value in their account to maintain their duties, even during a recovery process.

Once the recovery is initiated, the owners have until the delayPeriod to cancel the recovery, if the initiation was done with malicious intent. Once the delayPeriod is over, anyone can finalize the recovery to update the ownership of that particular Safe Wallet.

Account Recovery interfaces can be built with or without a backend service:

High-Level specs of methods

We assume that the signer key belongs to its real owner. The probability of the signer key being in control of someone else should be close to zero. Under this model, we can build a simple yet highly secure non-custodial wallet. To enable that model to evolve if needed, upgrading the wallet to a new implementation requires the approval of only the owner of the account.

MethodOwnerGuardiansAnyoneComment
addGuardianWithThresholdXOwner can add a guardian with a new threshold
revokeGuardianWithThresholdXOwner can remove a guardian from its list of guardians
confirmRecoveryXLets a single guardian approve the execution of the recovery request
multiConfirmRecoveryXLets multiple guardians approve the execution of the recovery request
cancelRecoveryXLets an owner cancel an ongoing recovery request
finalizeRecoveryXFinalizes an ongoing recovery request if the recovery period is over. The method is public and callable by anyone

Audit

Development

Install dependencies

yarn install

Add required .env variables

cp .env.example .env

Run tests

yarn build
yarn test

Run FV

certoraRun certora/conf/SocialRecoveryModule.conf
certoraRun certora/conf/GuardianStorage.conf
certoraRun certora/conf/RecoveryConfirmationSignatureValidity.conf

Note: You will need to install Certora CLI and a valid Certora Key for running FV. To provide a custom solc path, use --solc flag.

<!-- LICENSE -->

License

GNU General Public License v3.0

<!-- ACKNOWLEDGMENTS -->

Acknowledgments