Skip to content
This repository has been archived by the owner on Jul 15, 2018. It is now read-only.

Seed phrase has same last word when create a new key #116

Closed
chengwenxi opened this issue Jun 4, 2018 · 3 comments
Closed

Seed phrase has same last word when create a new key #116

chengwenxi opened this issue Jun 4, 2018 · 3 comments

Comments

@chengwenxi
Copy link

chengwenxi commented Jun 4, 2018

When I create a new key, it will return seed phrase with the same last word every time.
This should be caused by keybase.go#50,

typ := cryptoAlgoToByte(algo)
secret = append([]byte{typ}, secret...)

secret[0] is invariable, when BytesToWords, because of secret.length = 21 and words.length = 2048(2^11), the last word index = f(secret.bits[21 * 8-11 * 15]) = f(secret.bits[3]) = f(secret[0].bits[0,2]),is also invariable.

typ := cryptoAlgoToByte(algo)
secret = append(secret, []byte{typ}...)
will avoid it.

@liamsi
Copy link
Contributor

liamsi commented Jun 4, 2018

Thanks a lot for raising this issue! We are currently refactoring the code you mentioned and the key-type won’t be encoded in like above anymore. Also, we will only support Secp256k1 keys initially. This makes the whole key-type obsolete.

Related issues/discussions: #85 (comment) and #89 (comment)

@chengwenxi
Copy link
Author

chengwenxi commented Jun 4, 2018

Yes, it's important to be compatible with cosmos fundraiser keys.

@liamsi
Copy link
Contributor

liamsi commented Jul 3, 2018

This should be obsolete now!

@liamsi liamsi closed this as completed Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants