Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jellyfish-wallet-mnemonic to support encrypt and decrypt #133

Closed
fuxingloh opened this issue Apr 18, 2021 · 4 comments · Fixed by #480
Closed

jellyfish-wallet-mnemonic to support encrypt and decrypt #133

fuxingloh opened this issue Apr 18, 2021 · 4 comments · Fixed by #480
Assignees
Labels
kind/feature New feature request triage/accepted Triage has been accepted

Comments

@fuxingloh
Copy link
Contributor

What would you like to be added:

  1. jellyfish-wallet-mnemonic with encrypt and decrypt function extended above 24 word.
  2. 24 word must unlock the wallet, this just encrypt the 24 words on rest.

Why is this needed:

The 24 words mnemonic seed should serve as a cold storage of your HD seed.
However the 24 words should not sit in your device (phone/browser/desktop) unencrypted as rest.
Encryption can be done with biometric authentication provided by device, jellyfish-wallet-mnemonic just need to provide the interface to do it.

Reference example: https://github.com/bitcoin/bips/blob/master/bip-0038.mediawiki

@defichain-bot
Copy link
Member

@fuxingloh: Thanks for opening an issue, it is currently awaiting triage.

The triage/accepted label can be added by foundation members by writing /triage accepted in a comment.

Details

I am a bot created to help the DeFiCh developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the DeFiCh/oss-governance-bot repository.

@defichain-bot defichain-bot added the needs/triage Waiting for triage to be accepted label Apr 18, 2021
@fuxingloh fuxingloh added triage/accepted Triage has been accepted and removed needs/triage Waiting for triage to be accepted labels May 28, 2021
@ivan-zynesis
Copy link
Contributor

ivan-zynesis commented May 31, 2021

@fuxingloh Not very certain about the requirement, this is allow user store an the encrypted mnemonic during first time create or import? The encrypted is protected with a "simpler" (than the ori mnemonic seed) user selected passphrase?

interface EncryptionOptions {
  passphrase: string // caller known passphrase
  encryptedSetter: () => void // caller provide storage
  encryptedGetter: () => string
}

static fromSeed (seed: Buffer, options: Bip32Options, encOpt?: EncryptionOptions): MnemonicHdNodeProvider { /* add encryption process here */ }

static from (encrypted: string, passphrase): MnemonicHdNodeProvider // allow user to unlock wallet with simple passphrase within a device with encrypted mnemonic stored

@ivan-zynesis ivan-zynesis self-assigned this May 31, 2021
@fuxingloh
Copy link
Contributor Author

  1. Generate mnemonic seed for cold storage
  2. Generated mnemonic seed must be the actual seed used for signing transaction
  3. Mnemonic seed stored at rest is dangerous
  4. Encrypt mnemonic seed while it's at rest
  5. When the user wants to perform a transaction, decrypt encrypted mnemonic seed

So yeah, the encryption protects the original mnemonic seed at rest. It is only loaded into memory when it's required for a brief period.

@fuxingloh
Copy link
Contributor Author

There is also some flow/complications to this, as the wallet should only encrypt private key. The pubKey should be accessible at rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature request triage/accepted Triage has been accepted
Projects
None yet
3 participants