Custodial Wallet on Flow

Hey everyone, based on this article Flow: Inside Flow: The Power of Simplicity with FCL could you provide any guidance on how to build a custodial wallet with FCL?

Tnx

Hey @dh77! Super cool that you’re interested in building a custodial wallet.

Just for clarification, are you building custodial wallet for the purpose of

  • users to use on other applications, or
  • for control over what users can do on your own application?

Tnx @kimcodeashian - we are building something similar to NBA Top Shot - the custodial wallet will hold all the private keys from our users to control what they can do in our own application.

hey @dh77, You need to be a FCL wallet provider if you will use FCL for custodial wallet. you can check out GitHub - onflow/flow-wallet-api-node-demo

Thank you @bluesign Appreciate it. That is very interesting indeed - but still in very early development. It looks promising though. It would definitely be great to get more documentation about the usage - @pete :slight_smile:

Adding a bit more to this topic - I was given a hint that could solve this:
You can enable people to use Blocto wallet for auth which gives them full control over their accounts. But, if you adjust the Smart Contract a little bit, you can restrict the token transfer from one account to another - every transfer would need a centralised approval, and this will have to come from you.
This way, the users own full control of their accounts but can not transfer tokens without your approval. Sounds like a cool idea. Thoughts?

“you can restrict the token transfer from one account to another”

this part is a little problematic :slight_smile: Tokens are just resources, users can basically move them without your contract.

Tnx @bluesign - this is the piece of code that has been shown to me (it should handle the approval process):

access(all) contract SimpleAdmin {
pub resource Admin {
pub fun check(): Bool {
return true
}
}

init() {
    let admin <- create Admin()
    self.account.save(<-admin, to: /storage/simpleAdmin)
    self.account.link<&Admin>(/private/simpleAdminCapability, target: /storage/simpleAdmin)
}

}