It transpires that the adapted Spreadcoin customised address generator produces uncompressed keys - this explains why the customisation is lost on importing the (uncompressed) privkey.

As evidenced by the addresses shown in the wallet, Slimcoin takes a compressed-key-by-default approach, inherited from PPCoin.

This was the original output from

`makekeypair`before I adjusted it (prematurely, it would seem) to remove the uncompressed part:

* secret (hex): f092e90100000000c693e90100000000c693e901000000000000000000000000

* : uncompressed

* secret (base58): 7S78qD9aBwpiCNCZsx9BmMKtsLY58p2zWKftnSPJkyV1SQULjGz

* pubkey (hex): 0480d647bf15e05abcad608725c56fd7722a76335ad248fcf4032f7ae7d3ae09be4b13b00a4853b bf4cd00a1b1812cd401da8386405613a4927110e1db4cf21f19

* address (base58): SkM4auwYLe4R59zkXFnVJ3tCzCkZGms9cu

* : compressed

* secret (base58): VPp5ZncqVJyaqAa47tP8WkiPwBE9FUbnpRQfZZ3TP6Jcvtmy6WWR

* pubkey (hex): 0380d647bf15e05abcad608725c56fd7722a76335ad248fcf4032f7ae7d3ae09be

* address (base58): Siy45aBFsMzqtDEik4taLgDucHm5Tf1BdR

* secret (hex): f092e90100000000c693e90100000000c693e901000000000000000000000000

* : uncompressed

* secret (base58): 7S78qD9aBwpiCNCZsx9BmMKtsLY58p2zWKftnSPJkyV1SQULjGz

* pubkey (hex): 0480d647bf15e05abcad608725c56fd7722a76335ad248fcf4032f7ae7d3ae09be4b13b00a4853b bf4cd00a1b1812cd401da8386405613a4927110e1db4cf21f19

* address (base58): SkM4auwYLe4R59zkXFnVJ3tCzCkZGms9cu

* : compressed

* secret (base58): VPp5ZncqVJyaqAa47tP8WkiPwBE9FUbnpRQfZZ3TP6Jcvtmy6WWR

* pubkey (hex): 0380d647bf15e05abcad608725c56fd7722a76335ad248fcf4032f7ae7d3ae09be

* address (base58): Siy45aBFsMzqtDEik4taLgDucHm5Tf1BdR

The difference between compressed and uncompressed being:

Code:

def test_get_uncompressed_pubkey_from_compressed_pubkey():

"""

Uncompressed pubkey from compressed pubkey

"""

def pow_mod(x, y, z):

"Calculate (x ** y) % z efficiently."

number = 1

while y:

if y & 1:

number = number * x % z

y >>= 1

x = x * x % z

return number

compressed_key = "0380d647bf15e05abcad608725c56fd7722a76335ad248fcf4032f7ae7d3ae09be"

p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f

y_parity = int(compressed_key[:2]) - 2

x = int(compressed_key[2:], 16)

a = (pow_mod(x, 3, p) + 7) % p

y = pow_mod(a, (p + 1) // 4, p)

if y % 2 != y_parity:

y = -y % p

uncompressed_key = '04{:x}{:x}'.format(x, y)

print(uncompressed_key)

# 0480d647bf15e05abcad608725c56fd7722a76335ad248fcf4032f7ae7d3ae09be4b13b00a4853bbf4cd00a1b1812cd401da8386405613a4927110e1db4cf21f19

"""

Uncompressed pubkey from compressed pubkey

"""

def pow_mod(x, y, z):

"Calculate (x ** y) % z efficiently."

number = 1

while y:

if y & 1:

number = number * x % z

y >>= 1

x = x * x % z

return number

compressed_key = "0380d647bf15e05abcad608725c56fd7722a76335ad248fcf4032f7ae7d3ae09be"

p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f

y_parity = int(compressed_key[:2]) - 2

x = int(compressed_key[2:], 16)

a = (pow_mod(x, 3, p) + 7) % p

y = pow_mod(a, (p + 1) // 4, p)

if y % 2 != y_parity:

y = -y % p

uncompressed_key = '04{:x}{:x}'.format(x, y)

print(uncompressed_key)

# 0480d647bf15e05abcad608725c56fd7722a76335ad248fcf4032f7ae7d3ae09be4b13b00a4853bbf4cd00a1b1812cd401da8386405613a4927110e1db4cf21f19

Anyway, in the course of getting to the nitty-gritty of the compressed/uncompressed issue, I forked bip32.org’s javascript-hosted Hierarchical Deterministic Key Generator, configured it to use an extended public/private keypair of my own invention that I considered appropriate for Slimcoin -

`spub`(

`0xef6adf10`) and

`sprv`(

`0xef69ea80`), committed the changes and configured the github pages rendering.

It's a standalone web page which can be hosted locally, disconnected from the net, for extra peace of mind.

Cheers

Graham