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

docs and implementation of NewWallet and Wallet.GenerateAddresses need a review #981

Closed
isaacvr opened this issue Nov 2, 2019 · 0 comments
Milestone

Comments

@isaacvr
Copy link

isaacvr commented Nov 2, 2019

While trying to use skycoin/services#6, with the seed, generated by skycoin/services#12, I have found following issues:

Docs for wallet.NewWallet claims that wallet generates a random seed if seed is "". Also it does not mention which encoding is expected.

However:

  1. wallet.NewWallet returns error if seed is "" - https://github.com/skycoin/skycoin/blob/feaab10d4f951b8ffea53ef2d37a4cf5e3450b17/src/wallet/wallet.go#L80-L82

  2. Wallet.GenerateAddresses does not check for empty seed and on the first pass does not generate new one. Also, on the first pass it converts seed directly to byte representation, while the rest of the code assumes that seed is hex-encoded.
    https://github.com/skycoin/skycoin/blob/feaab10d4f951b8ffea53ef2d37a4cf5e3450b17/src/wallet/wallet.go#L212-L225

  3. wallet.NewService uses bip39 to generate wallet's seed and does not encode it to hex.
    https://github.com/skycoin/skycoin/blob/feaab10d4f951b8ffea53ef2d37a4cf5e3450b17/src/wallet/service.go#L52-L61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant