chaintope / bitcoinrb

The implementation of the bitcoin protocol for ruby.
MIT License
61 stars 19 forks source link

Method to restore mnemonic to db #55

Closed kannapoix closed 4 years ago

kannapoix commented 4 years ago

Wallet::Base class only has create method which create new mnemonic.
It is useful if there is method which restore master key from mnemonic.

Is this in the scope of this library? If so, I will make PR.

azuchi commented 4 years ago

Wallet::Base was intended to be a wallet running as part of a lightweight node(not complete), so the key information is stored in a file. Therefore, if you specify a wallet id, path and call load, Wallet::Base will be restored.

If you want to create or restore only mnemonic, you can use Bitcoin::Wallet::MasterKey.

kannapoix commented 4 years ago

I already implement restore from mnemonic by using Bitcoin::Wallet::MasterKey as you said.
I understood wallet feature is mainly exist for lightweight client. Maybe restoring from mnemonic is over feature and it's not hard to implement by user it self.