Ethereum accounts
To create an account, we just need an asymmetric key pair. There are various algorithms, such as Rivest–Shamir–Adleman (RSA) and Elliptic Curve Cryptography (ECC) for generating asymmetric key pairs. Ethereum uses ECC. ECC has various curves. These curves have a different speed and security. Ethereum uses secp256k1 curves. To go in to ECC and it's curves will require mathematical knowledge, and it's not necessary to understand it in depth to build DApps using Ethereum.
Ethereum uses 256-bit encryption. An Ethereum private and public key is a 256-bit number. As processors cannot represent such big numbers therefore it's always encoded as a hexadecimal string of length 64.
Every account is represented by an address. Once we have the keys we need to generate the address, here is the procedure to generate the address, and here is the procedure to generate the address from the public key:
- First, generate the Keccak-256 hash of the public key. It will give you a 256-bit number.
- Drop the first 90 bits and 12 bytes. You should now have 160 bits of binary data (20 bytes).
- Now, encode the address as a hexadecimal string. So, finally, you will have a byte string of 40 characters, which is your account address.
Now, anyone can send ether to this address, and then you can sign and send transactions from this address.