1

I have an application where I create an HD wallet with a passphrase and save the public master key to the database for the user.

Then, I want the user to be able to back up the wallet to their own wallet, in this case I am using Wallet32. I restore the account in Wallet32, which uses a key path of m/44'/0'/0'/

On my application side, I am creating the keypath like so (in c#):

KeyPath newKeyPath = new KeyPath("44/0/0/0/0" + nextDerivation);
var childKey = pubkey.Derive(newKeyPath);

The nextDerivsation variable just increments with each purchase. When the derived public key is created on the application side, it doesn't match up with a derived public key in wallet32. So, if a payment is made through the application, Wallet32 doesn't pick it up.

I am using the C# NBitcoin library. When I try to add the apostrophes in the keyPath string like so:

KeyPath newKeyPath = new KeyPath("44'/0'/0'/0/0" + nextDerivation);
var childKey = pubkey.Derive(newKeyPath);

Then I get an "invalid input format" error. I am unsure as to whether those apostrophes are necessary or not, but when I input that same derivation path into the Bip32 generator, then I can create the same public keys. I can send a payment to the derived address and wallet32 picks it up.

Can anyone point me in the right direction on what I need to use for the KeyPath in the NBitcoin library to obtain the same results?

1 Answer 1

1

Response on stackoverflow https://stackoverflow.com/questions/27299204/matching-keypath-in-application-with-wallet32-keypath-for-bip44-wallets/27627358#27627358

Short answer : now the "44'/0'" notation has been implemented, just update your package of NBitcoin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.