Pages:
Author

Topic: Why does transaction works this way?? (Read 292 times)

legendary
Activity: 2380
Merit: 5213
June 18, 2024, 07:27:10 AM
#24
But the fee would be taken singly using each address input right ?? because I haven't tried the multiple address already,just found out its best to receive utxo in different addresses as it helps in privacy too
The more inputs/outputs your transaction contains, the more fee you have to pay.

Take note that I am saying "inputs/outputs", not "addresses". Even if you have received all the transactions at the same address, you still have multiple inputs when making a transaction. As already stated by pooya87, it doesn't matter you have received all the transactions at the same address or different addresses.

Let's say I want to make a transaction with 1 segwit input and 1 segwit ouput. Such transaction would be around 110 vbyte in size.
For example, if I use the fee rate of 10 sat/vbyte, I would pay 1100 satoshi as transaction fee.

If I add an extra input to my transaction, it would have 2 inputs and 1 output. Such transaction would be around 177 vbyte in size and if I use the same fee rate for that, I would pay 1770 satoshi as transaction fee.
newbie
Activity: 19
Merit: 6
June 18, 2024, 06:58:41 AM
#23
My guess here is that the OP is actually using a bad wallet that takes all the UTXO available in the address to mark a single transaction not checking like the usual wallets we know of as to maybe the transaction can be covered with just one single UTXO.
Even electrum does the same thing.

In the case you have multiple UTXOs at the same address and you make a transaction without using coin control, electrum would use all those UTXOs even if one of them is enough for convering the transaction amount.
By default, electrum uses either all the UTXOs associated with an address or none of them.
Wanted to asked this but I think it's beign resolved by your answer
This helped! I did saved foe reference


Quote
If it's not on a new address but on the same address(the received  UTXO), will it be counted as part of inputs along with other input when I want to send again  to a new address.
It doesn't matter in which address you receive those coins, they are all outputs that can be spent with each other in the same transaction.
But the fee would be taken singly using each address input right ?? because I haven't tried the multiple address already,just found out its best to receive utxo in different addresses as it helps in privacy too
sr. member
Activity: 364
Merit: 218
Learning never stops!
June 17, 2024, 07:18:45 AM
#22

Secondly, I have the intention of consolidating all my UTXO's to a single one in my wallet. Normally, I send them to my second wallet to consolidate it and pay a fee in the process. Is it possible to merge them all into a single UTXO in the same wallet?.
Yes you can merge it all into a single utxo using a single transaction  and not by just merging it directly in the same address..
I get what you  are trying to ask here , it's just this same way you are sending  to the other wallet I.e you spend all your UTXO in a single transaction  to a new wallet(lets say you did this while the mempoolis less congested)... if the other wallet is an electrum or uses the number of your total   inputs for calculation of fee then you've just saved yourself    some change from consolidation.
However instead of using a new wallet, You can just use a new address (since electrum supports multiple address), in the process of consolidation fee is calculated the same way you spend your  UTXO  to another wallet [ @ hosseinimr93 did mention that]... so you will have to pay even if the transaction is within wallet. After you're  done with the consolidation  you should have a new INPUT in a different address within the same wallet.
Note: the idea of consolidation is generally for when the mempool is less congested
Also, you can choose to receive UTXO in a new address every time you receive, with that you  won't need to worry about consolidation but if you need to spend more the you will have to do it using a multiple transaction each from one address
legendary
Activity: 2380
Merit: 5213
June 17, 2024, 02:47:08 AM
#21
I'm very much interested in this, been using electrum wallet for a while now and haven't seemed to observe this feature. Would you please specify the wallets that incorporates this feature and how to locate it.
To select which UTXO(s) you want to to be used for your transaction, you should go to "Coins" tab.
If you don't see the "Coin" tab, click on "View" at top the window and check "Coins".


Secondly, I have the intention of consolidating all my UTXO's to a single one in my wallet. Normally, I send them to my second wallet to consolidate it and pay a fee in the process. Is it possible to merge them all into a single UTXO in the same wallet?.
You can make your transaction to any address you want.
To make the consolidation transaction to the same wallet, just use one of the addresses of your wallet as the receiving address.

Take note that it doesn't matter whether the receiving address belongs to the same wallet or a different wallet. You have to pay the transaction fee.
sr. member
Activity: 406
Merit: 282
Let love lead
June 16, 2024, 10:57:14 PM
#20
You don't have to spend all the UTXOs you have to make a transaction.

Let's say you have 2 UTXOs and they are both assosicated with the same address.
One is worth 0.2 BTC and the other one is worth 0.3 BTC. If you want to make transaction paying 0.1 BTC, you can use each of UTXOs you want. You can also use both UTXOs.
I'm very much interested in this, been using electrum wallet for a while now and haven't seemed to observe this feature. Would you please specify the wallets that incorporates this feature and how to locate it.

Secondly, I have the intention of consolidating all my UTXO's to a single one in my wallet. Normally, I send them to my second wallet to consolidate it and pay a fee in the process. Is it possible to merge them all into a single UTXO in the same wallet?.
legendary
Activity: 2380
Merit: 5213
June 15, 2024, 05:28:11 PM
#19
My guess here is that the OP is actually using a bad wallet that takes all the UTXO available in the address to mark a single transaction not checking like the usual wallets we know of as to maybe the transaction can be covered with just one single UTXO.
Even electrum does the same thing.

In the case you have multiple UTXOs at the same address and you make a transaction without using coin control, electrum would use all those UTXOs even if one of them is enough for convering the transaction amount.
By default, electrum uses either all the UTXOs associated with an address or none of them.
legendary
Activity: 2702
Merit: 3037
Top Crypto Casino
June 15, 2024, 05:25:31 PM
#18
Let's say you have 2 UTXOs and they are both assosicated with the same address.
One is worth 0.2 BTC and the other one is worth 0.3 BTC. If you want to make transaction paying 0.1 BTC, you can use each of UTXOs you want. You can also use both UTXOs.


But the fees will still be calculated using all inputs??
As other members have pointed out, the fee you need to pay varies depending on the transaction size. What you need to set when creating a transaction is the fee rate and your wallet will take care of calculating the flat fee to pay. The more inputs and outputs in your transaction, the bigger its size which means higher fees.
Your wallet will not create an output for the fee sent to the miner. Miners just collect whatever the difference between the sum of the inputs and the sum of outputs.
hero member
Activity: 840
Merit: 932
June 15, 2024, 04:21:18 PM
#17
from my experience with making Bitcoin transactions, when you make a transaction, your wallet automatically checks for addresses in your HD wallet which can be able to pay for the whole transaction with a single output. During the process of the transaction, the remaining coins from that address you spent from is moved to a new address as an input known as the change address.

In addition, if a single address can't pay for a particular transaction, the wallet will pick from as many addresses possible moving them as a single output to an address, then the compiled coins in the new address is used as a second output to pay for the transaction , after which a change if available will be returned to a change address.


My guess here is that the OP is actually using a bad wallet that takes all the UTXO available in the address to mark a single transaction not checking like the usual wallets we know of as to maybe the transaction can be covered with just one single UTXO.

A little note to OP it is not a must that a change is sent to a new change address but it can also be sent to the same address that the transaction was made from. You simply need to indicate it. An example is the electrum wallet that allows you to specify the address you wish to have change sent back too but it definitely affects one’s privacy
full member
Activity: 854
Merit: 201
June 15, 2024, 12:55:21 PM
#16
but that's how bitcoin works, if you feel that why should it be like that then you should ask satoshi why he designed bitcoin transactions like that?  if you feel that it is confusing or doesn't suit you then you can switch to using another altcoin which has a transaction system that is easier to understand compared to bitcoin.  but if you are still suitable for using bitcoin, then just learn it and maybe you will be able to gain valuable knowledge.
sr. member
Activity: 448
Merit: 560
Crypto Casino and Sportsbook
June 15, 2024, 10:45:35 AM
#15
I've been curious about why transaction had to deal with spending of all inputs on a particular address.
Although I'm not new to the fact that all transaction  have to be spent in a single output  buy why does it have to work that way??
So the change I'm  receiving  can I call it an output  or a new input ??
If it's not on a new address but on the same address(the received  UTXO), will it be counted as part of inputs along with other input when I want to send again  to a new address.
Just like hosseinimr93 mentioned, from my experience with making Bitcoin transactions, when you make a transaction, your wallet automatically checks for addresses in your HD wallet which can be able to pay for the whole transaction with a single output. During the process of the transaction, the remaining coins from that address you spent from is moved to a new address as an input known as the change address.
Think of it as giving a shop owner a $5 bill to pay for an item of $3 now you will be given a change of $2 after the purchase. In this case the $2 is the change returned to the change address while the $3 is the spent UTXO .

In addition, if a single address can't pay for a particular transaction, the wallet will pick from as many addresses possible moving them as a single output to an address, then the compiled coins in the new address is used as a second output to pay for the transaction , after which a change if available will be returned to a change address.
legendary
Activity: 3472
Merit: 10611
June 14, 2024, 11:36:19 PM
#14
I've been curious about why transaction had to deal with spending of all inputs on a particular address.
Although I'm not new to the fact that all transaction  have to be spent in a single output  buy why does it have to work that way??
There are two ways I can think of in the payment systems. (1) Account based balance (2) output/coin based balance.

Bitcoin chose the second method an it is similar to physical cash.
Explaining it through cash helps you understand how things work better. When you receive cash, your "pocket" doesn't have a counter telling you a number that is your balance. Your balance is the sum of each of those individual "coins" or "bank notes". And when you want to spend your cash you have to pay a combination of those "coins" or "notes". For example if you have twelve 1 dollar bills and two 20 dollar bills and one to pay 22 dollars, you can either pay them using two 20 dollar bills and receive a 18 dollar "change" or you can use a single 20 dollar bill plus two 1 dollar bills without receiving any change. You can also give them all your cash ($52) and receive $30 (a single 30 dollar bill assuming that exists) change back!

That is how Bitcoin works as well. When you receive bitcoin, you are receiving individual outputs called "coins" and when you want to spend them you have to select these outputs to spend just like what we did with cash.
Through a process known as Coin Control you select one or more of your UTXOs to make payments.

BTW the first method (account based balance) is used by centralized payment systems like banks, PayPal, etc. and it doesn't exactly work in a decentralized payment system such as Bitcoin.

Quote
So the change I'm  receiving  can I call it an output  or a new input ??
It is an output when you receive it and it is an input when you spend it.

Quote
If it's not on a new address but on the same address(the received  UTXO), will it be counted as part of inputs along with other input when I want to send again  to a new address.
It doesn't matter in which address you receive those coins, they are all outputs that can be spent with each other in the same transaction.
legendary
Activity: 2604
Merit: 2353
June 14, 2024, 04:06:49 PM
#13
I've been curious about why transaction had to deal with spending of all inputs on a particular address.
Although I'm not new to the fact that all transaction  have to be spent in a single output  buy why does it have to work that way??

So the change I'm  receiving  can I call it an output  or a new input ??
If it's not on a new address but on the same address(the received  UTXO), will it be counted as part of inputs along with other input when I want to send again  to a new address.

No you don't need to use one single output you can send a transaction to multiple different addresses if you're using Electrum for example. And if you send several UTXO to one address, you will  be able to treat them one by one for sending them elsewhere if you're using such kind of wallet. When you have some change in a transaction, it is indeed considered as an output. This output becomes part of your wallet's unspent transaction outputs (UTXOs). Later, if you want to make another transaction, this "output", now UTXO actually, can be used as an input. Being sent back to the same address or to a different one won't change its nature of input of the new transaction actually.
hero member
Activity: 2212
Merit: 805
Top Crypto Casino
June 13, 2024, 05:54:17 PM
#12
Although I'm not new to the fact that all transaction  have to be spent in a single output  buy why does it have to work that way??

~Snipped


The way that Bitcoin transactions work is by design. It's not the same with every other blockchain networks so we just have to understand and accept it because if you try to take part in governance and try to change things, it's a really lengthy and tiring process that might take years to be deliberated on and implemented. That said, anything that is returned is called an unspent transaction output until you get to spend it by sending it to another address.
hero member
Activity: 882
Merit: 1873
Crypto Swap Exchange
June 13, 2024, 05:24:54 PM
#11
The point of including 'Change' into a Transaction was a while ago to increase the Privacy of Bitcoin users.  Before Chain Analysis and Know Your Customer, there was a lot more Privacy on the Bitcoin Network simply because pretty much no body was treating Addresses differently based on their Transactional history and there was no body to make a map of where each Bitcoin goes.  So if you had 3 Changes from 3 different Transactions, all of them ended up in different Addresses so you could continue to have more Privacy on the Blockchain.

Nowadays, this is not enough but it still does improve Privacy by a lot.  So much more than re using an Address or doing such other things that are unnatural to Bitcoin anyway.
hero member
Activity: 840
Merit: 932
June 12, 2024, 02:01:00 PM
#10
I've been curious about why transaction had to deal with spending of all inputs on a particular address.
Although I'm not new to the fact that all transaction  have to be spent in a single output  buy why does it have to work that way??

If you have actually been encountering this problem then it certainly the type of wallet you’re using. The wallet is using all your inputs in one transaction but that’s not how the Bitcoin network works. Wallets like electrum or BlueWallet actually allows you to manage your UTXOs when spending from the wallet. Features like coin control and freezing of utxo are used to manage UTXO.

So the change I'm  receiving  can I call it an output  or a new input ??
If it's not on a new address but on the same address(the received  UTXO), will it be counted as part of inputs along with other input when I want to send again  to a new address.

The change is also a UTXO, as such it will be used as a new input when making a new transaction, some wallet send the change to a different address which are designated as change address. But you can also have them on the same spending address, As a single UTXO
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
June 12, 2024, 10:56:45 AM
#9
Because Bitcoin has a UTXO model. A coin is an output, and each output comes with a value. When you spend an input, it cannot be partially spent. It has to be spent entirely, which means to create two outputs; one for the receiving address, and another for the change.

"Why does Bitcoin have a UTXO model?". Because it's more private and scalable. With proper coin control, you gain some privacy, and with enabling parallelism, you can spend coins before your receiving transactions become confirmed.
legendary
Activity: 2310
Merit: 4085
Farewell o_e_l_e_o
June 12, 2024, 08:08:40 AM
#8
But the fees will still be calculated using all inputs??
Bitcoin transaction fee is calculated by the formula

Transaction fee = Transaction size * fee rate.

Fee rate is what you choose, if you use a non custodial wallet.
Transaction size depends on your inputs and outputs: number of inputs, number of outputs, and address/ transaction types of inputs, outputs.

Some transaction size calculators

Read my guide to save transaction fee with Electrum wallet.
legendary
Activity: 2380
Merit: 5213
June 12, 2024, 08:01:56 AM
#7
But the fees will still be calculated using all inputs??
The fee you pay for a transaction depends on number of inputs and ouputs, address(es) type, how congested the network is and how fast you want your transaction to be confirmed.
Take note that the fee doesn't depend on the amount of bitcoin you send.

For example, the fee you pay for a transaction sending 50 BTC and including 1 input and 1 ouput would be smaller than the fee you pay for a transaction sending 0.001 BTC and including more inputs/ouptuts.
newbie
Activity: 19
Merit: 6
June 12, 2024, 07:57:30 AM
#6
Let's say you have 2 UTXOs and they are both assosicated with the same address.
One is worth 0.2 BTC and the other one is worth 0.3 BTC. If you want to make transaction paying 0.1 BTC, you can use each of UTXOs you want. You can also use both UTXOs.


But the fees will still be calculated using all inputs??


You don't have to spend all the UTXOs you have to make a transaction.
I think what he meant is that assuming you have 1 UTXO of 1 BTC and you want to spend 0.1 BTC, that there should not be a change (of 0.9 BTC). That just 0.1 BTC should be transferred in the transaction.
Yes! that's just what I'm try to get
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
June 12, 2024, 07:27:34 AM
#5
You don't have to spend all the UTXOs you have to make a transaction.
I think what he meant is that assuming you have 1 UTXO of 1 BTC and you want to spend 0.1 BTC, that there should not be a change (of 0.9 BTC). That just 0.1 BTC should be transferred in the transaction.
Pages:
Jump to: