Update encode_privkey() so that it supports encoding with various magicbytes (for LTC, NMC, etc.).