I created an account on metamask, and downloaded the json of my wallet.

It's on rinkeby.

The structure of the json is

            "cipherparams":{ "iv":"..." },

My question is related to web3.js, where signing transaction requires a private key.

What is this private key? Is part of the json above?

2 Answers 2


You can also obtain it programmatically:

const keythereum = require("keythereum");
console.log(keythereum.recover(yourPassword, yourJsonObject).toString("hex"));

Found my answer.

On metamask, I can export private key of selected account

enter image description here

Click on the threedots

enter image description here

Click on Account details

enter image description here

Click on export private key.

It now ask you a password: it's the Metamask password. It's specific to metamask.

Then it will show you the private key.

Keep it absolutely private, do not share, do not save on cloud!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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