ReasonJun

Ethereum : Transaction Structure 본문

Blockchain/Ethereum

Ethereum : Transaction Structure

ReasonJun 2024. 1. 16. 23:38
728x90

 

Transaction is a structure used when EOA transmits Eth to EOA or when EOA calls CA.

 

  1. txType() byte: This method returns the type ID of the transaction. It is expected to return a byte representing the type of the transaction.
  2. copy() TxData: This method creates a deep copy of the transaction data, initializing all fields. It allows for the duplication of transaction data.
  3. chainID() *big.Int: Returns the chain ID associated with the transaction.
  4. accessList() AccessList: Returns the access list associated with the transaction. An access list is a list of addresses and storage keys that the transaction plans to access, providing a way to optimize gas calculations.
  5. data() []byte: Returns the transaction data as a byte slice.
  6. gas() uint64: Returns the amount of gas specified for the transaction.
  7. gasPrice() *big.Int: Returns the gas price set for the transaction.
  8. gasTipCap() *big.Int: Returns the maximum gas tip that the transaction is willing to pay.
  9. gasFeeCap() *big.Int: Returns the maximum fee (gas price * gas limit) that the transaction is willing to pay.
  10. value() *big.Int: Returns the value of ether being transferred with the transaction.
  11. nonce() uint64: Returns the nonce of the transaction.
  12. to() *common.Address: Returns the recipient address of the transaction.
  13. rawSignatureValues() (v, r, s *big.Int): Returns the raw signature values (v, r, s) of the transaction.
  14. setSignatureValues(chainID, v, r, s *big.Int): Sets the signature values for the transaction, including the chain ID, v, r, and s.
  15. effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int: Computes the effective gas price paid by the transaction, given the inclusion block baseFee. The result is returned as a big.Int. The dst parameter is provided to store the result, and it emphasizes that the returned value should be an independent copy.
  16. encode(*bytes.Buffer) error: Encodes the transaction data into a byte buffer. This is likely used for serialization purposes.

 

EOA - EOA Transaction

 

EOA - CA Transaction

728x90
Comments