Importprivkey does not check base58 prefix

Hi,

you can import NBT private keys as NSR keys. Both the headless and the QT wallet then show the NBT balance as NSR balance and coin control even displays the NBT addresses as sources of the UTXO’s. In short: its a complete mess :slight_smile:

When calculating the public key from the private key, the client should be able to recognize which network is meant by checking the prefix, right? I think it would avoid a lot of headache.

EDIT: I should mention that this is not a serious issue, the blockchain cannot be fooled, but the user can greatly be confused when seeing this after adding the private key to the wrong network:

pi@nubot ~ $ nud -unit=S getbalance
1.8061
pi@nubot ~ $ nud -unit=S sendtoaddress SXPQstDD9GztyWC6gdWwhPQFrdp9RkVoZN 1.8  
error: {"code":-4,"message":"Insufficient funds"}
1 Like

I have confirmed this bug exists. I have asked the team to fix it in the 1.0 release due within 45 days of the passage of the open source motion.

The protocol prevents NSR from being spent as NBT and vice versa, both on the local client and as a broadcast transaction.

1 Like

@sigmike brought it to my attention he documented this as a known issue in our repository in October. We will prioritize fixing it in 1.0.

It used to be worse.

I see this issue was discussed several times. Sorry for the double posting, I did a quick forum search and wasn’t able to find anything that looked directly related.