Skip to content

Instantly share code, notes, and snippets.

@pyramation
Created January 26, 2018 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyramation/7f1855580e717157f3f77509e07435c1 to your computer and use it in GitHub Desktop.
Save pyramation/7f1855580e717157f3f77509e07435c1 to your computer and use it in GitHub Desktop.
const bitcoin = require('bitcoinjs-lib');
var privatekey = process.argv[2]
// NOTE: only wif and pubKeyHash are correct, they were all that is needed for this function to work
const pair = bitcoin.ECPair.fromWIF(privatekey, {
messagePrefix: '\x19Denarius Signed Message:\n',
bip32: {
public: 0x019da462, // TODO DONT USE
private: 0x019d9cfe // TODO DONT USE
},
pubKeyHash: 0x1e,
scriptHash: 0x32, // TODO DONT USE
wif: 0x9e
})
console.log(pair.getAddress());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment