Post
Topic
Board Bitcoin Technical Support
Re: createrawtransaction: Invalid private key
by
redPanda
on 19/11/2015, 20:38:52 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