Closed PegasusWallet closed 5 years ago
Not sure how BitcoinJ works internally but if there are no add-ons it is most likely using secp256k1 curve whereas Stellar is using ed25519. So it's not only about changing the seed.
Anyway, if you decide to do it I think we should have another package for key derivation that allows developers to generate a secret seed for a given mnemonic seed and key path that can later be used to create a Keypair
object.
Yes indeed there is actually a bit more work that what I thought. secp256k1 is heavily hardcoded in bitcoinj code using spongycastle (which does not even support ed25519 but only curve25519) and all the interesting classes are final which makes it difficult to reuse the code.
I have a working code that allows me to
I can match all the testing vector in the SEP-0005 document.
(This is an example to generate an account for index 0) https://imgur.com/a/1YSO7
But for now I'm using the entire BitcoinJ library + modified some of the classes. I will need to clean it up and only extract the usefull class to be able to create a PR
Hey guys, I wrote a .NET version of BIP39 based on the Javascript one. It's fully functional, we plan to integrate this into our .NET SDK. But could you use this as a starting point for the Java version maybe? It has zero external dependencies which were one of the goals, so it does not depend on any external frameworks.
@elucidsoft I glanced at your repository and it seems there's the same problem I mentioned in my first comment. Specifically:
Not sure how BitcoinJ works internally but if there are no add-ons it is most likely using secp256k1 curve whereas Stellar is using ed25519.
Also, what do you mean by saying:
But could you use this as a starting point for the Java version maybe?
That's a non issue with ed25519. Mainly what I meant was to remove the dependency issue you have with BitcoinJ.
Ok so I finally got some time to work on this, I have published the results here https://github.com/elucidsoft/dotnetstandard-bip32/tree/master
It's working and all the unit tests mentioned in the spec are passing.
So I went ahead and built a tiny little HD Wallet Project as well with a bunch of unit tests that combines BIP39 and BIP32 together to demonstrate it working. https://github.com/elucidsoft/dotnetstandard-stellar-hd-wallet
@PegasusWallet Could you be kind and share the source where you translate BIP39 seeds to a valid Stellar KeyPair? Thanks in advance
All source is on my GitHub
On Wed, Oct 24, 2018, 8:41 AM Filip Mićić notifications@github.com wrote:
@PegasusWallet https://github.com/PegasusWallet Could you be kind and share the source where you translate BIP32 seeds to a valid Stellar KeyPair? Thanks in advance
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stellar/java-stellar-sdk/issues/74#issuecomment-432638970, or mute the thread https://github.com/notifications/unsubscribe-auth/AANRUJmciH0vY9x-82AZXe8gAlC1G6sPks5uoGALgaJpZM4Ruclp .
Thank you @elucidsoft , but I was asking about @PegasusWallet source code. Because of the Java implementation
Closed in #148.
99% of the code is already done in BitcoinJ and really just a matter of rewriting the Key derivation to use the right "ed25519 seed" instead of "Bitcoin seed"
@bartekn Do you already have something planned or should I go ahead and prepare a PR ?