hg0088线上

an ethereum account is an entity with an ether (eth) balance that can send transactions on ethereum. accounts can be user-controlled or deployed as smart contracts.

Prerequisites

Accounts are a very beginner-friendly topic. But to help you better understand this page, we recommend you first read through our introduction to Ethereum.

Types of account

hg0088线上ethereum has two types of account:

both account types have the ability to:

Key differences

Externally-owned

Contract

An account examined

hg0088线上ethereum accounts have four fields:

Externally-owned accounts and key pairs

hg0088线上an account is made up of a cryptographic pair of keys: public and private. they help prove that a transaction was actually signed by the sender and prevent forgeries. your private key is what you use to sign transactions, so it grants you custody over the funds associated with your account. you never really hold cryptocurrency, you hold private keys – the funds are always on ethereum's ledger.

this prevent malicious actors from broadcasting fake transactions because you can always verify the sender of a transaction.

hg0088线上if alice wants to send ether from her own account to bob’s account, alice need to create a transaction request and send it out to the network for verification. ethereum’s usage of public-key cryptography ensures that alice can prove that she originally initiated the transaction request. without cryptographic mechanisms, a malicious adversary eve could simply publicly broadcast a request that looks something like “send 5 eth from alice’s account to eve’s account,” and no one would be able to verify that it didn’t come from alice.

Account creation

when you want to create an account most libraries will generate you a random private key.

hg0088线上a private key is made up of 64 hex characters and can be encrypted with a password.

example:

fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036415f

The public key is generated from the private key using Elliptic Curve Digital Signature Algorithm. You get a public address for your account by taking the last 20 bytes of the public key and adding 0x to the beginning.

Here's an example of creating an account in the console using GETH's personal_newAccount

1> personal.newAccount()
2Passphrase:
3Repeat passphrase:
4"0x5e97870f263700f46aa00d967821199b9bc5a120"
5
6> personal.newAccount("h4ck3r")
7"0x3d80b31a78c30fc628f20b2c89d7ddbf6e53cedc"
8

GETH documentation

It is possible to derive new public keys from your private key but you cannot derive a private key from public keys. This means it's vital to keep a private key safe and, as the name suggests, PRIVATE.

you need a private key to sign messages and transactions which outputs a signature. others can then take the signature to derive your public key, proving the author of the message. in your application, you can use a javascript library to send transactions to the network.

Contract accounts

contract accounts also have a 42 character hexadecimal address:

example:

0x06012c8cf97bead5deae237070f9587f8e7a266d

hg0088线上the contract address is usually given when a contract is deployed to the ethereum blockchain. the address comes from the creator's address and the number of transactions sent from that address (the “nonce”).

A note on wallets

hg0088线上an account is not a wallet. a wallet is the keypair associated with a user-owned account, which allow a user to make transactions from or manage the account.

Further reading

Know of a community resource that helped you? Edit this page and add it!

Back to top ↑
  • On this page
  • Prerequisites
  • Types of account
  • An account examined
  • Externally-owned accounts and key pairs
  • Account creation
  • Contract accounts
  • A note on wallets
  • Further reading
  • Related topics