MetacoSA / NBitcoin

Comprehensive Bitcoin library for the .NET framework.
MIT License
1.88k stars 848 forks source link

unable to parse LTCTEST BIP32 public key #996

Closed nwasiq closed 3 years ago

nwasiq commented 3 years ago

ExtPubKey.Parse("ttubxxxBIP32_PUB_KEY", NBitcoin.Altcoins.Litecoin.Instance.Testnet);

The above code returns the error: Unhandled exception. System.FormatException: Invalid base58 string

What should I do differently? I'm able to parse LTC BIP32 pub key just fine

DanGould commented 3 years ago

"ttubxxxBIP32_PUB_KEY" is, as the error describes, NOT a valid base58 string. You need to pass a valid pubkey.

nwasiq commented 3 years ago

ofcourse this is not my real pub key. That same pubkey works fine on bitcoinjs-lib so I know that it's valid

nwasiq commented 3 years ago

Solved the issue by adding a LitecoinTestnetAddressStringParser like the LitecoinMainnetAddressStringParser in the Litecoin class.

NicolasDorier commented 3 years ago

you made a PR?

nwasiq commented 3 years ago

Just did:

https://github.com/MetacoSA/NBitcoin/pull/1023