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

Schnorrkel.KeyPair was created by mistake using java. The similar code is as follows. Finally, the address is generated, but in the end I lost my key. Is there any way to help retrieve it? #52

Open
lcers opened this issue Mar 15, 2021 · 1 comment

Comments

@lcers
Copy link

lcers commented Mar 15, 2021

String prvKey = "*****";
ECKey ecKey = ECKey.fromPrivate( Hex.decodeHex(prvKey) );
Schnorrkel.KeyPair rootKey = new Schnorrkel.KeyPair( Hex.decodeHex( ecKey.getPublicKeyAsHex().substring(2 )), ecKey.getPrivKeyBytes() );

Address address = new Address(SS58Type.Network.LIVE, rootKey.getPublicKey())

Where ECKey comes from bitcoinj's lib

@tiantianlikeu
Copy link

hello , How to set the derivation path?
in the code
Schnorrkel.KeyPair key = instance.deriveKeyPair(rootKey, Schnorrkel.ChainCode.from(chainCode));

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

2 participants