Please enable JavaScript.
Coggle requires JavaScript to display documents.
STRUCTURE OF ETHEREUM, Ethereum Transaction, ETHEREUM OPERATIONS, NOTE -…
STRUCTURE OF ETHEREUM
Types of Accounts
-
Contract accounts
- creating a account has a cost because you're using a network storage
- Can only send a transaction in response to receiving a transaction
- Transactions from an EOA 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
-
ACCOUNT
An Ethereum account is an entity with an ether (ETH) balance that can send transactions on Ethereum.
Ethereum formally introduces the concept of an account as part of the protocol.
The account is the originator and target of a transaction
:star: A transaction directly updates the account balance as opposed to maintaining the state such as bitcoin UTXO's
Ethereum Transaction
- Recipient
- Signature of sender authorizing transfer
- Amount of wei
- Message to a contract - an optional data field or payload that contains a message to a contract
- START GAS - value representing the maximum number of computational steps the transaction is allowed
- GAS PRICE - the fee sender is willing to pay for the computations
When you activate a smart contract, you ask all the miners in the whole network to each individually perform the calculations within it. This costs them time and energy, and Gas is the mechanism by which you pay them for that service.
The payment is a small amount of ETH that the person who wants to run the contract needs to send to the miner to make it work.
-
GAS
When it comes to actually paying for the gas, the transaction fee is charged as a certain number of ether, built in token of ethereum
-
-
If your gas price is fine but the gas cost of your transaction runs "over budget" the transaction fails but still goes into the blockchain as a failed transaction and you don't get the money back for the work that the miners did.
If you provided a normal gas price, however, and just attached more ether than was needed to pay for the gas that your transaction consumed, the excess amount will be refunded back to you. Miners only charge you for the work that they actually do
If the gas price I set in my transaction is too low, no one will even bother to run my transaction in the first place.
GAS AMOUNT
The more complex the smart contract (the number and type of computational steps, memory used for storage, etc), then the more Gas the contract requires to run and complete.
:checkered_flag: amount of Gas to run a contract is fixed for any specific contract,
GAS PRICE
Gas Price is specified by the person who wants the contract to run, at the time they request it (a bit like Bitcoin transaction fees). Each miner will look at how generous the gas price is, and will determine whether they want to run the contract as part of the block.
-
-
OMMERS
-
These miners will solve the puzzle, but didn't win the block are called Ommers. The blocks created by them are called Ommer Blocks. These are added as Ommer Blocks, or side blocks, to the main chain.
ETHEREUM OPERATIONS
Smart contract is designed, developed, compiled and deployed on the EVM
There can be multiple smart contracts in an EVM.
ETHEREUM FULL NODE
It hosts the software needed for transaction initiation, validation, mining, block creation and smart contract execution and the EVM (Ethereum Virtual Machine)
Miner noads
receive, verify, gather and execute transactions
When the target address in the transaction is a smart contract, the execution code corresponding to the smart contract is activated and executed on the EVM
The input needed for the smart contract execution is extracted from the payload field of the transaction.
The current state of the smart contract is the value of variables defined in it, the state of the smart contract may get updated after the transaction
NOTE
The participant node can send transaction for Ether transfer or it can send transaction to invoke a smart contract code or both.
An account must have sufficient balance to meet the fees needed for the transactions activated.
-