0% found this document useful (0 votes)
104 views8 pages

Accounts

Ethereum accounts can be externally owned accounts controlled by private keys or contract accounts controlled by code. Externally owned accounts can send transactions to transfer ETH or trigger contract executions, while contract accounts can only respond to transactions and execute coded actions. All accounts have fields including a nonce, balance, codehash and storage root and use public-private key pairs to prove ownership and authorize transactions.

Uploaded by

Pavan G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views8 pages

Accounts

Ethereum accounts can be externally owned accounts controlled by private keys or contract accounts controlled by code. Externally owned accounts can send transactions to transfer ETH or trigger contract executions, while contract accounts can only respond to transactions and execute coded actions. All accounts have fields including a nonce, balance, codehash and storage root and use public-private key pairs to prove ownership and authorize transactions.

Uploaded by

Pavan G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

ACCOUNTS

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
ACCOUNT TYPES
Ethereum has two account types:

1.Externally-owned account (EOA) – controlled by anyone with the


private keys
2.Contract account – a smart contract deployed to the network,
controlled by code.

Both Accounts types Have the Ability to :


 Receive, hold and send ETH and tokens

 Interact with deployed smart contracts


KEY DIFFERENCES

Externally-Owned

 Creating an account costs nothing


 Can initiate transactions
 Transactions between externally-owned accounts
can only be ETH/token transfers
 Made up of a cryptographic pair of keys: public
and private keys that control account activities
CONTRACT

 Creating a contract has a cost because you're using


network storage
 Can only send transactions in response to receiving a
transaction
 Transactions from an external account to a contract
account can trigger code which can execute many different
actions, such as transferring tokens or even creating a new
contract
 Contract accounts don't have private keys. Instead, they
are controlled by the logic of the smart contract code
AN ACCOUNT EXAMINED
 Ethereum accounts have four fields:

 Nonce – A counter that indicates the number of transactions sent from the
account. This ensures transactions are only processed once. In a contract
account, this number represents the number of contracts created by the
account.
 balance – The number of wei owned by this address. Wei is a denomination
of ETH and there are 1e+18 wei per ETH.
 CodeHash– This hash refers to the code of an account on the Ethereum
virtual machine (EVM). Contract accounts have code fragments
programmed in that can perform different operations. This EVM code gets
executed if the account gets a message call. It cannot be changed, unlike the
other account fields. All such code fragments are contained in the state
database under their corresponding hashes for later retrieval. This hash value
is known as a codeHash. For externally owned accounts, the codeHash field
is the hash of an empty string.
STORAGE ROOT

 Sometimes known as a storage hash. A 256-bit hash of


the root node of a Merkle Patricia trie that encodes the
storage contents of the account (a mapping between 256-
bit integer values), encoded into the trie as a mapping
from the Keccak 256-bit hash of the 256-bit integer keys
to the RLP-encoded 256-bit integer values. This trie
encodes the hash of the storage contents of this account,
and is empty by default.
ACCOUNT
EXTERNALLY-OWNED ACCOUNTS AND KEY PAIRS

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 prevents malicious actors from broadcasting fake transactions because you
can always verify the sender of a transaction.
If Alice wants to send ether from her own account to Bob’s account, Alice needs
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.

You might also like