Transaction is below, wallets sent to each other this 37.7 btc ,from wallet a to b, b to c, c to d..... at the same block 935580, is it double spending like situatiıon?
This isn't ELI5 but should be easily understandable enough;
Pointers first:
- Each Bitcoin Nodes have a "mempool" where they store unconfirmed transactions, that include nodes that are miners.
- A transaction consist of UTXO (Unpent Transaction Output), ones that are to-be-spent (inputs) and the new ones that will be created from it (outputs).
- Most wallets can already create and broadcast transactions that spend UTXO that aren't already in a block, those are just temporarily kept in mempools.
So, when a miner selects which transaction to include to his block, he'll get the ones that have the highest fee rate,
in this case it happens that those transactions that were in his mempool have high enough fee to be prioritized together. (
considering that the parent can't be left out)
In cases where the first unconfirmed transaction A (
parent) has lower fee rate, his node will check the effective fee rate if it includes those that spent its output (
Transaction B+) is high enough to be prioritized.
Now for your double-spend concern, it's best to visualize UTXO and transactions, let's write it like how it's presented in a serialized transaction:
"
txid:vout" - txid = transaction id / vout = the output of that transaction's index number (
1st output, 2nd output...)
From your example (
-> = UTXO used by the next transaction):
Transaction A 908685b66b552f812cfb51fd0a0ef999dbdc4d1b906c3e0a76a5693562f3ef24
(UTXO that it spent, Input-0) 6f86230c33b3bad0e2016587df292fb2b64d20ae584be5fa375ba2504c954812:0
(UTXO that it created, Output-0) 908685b66b552f812cfb51fd0a0ef999dbdc4d1b906c3e0a76a5693562f3ef24:0 ->
(UTXO that it created, Output-1) 908685b66b552f812cfb51fd0a0ef999dbdc4d1b906c3e0a76a5693562f3ef24:1
Its first output is spent by transaction B:
Transaction B 5a6f51435a1702f2baa5a923f4ca3b72c3a2403976855fac3c11522607f5ecca
(UTXO that it spent, Input-0) -> 908685b66b552f812cfb51fd0a0ef999dbdc4d1b906c3e0a76a5693562f3ef24:0
(UTXO that it created, Output-0) 5a6f51435a1702f2baa5a923f4ca3b72c3a2403976855fac3c11522607f5ecca:0 ->
(UTXO that it created, Output-1) 5a6f51435a1702f2baa5a923f4ca3b72c3a2403976855fac3c11522607f5ecca:1
Then transaction B's first output is spent by transaction C:
Transaction C 84e05154b6ef9274348f00d53dbcd4946927b115687c425d1d3f25bb954d5e70
(UTXO that it spent, Input-0) -> 5a6f51435a1702f2baa5a923f4ca3b72c3a2403976855fac3c11522607f5ecca:0
(UTXO that it created, Output-0) 84e05154b6ef9274348f00d53dbcd4946927b115687c425d1d3f25bb954d5e70:0
(UTXO that it created, Output-1) 84e05154b6ef9274348f00d53dbcd4946927b115687c425d1d3f25bb954d5e70:1 ->...
As you can see, each transactions' input points to a UTXO that's not used by other transactions.
In case the green-highlighted output is also spent by transaction C instead of the purple-highlighted UTXO (
tried to "double-spend" it), only one of those will be included to a block, not both.