Skip to content

Instantly share code, notes, and snippets.

@makevoid
Last active January 24, 2018 23:22
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 makevoid/8bfc85e475e5666d2d028f3d4e9a6ffc to your computer and use it in GitHub Desktop.
Save makevoid/8bfc85e475e5666d2d028f3d4e9a6ffc to your computer and use it in GitHub Desktop.
Bitcore-lib PrivateKey to Web3 account
const Web3 = require('web3')
const web3 = new Web3("http://mainnet.infura.io")
const eth = web3.eth
const bitcore = require('bitcore-lib')
const PrivateKey = bitcore.PrivateKey
const privateKey = new PrivateKey()
eth.accounts.privateKeyToAccount(`0x${privateKey.toString()}`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment