- [ ] Define a type wrapping FactorInstance -> MFAFactorInstance. FactorInstance has everything needed, but wrap in a type to allow extensibility. - [ ] Define a new entry in Profile in `networks` to store derived MFAFI. - [ ] Define a new Sargon API something like `getNewMFAPublicKey`: - MFAFI storage is empty: - Derive transaction signing securified factor instance. To decide if only 1 or many like 10. - Store the MFAFi. - Return the derive public key or/and signature NonFungible GlobalId to the Wallet. - Wallet displays the public key or/and signature NonFungible GlobalId. - MFAFI storage is not empty: - Before deriving any new key(s) check if the currently stored keys are free by calling Gateway -> https://radix-babylon-gateway-api.redoc.ly/#operation/EntitiesByRoleRequirementLookup. - If there is a free public key in storage just return it. - Otherwise derive a new one. # Algo 1. Read MFAFI from storage 2. Check MFAFIs usage through https://radix-babylon-gateway-api.redoc.ly/#operation/EntitiesByRoleRequirementLookup. 3. If there is a MFAFI not used, return it. 4. Otherwise -> derive new MFAFIs(Derive transaction signing securified factor instance). Take of properly increment the derivation path index. 5. Store new MFAFIs in storage. 6. Repeat 2. # References - https://github.com/radixdlt/sargon/blob/b5aa76421a52e734a1689940ffe0c0c43a105a7c/crates/system/os/os/src/mfa/factor_instances_derivation.rs#L105
networksto store derived MFAFI.getNewMFAPublicKey:Algo
References
sargon/crates/system/os/os/src/mfa/factor_instances_derivation.rs
Line 105 in b5aa764