Post
Topic
Board Bitcoin Technical Support
Re: createrawtransaction: Invalid private key
by
achow101
on 19/11/2015, 21:25:56 UTC
If I understand well, the private key is the same in livenet and tesnet:
the private key is just a ramdom number and the WIF format will
also be the same.
No. The WIF format will be different to indicate which network that private key is meant for. For testnet it will start with 'c' or '9'. On the mainnet it will start with '5', 'K' or 'L'

Then we calculate the by adding points on a elliptic curve,
so the pubkey is a pair of coordinates (x,y). Then we write the pubkey
like "04 x y" OR "02 x" (if y is positive) OR "03 x" (if y is negative).
It is only when we create the base-58 pubkey that we use a different
format so the pubkeys looks different in testnet and livenet.
Yes. Only after doing base58CheckEncoding to create the WIF format will the private key (encoded as WIF) and public key (encoded as an address) appear different.