Post
Topic
Board Bitcoin Technical Support
Re: createrawtransaction: Invalid private key
by
achow101
on 19/11/2015, 20:48:45 UTC
OK but here is a simple example:

Code:
bitcore = require('bitcore');
bitcore.Networks.defaultNetwork = 'testnet';
var privateKey = new bitcore.PrivateKey();
console.log('privateKey: ' + privateKey);
var exported = privateKey.toWIF();
console.log('privateKey toWIF: ' + exported);
and the output is:
Code:
privateKey:       13421db757900dae2ecd471b2cca0d950f8ca47fd867e3c44dadd64f57194252
privateKey toWIF: 1eSGCW9EJ8pUZ6QEpa3385at83n3hdXrJ57VpmmFQRSv3JcMVHW
Something is definitely wrong with your install of Bitcore. It is not producing the proper WIF key. Again, it should start with a 'c' or '9'. In most cases, it should be a 'c'