Generating Ethereum address on Windows

As Bilal suggested, a separate topic for the process of generating Ethereum address on Windows.

  1. Install openssl from here
  2. Install geth from https://geth.ethereum.org/downloads/
  3. Generate key pair using “openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout > Key”. The result will look like this:

Private-Key: (256 bit)
priv:
20:80:65:a2:47:ed:be:5d:f4:d8:6f:bd:c0:17:13:
03:f2:3a:76:96:1b:e9:f6:01:38:50:dd:2b:dc:75:
9b:bb
pub:
04:83:6b:35:a0:26:74:3e:82:3a:90:a0:ee:3b:91:
bf:61:5c:6a:75:7e:2b:60:b9:e1:dc:18:26:fd:0d:
d1:61:06:f7:bc:1e:81:79:f6:65:01:5f:43:c6:c8:
1f:39:06:2f:c2:08:6e:d8:49:62:5c:06:e0:46:97:
69:8b:21:85:5e
ASN1 OID: secp256k1

  1. Use “type Key” to check your keys
  2. Copy your public key and paste it in notepad. Remove all the spaces, colons ( : ) and newline characters. Also remove the 04 in the beginning of the string. Your key should look like this:

836b35a026743e823a90a0ee3b91bf615c6a757e2b60b9e1dc1826fd0dd16106f7bc1e8179f665015f43c6c81f39062fc2086ed849625c06e04697698b21855e
Save the file as ‘pub’.

  1. I used this calculator to generate keccak256 hash. Please refer image for the settings.

  1. Repeat step 5 for your private key. There is one difference; remove the leading ‘00’ if there is and save the file as ‘priv’
  2. Create Ethereum account using “geth account import priv” command. After entering the password, an address will be generated. Compare it with the last 40 characters of your keccak256 hash. If they are same, everything worked fine else repeat the process.

I followed the tutorial suggested by Bilal with a few tweaks.

3 Likes

Woo! Thanks for posting this, hoping this is helpful for other Bootcampers!

Did you run the below command in command prompt? I am getting an issue that openssl is not identified as a command when I run it on command prompt
openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout > Key

After you have installed openssl, go the ‘openssl\bin’ directory and execute the command there.

2 Likes

When I try install open ssl under Windows 10 and then try to run it, I get an error:

C:\OpenSSL-Win64\bin>openssl ecparam -name secp256k1 -genkey -noout | openssl ec -text -noout > Key
read EC key
unable to write ‘random state’

C:\OpenSSL-Win64\bin>

Am I doing something wrong??

Oh crap, I forgot to run as Administrator … DUH !!!

2 Likes