Author

Topic: Different components of a transaction (Informative) (Read 252 times)

legendary
Activity: 2268
Merit: 18711
Correct me if am wrong, but if you create a transaction (manually) without defining a change address, the remaining balance will be collected by the miner.
You are correct.

There isn't actually a field for defining the fee in the transaction data. What you do define is which inputs to include in your transaction, and you define how many satoshis to send to each output. Defining a change address is just the same as defining any other output, as far the transaction is concerned. Whatever the difference is between the sum of the inputs and the sum of the outputs is taken as the fee.

Most wallets deal with all this automatically, but if for some reason a change output wasn't defined, then whatever wasn't sent to the recipient(s) would be taken as the fee.
legendary
Activity: 2702
Merit: 3045
Top Crypto Casino
@Pffrt, you are right.
In Electrum for example, if you uncheck the Use change addresses box, the change will be sent back to one of the addresses used as inputs.

However, keep in mind that it mainly depends on the wallet you are using. Correct me if am wrong, but if you create a transaction (manually) without defining a change address, the remaining balance will be collected by the miner.
sr. member
Activity: 1372
Merit: 322
It is not completely correct. In wallets, there are some options to enable or disable the change address feature. People can choose or unchoose the option to use or not use the feature, respectively.
Isn't it like if you enable change address, one of your change address will receive the change and if you don't enable it, the same address of the input will be used as change address. I get to check once again, lol.
legendary
Activity: 3472
Merit: 10611
Transaction data does not include a timestamp.
As far as I know, timestamp is included in all block explorers. Some explorers indicate the "received time" of the transaction.

"blocks" have a timestamp (which may or may not be accurate) not "transactions". transactions have "locktime" which is a different thing than a timestamp.

and what block explorers show can be different values, some show the time their node has received the transaction (even the IP address of the node that sent the tx for the first time), some show the time tx was included in the block (ie. the block time) and some show both.

What are the components of a bitcoin transaction?
TxID/ Tx Hash
Block
Size
Input & Output
Change Address
Fee
apart from input/output, the rest are not "components" of a bitcoin transactions. they are more like additional calculated information. the actual transaction components are: version, tx_in (outpoint, signaturescript, sequence), tx_out (amount, pubkeyscript), witness and locktime.
legendary
Activity: 1904
Merit: 1563
Transaction data does not include a timestamp.
As far as I know, timestamp is included in all block explorers. Some explorers indicate the "received time" of the transaction.

This is only the case if you have 1 BTC in a single UTXO. In that case, you have to spend the whole UTXO and get 0.95 back as change. If, however, you have 1 BTC in your wallet but it is split among several UTXOs, then your wallet does not need to spend the whole amount, but rather the minimum amount of UTXOs to make up 0.05 BTC.
Yep this is possible if the wallet supports the "coin control" feature in which the user can freely select UTXOs' as an input to cover the required amount.

Change Address
It's normal as fiat changes. If you have 1 BTC in your wallet and you want to send 0.05 BTC to your friend, the total amount will be used as input but the change of 0.95 BTC (minus fee) will be sent to your change address.
@tranthidung is correct. If the "Use change addresses" is selected in tools, the remaining balance will be automatically sent to one of your unused "change address". If it is not selected or unchecked in tools menu, the remaining balance will automatically sent into one of your unused "receiving address" without indicating your address in the payment field if you are using Electrum wallet.
legendary
Activity: 2310
Merit: 4085
Farewell o_e_l_e_o
Change Address
It's normal as fiat changes. If you have 1 BTC in your wallet and you want to send 0.05 BTC to your friend, the total amount will be used as input but the change of 0.95 BTC (minus fee) will be sent to your change address.
It is not completely correct. In wallets, there are some options to enable or disable the change address feature. People can choose or unchoose the option to use or not use the feature, respectively.

In Electrum wallet, ie. go to Tools > Preferences > Transactions: Then you can choose the 2 options:
  • Use change addresses
  • Use multiple change addresses
legendary
Activity: 2702
Merit: 3045
Top Crypto Casino
Thanks OP for this topic. Many use bitcoin but have no idea how transactions work and what are their different parts. I hope you will update it with more accurate information based on other members inputs.

Adding to what o_e_l_e_o said, a change address is part of the outputs too. Your wallet will automatically generate it and add it to the transaction outputs (you can set it manually too). You shouldn't present it as an independant component.
legendary
Activity: 2268
Merit: 18711
A txID contains all the information of a transaction including timestamp, amount, fee etc.
Transaction data does not include a timestamp.

In the same way, a block contains maximum 1 MB data of the tx records.
Since SegWit, a block can contain up to 4 MB of data.

TX has its size. Depending on the input and output it can vary in bytes.
Since SegWit, transactions are measured in either virtual bytes or weight units. Measuring in plain bytes is no longer accurate unless you are dealing with a transaction which only contains legacy inputs and outputs.

If you have 1 BTC in your wallet and you want to send 0.05 BTC to your friend, the total amount will be used as input but the change of 0.95 BTC (minus fee) will be sent to your change address.
This is only the case if you have 1 BTC in a single UTXO. In that case, you have to spend the whole UTXO and get 0.95 back as change. If, however, you have 1 BTC in your wallet but it is split among several UTXOs, then your wallet does not need to spend the whole amount, but rather the minimum amount of UTXOs to make up 0.05 BTC.
sr. member
Activity: 1372
Merit: 322
In each transaction, there is a lot of information which some of us, especially newbies, don't know anything about. Today, as I'm locked due to the Corona Virus effect and have some free time, I thought to write an info article for newbies so that they can learn everything about a transaction in an easy way.
What are the components of a bitcoin transaction?
TxID/ Tx Hash
Block
Size
Input & Output
Change Address
Fee

TxID/ Tx Hash
There are a lot of transactions occurring in bitcoin each day. TxID is the record of each transaction. In traditional accounting, we can compare TxID with the transactions of each day. For example, X company may have severals transaction on a day-
Paid $5k as rent.
Good sold- $10k
Paid electricity bill- $500
All these are some transactions and they have numbers 1,2,3. These 1,2,3 are the txID. A txID contains all the information of a transaction including timestamp, amount, fee etc.

Block
A block can be compared to the traditional page number of a book. For example, the xTH number of pages of X book contains some information. In the same way, a block contains maximum 1 MB data of the tx records.

Size
TX has its size. Depending on the input and output it can vary in bytes.

Input & Output
In traditional ledger books, we have different accounts for income and expenses. We can compare the income with input here. Imagine, you have 1 BTC which you received from your friend. If you are sending 1 BTC to your cousin, bitcoin blockchain will look if you really have 1 BTC. Then it will say, you have 1 BTC from your friend and you are sending that 1 BTC to your cousin. So, in general words, it will link the source of that 1 BTC with the destination of that 1 BTC. Here, the source of that 1 BTC is the input and the destination of that 1 BTC is the output.

Change Address
It's normal as fiat changes. If you have 1 BTC in your wallet and you want to send 0.05 BTC to your friend, the total amount will be used as input but the change of 0.95 BTC (minus fee) will be sent to your change address.

Fee
Fee is paid to the miners to confirm include your transaction in a block. Fee can be customized, can be paid 1 sat/byte or higher. Sometimes, when the mempool is congested (In other words, when there are more than usual tx occurs), the fee increases significantly.

These are very general components of a bitcoin tx, there are some more too. I will update them later.
Jump to: