There are many different ways of implementing it, with many trade-offs.
But here is a possible option: Alice wants to create a multi-factor wallet that 2-out-3 guardians about Bob, Charlie and Eve can recover.
- Alice creates a normal account on the blockchain.
- Alice creates the required application or opt-in to an application provided by the wallet company (the second option is probably better). As part of the application creation / application opt-in, Alice specifies the policy (2-out-of-3) and the addresses of the 3 guardians.
- Alice then signs a delegated logic signature that allows her account to be controlled by the application
Normally, Alice uses her normal secret key.
Alice can change her guardians and policy at any time by calling the smart contract.
But in case of loss of her secret key, she can ask Bob and Eve (for example) to perform a recovery action, e.g., rekeying to a fresh new key. The recovery action may be for example a group of 3 transactions:
- An application call from Bob to the application specifying that it agrees rekeying of Alice’s account to her new key.
- Similar application call from Eve. This application call will fail if it is not also done by Bob before - according to the policy)
- A rekey transaction allowed by the delegated logicsig (that will verify the presence of the previous application call)
You can imagine even more advanced flows where even normal transactions are approved by the application. This can be useful to allow large transactions to gather further approval.