====== A.1.8 Transaction Class ====== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:start| Basic Ethereum Data Store]] Transactions are cryptographically signed instructions from accounts. An account will initiate a transaction to update the state of the [[dido:public:ra:xapend:xapend.a_glossary:e:ethereum|Ethereum]] network. The simplest transaction is transferring ETH from one account to another. An Ethereum transaction refers to an action initiated by an externally-owned account, in other words an account managed by a human, not a contract. For example, if Bob sends Alice 1 ETH, Bob's account must be debited and Alice's must be credited. This state-changing action takes place within a transaction. Transactions, which change the state of the EVM, need to be broadcast to the whole network. Any [[dido:public:ra:xapend:xapend.a_glossary:n:node|node]] can broadcast a request for a transaction to be executed on the EVM; after this happens, a miner will execute the transaction and propagate the resulting state change to the rest of the network. Transactions require a fee and must be mined to become valid. To make this overview simpler we'll cover [[dido:public:ra:xapend:xapend.a_glossary:g:gas|gas]] fees and [[dido:public:ra:xapend:xapend.a_glossary:m:mining|mining]] elsewhere. See: [[https://docs.google.com/spreadsheets/d/1ehCIQxjSZcVLnddDWHBzhPb8h83mHWZxvyX9eckghbU/edit#gid=1171362027]]
{{ :dido:public:s_cli:05_contents:01_prt:03_langconst:basic_dido_objects:screen_shot_2021-05-31_at_12.02.18_pm.png?300 |}} The Ethereum Transaction Class
===== Id ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | ID | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | text (tx-hash) | ^ Example | 0x000000005b6f5d20b1523bb8a153871fee2ded71a743998d38bdc5095d9d1d43 " | ===== Block Number ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | [[dido:public:ra:xapend:xapend.a_glossary:b:block_height|Block height]] | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | numeric | ^ Example | 4743012 | ===== Block Hash ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Hash of block header | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | text | ^ Example | 0x06601603a88365782cdfc9b351625b81b44f009d71ecda705319d8eb52253b38 | ===== Hash ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Hash of transaction | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | text | ^ Example | 0x000000005b6f5d20b1523bb8a153871fee2ded71a743998d38bdc5095d9d1d43 | ===== From ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | The address for the sending account. Uses the web3.eth.defaultAccount property, if not specified. | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | text | ^ Example | 0x804d39F546c5164Af7612C3Dca3683150E55bB78 | ===== To ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | The destination address of the message, left undefined for a contract-creation transaction. | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | text | ^ Example | 0xF32d328AF90D5ac22b1BbEDa4114Fd15b2fA09EE | ===== Input ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Either a byte string containing the associated data of the message, or in the case of a contract-creation transaction, the initialisation code. | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | text | ^ Example | 0x278b8c0e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 d1ef6848f9e1200000000000000000000000000dd6c68bb32462e01705011a4e2ad1a60740f217f00000000000000000000000000000000000000000000 00000a15d4e62fd1100000000000000000000000000000000000000000000000000000000000004de624000000000000000000000000000000000000000 000000000000000000282e4ca000000000000000000000000000000000000000000000000000000000000001b2da74095f6c78e151a5410955079a0481d 939fda00e1f0b94b445c66dea0652a2b73c6bc213613e7cbb788f1e49d968fed95df4ffaa58fa1f4580e939885c624 | ===== Nonce ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce. It is a scalar value equal to the number of transactions sent by the sender. The nonce in the transaction must be exactly one higher than the nonce in the sender account state essentially guarding against race conditions of two competing transactions trying to modify the same account state. | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | Text | ^ Example | 31686 | ===== Gas ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | The amount of gas to use for the transaction (unused gas is refunded). The gas limit sets an upper bound on the amount of gas the originator of the transaction is willing to pay for. | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | Numeric | ^ Example | 200000 " | ===== Gas Price ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | The price of gas for this transaction in wei, defaults to the mean network gas price. | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | Numeric | ^ Example | 70000000000 | ===== Transaction Index ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Integer of the transaction index position | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | Numeric | ^ Example | 60 | ===== Value ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | The value transferred for the transaction in Wei, also the endowment if it’s a contract-creation transaction. | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | numeric | ^ Example | 1.538E+19 | ===== V ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Values corresponding to the signature of the transaction and used to determine the sender of the transaction | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | Numeric | ^ Example | 0x1b | ===== R ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Values corresponding to the signature of the transaction and used to determine the sender of the transaction | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | text | ^ Example | 0xc78a9cabd379d83ef2eeebe2bd1ffd11755432244e9547b0fe608b6f99bc50cf | ===== S ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Values corresponding to the signature of the transaction and used to determine the sender of the transaction | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | Numeric | ^ Example | 0x2ae507ce22499f7bb165b576ac3539516b2917f5affa1e8e3822aa9302614848 | ===== Timestamp ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Timestamp of the transaction | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | TimestampType | ^ Example | 2017-12-16 13:59:51+00 | ===== Creates ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] TBD ^ Description | TBD | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | | ^ Example | | ===== Public Key ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Public hash key | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | text | ^ Example | 0xe3dcf27ef4b9c0a4b773f289272c23e62c95827c5e5fec54c05d8af2b7d3ab0373070bbff30f99f4edf845b7ab6fe1af40ac3e7a4431dd21ef282a4713ddca89 | ===== Contract Address ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Address of contract reference | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | text | ^ Example | 0x83C07b66DfB48FbF2fE8C2FF46c431fFC21F3Ac1 | ===== Cumulative Gas Used ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Real amount of gas used in the block up unit this tx-index | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | text | ^ Example | 1569579 | ===== Gas Used ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | Gas used for the transaction | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | Numeric | ^ Example | 22787 | ===== Logs Bloom ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | A kind of index about the data contained in the tx, used in native queries to the blockchain via the node | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | text (tx-hash) | ^ Example | 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000 | ===== Root ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] TBD ^ Description | TBD | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | text | ^ Example | 0x3c77b032da4e0637b577bce870ea4587f247a34445b85669c25be302e8411e29 | ===== Status ===== [[dido:public:s_cli:05_contents:03_prt:08_basic_dido_objects:08_transaction:start| Return to Top ]] ^ Description | if the transaction was successfully mined/executed | ^ [[dido:public:ra:xapend:xapend.a_glossary:d:data_type]] | Boolean | ^ Example | False | /**=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- /* To add a discussion page to this page, comment out the line that says ~~DISCUSSION:off~~ */ ~~DISCUSSION:on|Outstanding Issues~~ ~~DISCUSSION:off~~ /**=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- /* To add a discussion page to this page, comment out the line that says ~~DISCUSSION:off~~ */ ~~DISCUSSION:on|Outstanding Issues~~ ~~DISCUSSION:off~~