github.com/klaytn/klaytn@v1.12.1/blockchain/types/doc.go (about)

     1  // Copyright 2018 The klaytn Authors
     2  // Copyright 2014 The go-ethereum Authors
     3  // This file is part of the go-ethereum library.
     4  //
     5  // The go-ethereum library is free software: you can redistribute it and/or modify
     6  // it under the terms of the GNU Lesser General Public License as published by
     7  // the Free Software Foundation, either version 3 of the License, or
     8  // (at your option) any later version.
     9  //
    10  // The go-ethereum library is distributed in the hope that it will be useful,
    11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    13  // GNU Lesser General Public License for more details.
    14  //
    15  // You should have received a copy of the GNU Lesser General Public License
    16  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
    17  //
    18  // This file is derived from core/blockchain/types/block.go (2018/06/04).
    19  // Modified and improved for the klaytn development.
    20  
    21  /*
    22  Package types contains data types related to Klatyn consensus.
    23  
    24  Klaytn nodes achieve a consensus of the global state by processing the same transactions in the same order.
    25  
    26  Transaction is an atomic operation originated from an Externally Owned Account (EOA) transiting the global state of Klaytn.
    27  Klaytn supports multiple transaction types to efficiently trigger KLAY transfer or contract execution.
    28  LegacyTransaction, the Ethereum compatible transaction, could be sent to both of EOA and Smart Contract (SC).
    29  However, it cannot support advanced features of Klaytn such as multi-sig or fee-delegation.
    30  All transaction types except LegacyTransaction are enforced to be sent to either of EOA or SC.
    31  With a slice of transaction signatures signed by multiple accounts, they can support a multi-sig account to transact.
    32  Some transaction types support full or partial fee-delegation feature as well as basic transaction features.
    33  Fee-delegation transactions have additional field(s) to charge some amount of transaction fee to a fee payer's account.
    34  
    35  Block consists of transactions and a header which includes additional information for consensus and transaction support.
    36  A block guarantees the sequential execution of transactions inside, and a block header enables Klaytn nodes to order the blocks.
    37  The block header also provides additional data generated by the transaction execution such as transaction receipts, and logs.
    38  
    39  This package implements Klaytn Block, Transaction and related functions and variables to support them.
    40  
    41  
    42  Source Files
    43  
    44  Functions and variables related to Block and Transaction are defined in the files listed below.
    45    - block.go : defines block and block header
    46    - bloom.go : defines bloom and its functions for bloom filter which helps user to filter transaction receipts efficiently
    47    - contract_ref.go : interfaces ContractRef to deliver a fee payer address to the contract execution environment
    48    - derive_sha.go : implements keccak256 hash functions in various ways
    49    - gen_header_json.go : auto-generated code for JSON marshalling/un-marshalling of block header
    50    - gen_log_json.go : auto-generated code for JSON marshalling/un-marshalling of contract execution log
    51    - gen_receipt_json.go : auto-generated code for JSON marshalling/un-marshalling of transaction receipt
    52    - istanbul.go : provides a block header modified for istanbul consensus
    53    - log.go : implements contract execution log
    54    - receipt.go : implements transaction receipt
    55    - transaction.go : defines transaction
    56    - transaction_signing.go : interfaces signer and implements transaction signing/verification functions
    57    - tx_internal_data.go : defines internal data of transaction supporting various transaction types
    58    - tx_internal_data_account_creation.go : implements the transaction creating an EOA account
    59    - tx_internal_data_account_update.go : implements the transaction updating account key of an account
    60    - tx_internal_data_cancel.go : implements the transaction canceling a transaction in the txpool
    61    - tx_internal_data_chain_data_anchoring.go : implements the transaction transferring data to service chain
    62    - tx_internal_data_fee_delegated_account_update.go : implements the fee-delegated version of account update transaction
    63    - tx_internal_data_fee_delegated_account_update_with_ratio.go : implements the partially fee-delegated version of account update transaction
    64    - tx_internal_data_fee_delegated_cancel.go: implements the fee-delegated version of cancel transaction
    65    - tx_internal_data_fee_delegated_cancel_with_ratio.go: implements the partially fee-delegated version of cancel transaction
    66    - tx_internal_data_fee_delegated_smart_contract_deploy.go : implements the fee-delegated version of contract deploy transaction
    67    - tx_internal_data_fee_delegated_smart_contract_deploy_with_ratio.go : implements the partially fee-delegated version of contract deploy transaction
    68    - tx_internal_data_fee_delegated_smart_contract_execution.go : implements the fee-delegated version of contract execution transaction
    69    - tx_internal_data_fee_delegated_smart_contract_execution_with_ratio.go : implements the partially fee-delegated version of contract execution transaction
    70    - tx_internal_data_fee_delegated_value_transfer.go: implements the fee-delegated version of value transfer transaction
    71    - tx_internal_data_fee_delegated_value_transfer_memo.go: implements the fee-delegated version of value transfer with memo transaction
    72    - tx_internal_data_fee_delegated_value_transfer_memo_with_ratio.go: implements the partially fee-delegated version of value transfer with memo transaction
    73    - tx_internal_data_fee_delegated_value_transfer_with_ratio.go :implements the partially fee-delegated version of value transfer transaction
    74    - tx_internal_data_legacy.go: implements the legacy transaction compatible with Ethereum
    75    - tx_internal_data_serializer.go: implements serialization functions of transaction internal data
    76    - tx_internal_data_smart_contract_deploy.go: implements the transaction deploying a smart contract
    77    - tx_internal_data_smart_contract_execution.go: implements the transaction executing a smart contract
    78    - tx_internal_data_value_transfer.go: implements the transaction sending KLAY to an EOA
    79    - tx_internal_data_value_transfer_memo.go: implements the transaction sending KLAY to an EOA with data
    80    - tx_signature.go : implements transaction signature (V, R, S)
    81    - tx_signatures.go : implements a slice of transaction signature to support multi-sig accounts
    82  
    83  */
    84  package types