Code Monkey home page Code Monkey logo

Comments (4)

Alex-Werner avatar Alex-Werner commented on August 15, 2024

Hello @mmick66

Thank you for noticing this, yes, this is to me the biggest issue I have with wallet-lib.
But it is actually more than just that, right now, for the sake of the exportWallet() function, mnemonic and root keys (seed) are stored.
But this information is not needed as we could at least have a derivation path (so we don't make other chain using the same mnemonic vulnerable).
There is indeed on top of that the secure storage issue (which so far were left for pull request but no one really made one yet).

What I can say is that we do have this planned, but its priority is delayed due to more immediate need.
So I can't give any ETA yet (I hope we are talking about end of year).
But let's use this issue to discuss the subject in the meantime.
Would any users have specific requests on that subject, please forward it here as we will use this issue to ensure we match requirements.

from platform.

mmick66 avatar mmick66 commented on August 15, 2024

Thank you for your honest reply. For the moment, and as I am trying to use this library on a current project that I'm working on, I though of the following pattern for mobile devices. I am going to post it here for others to see, as well as for you @Alex-Werner to give me an opinion.

autodraw 28_09_2021 (1)

To create a wallet you:

  1. Generate a new Mnemonic through the helper function. You then show it to the user, who is then made responsible for storing it.

  2. You create an HDPrivateKey, and from that, a (standard) PrivateKey.

  3. You create a PublicKey and Address and instantiate the Wallet with either as an WALLET_TYPES.ADDRESS or WALLET_TYPES.PUBLICKEY respectively. At this point, only the PublicKey and/or Address are going to be saved in-memory.

  4. You discard both Mnemonic and HDPrivateKey from memory, and save the PrivateKey in a secure storage.

  5. Whenever you want to sign a transaction (or Message), you unlock the PrivateKey from storage using whatever mechanism you with (pin, TouchID, FaceID etc) and pass it to the sign function of the Account, which is going to pass it to the sign function of the KeyChain.

from platform.

Alex-Werner avatar Alex-Werner commented on August 15, 2024

Thank you for this.
Indeed the plan is exactly what you describe !
Keep me update about your progress, so I can see if at some point I need / can prioritize slightly more.

In wallet-lib case, it will be specific, we still require a HD key (but at lower level), for us to be able to generate additional public address (BIP44), or identities.

So the path will be specific to BIP44/dash,... for change and external.

We also manage identities, so we also have that

from platform.

mmick66 avatar mmick66 commented on August 15, 2024

Sure, I get what you are saying. Currently, and for the purposes of my project, I need a "single address" wallet only. Basically, and for my current purposes, a wallet will be (practically) synonymous to an account. I will keep you posted if and when I encounter problems. Thanks again for the swift response.

from platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.