Skip to content

Commit

Permalink
Merge pull request #3422 from miohtama/patch-2
Browse files Browse the repository at this point in the history
Clarify that 0x prefix is needed for imported private keys
  • Loading branch information
holgerd77 authored Mar 20, 2020
2 parents a6ddec5 + 8de0d3e commit a25ba79
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/web3-eth-accounts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,18 @@ privateKeyToAccount
Creates an account object from a private key.

For more advanced hierarchial address derivation, see
[truffle-hd-awallet-provider](https://github.com/trufflesuite/truffle/tree/develop/packages/hdwallet-provider)
package.

----------
Parameters
----------

1. ``privateKey`` - ``String``: The private key to convert.
1. ``ignoreLength`` - ``Boolean``: If set to true does the ``privateKey`` length not get validated.
1. ``privateKey`` - ``String``: The private key to import. This is 32 bytes of random data.
If you are supplying a hexadecimal number, it must have `0x` prefix in order to be in line
with other Ethereum libraries.
2. ``ignoreLength`` - ``Boolean``: If set to true does the ``privateKey`` length not get validated.

-------
Returns
Expand Down

0 comments on commit a25ba79

Please sign in to comment.