Post
Topic
Board Bitcoin Technical Support
Re: createrawtransaction: Invalid private key
by
achow101
on 19/11/2015, 20:11:07 UTC
Quote
Where did you get the private keys?
It has been generated by bitcore (node.js), for testnet.
Code:
var privateKey = new bitcore.PrivateKey();
the key has 64 char
the WIF format is 14xCi3eQ3AJvk...xyEQRooQNv1GGQSb
and has 52 char
No, WIF format is 51-52 chars and should start with '9' or 'c'. The private key you have is the raw hex code. According to the docs at https://bitcore.io/api/lib/private-key you will need to use the toWIF() function in order to get the WIF key which you need. You cannot use the raw hex key.