I am at Geth/v1.9.0-stable-52f24617/linux-amd64/go1.11.5

web3JS version is giving :

> web3.version
  api: "0.20.1",
  ethereum: "0x2712",
  network: "4",
  node: "Geth/v1.9.0-stable-52f24617/linux-amd64/go1.11.5",
  whisper: undefined,
  getEthereum: function(callback),
  getNetwork: function(callback),
  getNode: function(callback),
  getWhisper: function(callback)

I have an account address, private key and passphrase and now want to import it into in my geth account. One way I got is using


but, this is not working with the current version I have, it is giving me undefined


It seems you are using a function from Web3.js 1.x:

However the console from Geth uses web3.js 0.20.1, which is documented here:

You could use the Geth function: personal.importRawKey(keydata, passphrase):

Alternatively you could use web3.js 1.x from for example node.js
Install web3:

npm install web3

Start geth with RPC interface

geth --rpc 

And the create a test.js:

const Web3 = require('web3');
const web3 = new Web3('http://localhost:8545' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.