Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: digitalhussar on September 22, 2020, 07:07:45 PM



Title: reversable transactions
Post by: digitalhussar on September 22, 2020, 07:07:45 PM
Lets say i move 1 btc with 1sat/byte

Then 2 people simult. Broadcast a trx with 100 sat/byte, how does the miners deter who/which transfer will beat the system?

If you dont know and just want to speculate then just dont bother


Title: Re: reversable transactions
Post by: HeRetiK on September 22, 2020, 10:03:33 PM
Each miner will keep whatever transaction they saw first in their respective mempool and dismiss the other. Which transaction then gets added to the blockchain depends on whether the successful miner saw transaction A or transaction B first (and subsequently whether that block then gets orphaned or built upon).

Exceptions such as RBF apply though.


Title: Re: reversable transactions
Post by: BitMaxz on September 22, 2020, 11:49:24 PM
Well, miners have an incentive to prioritize a transaction to validate that includes a higher fee.

So, if you pay a low fee and the other man pay a higher fee their transaction will get confirm first before your transaction to get confirm or it might be rejected due to low transaction fee.

But sometimes if the network is not congested if your transaction fee is enough or you pay 1sat/byte and it's enough then you will get confirm fast just like paid with a higher fee.

If you have planning to make a transaction with low fee much better to check the network condition first before you make a transaction if you don't want the transaction stuck/rejected on the mempool.

You can use this tool for fee calculation https://coinb.in/#fees
Then check the network here https://jochen-hoenicke.de/queue/#0,24h


Title: Re: reversable transactions
Post by: pooya87 on September 23, 2020, 04:30:13 AM
you have to keep in mind that there are no rules saying which valid transaction a miner should choose. one may use the default settings of reference implementation and reject any subsequent tx spending the same output (assuming no RBF) no matter what the fee is, another may use a modified one and accept a tx with higher fee. same with RBF a miner could choose to not pay attention to RBF and continue rejecting new txs.

there is also another problem with the nodes and what they enforce. a node may do the same as what i explained above about miners. but the difference is that when majority of nodes act in a same way (eg. reject any tx with 0 fee) with 99% certainty you will not be able to propagate your transaction that they don't accept and get to to reach a miner's node.
this means that even if a miner were to accept a higher fee double spend, nodes won't so it will probably not ever reach them.


Title: Re: reversable transactions
Post by: DarkbLue on September 23, 2020, 05:44:03 AM
Fee schedule made for this. High fee transactions get priority by the miners. Otherwise all payments would go with lowest fee, right ?


Title: Re: reversable transactions
Post by: Upgrade00 on September 23, 2020, 06:19:07 AM
<snip>
You are right. Transactions are prioritized by fees, the discussion was about transactions which included the same output;

If address A signs a transaction of 0.1BTC to B, and while it was yet unconfirmed; spent the same exact output in another transaction to C, with a much higher fee than the first transaction.
Miners may prioritize the first transaction regardless of the lower fee paid, while others would drop that and include the second (high fee) transaction, hence invalidating the first one.

In cases of different transactions involving different outputs, they are prioritized by the feerate (sats/byte).


Title: Re: reversable transactions
Post by: HCP on September 23, 2020, 06:33:26 AM
Lets say i move 1 btc with 1sat/byte

Then 2 people simult. Broadcast a trx with 100 sat/byte, how does the miners deter who/which transfer will beat the system?
Your question isn't very clear. Do you mean they are spending the same UTXO with the 100 sat/byte fees as your 1 sat/byte transaction? That is to say, are they all trying to spend the "same" 1btc? Or are they all spending different coins? ???

Basically, I'm not sure if you're trying to understand how double-spends work, or how miners prioritise transactions to be included in a block? ???