I've compiled a version of geth where I modified CalcDifficulty() in core/block_validator.go to make mining difficulty constant, see reference. Starting up the private chain, creating accounts and mining works fine.

If I try via the javascript console to unlock an account, it works, and returns true.


But when I try to send a transaction:

personal.sendTransaction({from:eth.accounts[0], to: eth.accounts[1], value: 20000000})

I get the following:

Error: could not decrypt key with given passphrase
    at web3.js:3104:20
    at web3.js:6191:15
    at web3.js:5004:36
    at <anonymous>:1:1

1 Answer 1


The personal.sendTransaction method expects a second argument, the password to ephemerally unlock the account with and send the transaction in one go. If you don't provide a password, this endpoint defaults to the empty password, resulting in your issue.

If you want to use an already unlocked account to send a transaction (instead of the ephemeral unlock-and-send), you can do so with eth.sendTransaction.

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.