Bitcoin Forum
April 27, 2024, 02:11:11 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How can detect double spend transaction?  (Read 607 times)
MrCrank (OP)
Sr. Member
****
Offline Offline

Activity: 1336
Merit: 258



View Profile
August 21, 2017, 06:01:00 AM
 #1

Hello,

How can I detect double spend transaction with full blockchain node?
Has transaction double-spend flag?
Or this is impossible?

1714227071
Hero Member
*
Offline Offline

Posts: 1714227071

View Profile Personal Message (Offline)

Ignore
1714227071
Reply with quote  #2

1714227071
Report to moderator
1714227071
Hero Member
*
Offline Offline

Posts: 1714227071

View Profile Personal Message (Offline)

Ignore
1714227071
Reply with quote  #2

1714227071
Report to moderator
1714227071
Hero Member
*
Offline Offline

Posts: 1714227071

View Profile Personal Message (Offline)

Ignore
1714227071
Reply with quote  #2

1714227071
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714227071
Hero Member
*
Offline Offline

Posts: 1714227071

View Profile Personal Message (Offline)

Ignore
1714227071
Reply with quote  #2

1714227071
Report to moderator
1714227071
Hero Member
*
Offline Offline

Posts: 1714227071

View Profile Personal Message (Offline)

Ignore
1714227071
Reply with quote  #2

1714227071
Report to moderator
onnz423
Hero Member
*****
Offline Offline

Activity: 840
Merit: 508


Make winning bets on sports with Sportsbet.io!


View Profile
August 21, 2017, 06:50:30 AM
 #2

At least blockchain.info, when looking up the transaction it should say the following if it is a double spend:

Code:
Warning! this bitcoin address contains transactions which may be double spends. You should be extremely careful when trusting any transactions to or from this address.

I do not know about the bitcoin core, but you should always wait for at least one confirmation if you are receiving money first without sending the goods.
Some people are trying to double spend to scam you.

   ▄▄██████▄▄
  ████████████
███▄▄
 ██████████████▀▀▀██▄
████████████████   ▀██▄
████████████████     ▀██
██████████████       ██▌
██████████████        ▐██
██▌▀▀██████▀▀         ▐██
▐██                   ██▌
 ██▄                 ▄██
  ▀██▄             ▄██▀
    ▀██▄▄▄     ▄▄▄██▀
      ▀▀█████████▀▀





███████████████████████████
████████▀▀       ▀▀████████
█████▀   ▄ ▀███▀ ▄   ▀█████
████  ▄████▄ ▀ ▄████▄  ████
███  ▄ ▀███▀ ▄ ▀███▀ ▄  ███
██  ▄██ ▀▀ ▄███▄ ▀▀ ██▄  ██
██  █▀ ▄█ ███████ █▄ ▀█  ██
██   ▄███▄ █████ ▄███▄   ██
███  ████▀ ▄▄▄▄▄ ▀████  ███
████  ▀ ▄ ▀█████▀ ▄ ▀  ████
█████▄  ▀▀▄ ███ ▄▀▀  ▄█████
████████▄▄       ▄▄████████
███████████████████████████





█▀▀











█▄▄
▀▀█











▄▄█
█▀▀











█▄▄
▀▀█











▄▄█
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
August 21, 2017, 01:06:28 PM
 #3

How can I detect double spend transaction with full blockchain node?
Has transaction double-spend flag?
Or this is impossible?
Unless you are running a node which connects to a large number of nodes in the world, it can be hard for you to see any other existing competing and conflicting transaction. Reason being that the reference nodes doesn't relay double spend transactions and the propagation for them would be very bad. Transactions cannot have double spend flag, the flags you see are not included in the transaction itself.

Honestly, if you accept unconfirmed transactions, the risk is substantially higher. Double spend can be easy and hard to detect WITH the participation of a miner (knowingly) or (unknowingly) a miner having differing rules (eg. dust limits) from the rest of the network.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
MrCrank (OP)
Sr. Member
****
Offline Offline

Activity: 1336
Merit: 258



View Profile
August 21, 2017, 03:48:00 PM
 #4

How can I detect double spend transaction with full blockchain node?
Has transaction double-spend flag?
Or this is impossible?
Unless you are running a node which connects to a large number of nodes in the world, it can be hard for you to see any other existing competing and conflicting transaction. Reason being that the reference nodes doesn't relay double spend transactions and the propagation for them would be very bad. Transactions cannot have double spend flag, the flags you see are not included in the transaction itself.

Honestly, if you accept unconfirmed transactions, the risk is substantially higher. Double spend can be easy and hard to detect WITH the participation of a miner (knowingly) or (unknowingly) a miner having differing rules (eg. dust limits) from the rest of the network.

But how blockchain.info detect and warning about it:
Code:
Warning! this bitcoin address contains transactions which may be double spends. You should be extremely careful when trusting any transactions to or from this address.
Really interest theme, unfortunately about this little information.
I want to understand how it works
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
August 22, 2017, 12:36:29 PM
 #5

But how blockchain.info detect and warning about it:
Code:
Warning! this bitcoin address contains transactions which may be double spends. You should be extremely careful when trusting any transactions to or from this address.
Blockchain.info has thousands of nodes that is connected to it. It has the ability to see most transactions that has been sent on the network. If a node has seen transaction A first, then receives transaction B, it will accept and relay transaction A. If another node sees transaction B first, it will accept and relay transaction B.

The reference client automatically rejects and refuses to relay double spends. This results in you being unable to see the transaction and your client will not know if there is a double spend or not.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
MrCrank (OP)
Sr. Member
****
Offline Offline

Activity: 1336
Merit: 258



View Profile
August 23, 2017, 05:36:25 PM
 #6

But how blockchain.info detect and warning about it:
Code:
Warning! this bitcoin address contains transactions which may be double spends. You should be extremely careful when trusting any transactions to or from this address.
Blockchain.info has thousands of nodes that is connected to it. It has the ability to see most transactions that has been sent on the network. If a node has seen transaction A first, then receives transaction B, it will accept and relay transaction A. If another node sees transaction B first, it will accept and relay transaction B.

The reference client automatically rejects and refuses to relay double spends. This results in you being unable to see the transaction and your client will not know if there is a double spend or not.

Ok, thanks for explain.
I use one node only and understood that impossible for me.
Do you know any service with this options (double-spend flag) using API?
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
August 23, 2017, 05:54:33 PM
 #7

As the others have said, it comes up on blockchain.info with a warning.
But, if you want to check it yourself, you can got to a block explorer like blockchain.info and look at the address the transaction comes from and the INPUT script with that address.
IF there is another transaction of the same amount that also has the same input script, it is a double spend. You cannot have a regular transaction/client that reuses an input script (hence why change addresses are needed or two outputs are used to ensure a new input script is created in the same address).

AFAIK, even if blockchain.info only broadcasts and attempts to mine one of the transactions, it will still show both transactions in the block explorer.
MrCrank (OP)
Sr. Member
****
Offline Offline

Activity: 1336
Merit: 258



View Profile
September 01, 2017, 07:55:30 AM
 #8

As the others have said, it comes up on blockchain.info with a warning.
But, if you want to check it yourself, you can got to a block explorer like blockchain.info and look at the address the transaction comes from and the INPUT script with that address.
IF there is another transaction of the same amount that also has the same input script, it is a double spend. You cannot have a regular transaction/client that reuses an input script (hence why change addresses are needed or two outputs are used to ensure a new input script is created in the same address).

AFAIK, even if blockchain.info only broadcasts and attempts to mine one of the transactions, it will still show both transactions in the block explorer.

Ok, If happen really double spend transaction.. First TX (fake) , second TX is reall and confirmed.
How can I see first TX or it's disappear?

And if I have 2 TX and push first TX to pool with 0 fees, will TX confirm?

mocacinno
Legendary
*
Offline Offline

Activity: 3374
Merit: 4918


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
September 01, 2017, 08:05:41 AM
 #9

As the others have said, it comes up on blockchain.info with a warning.
But, if you want to check it yourself, you can got to a block explorer like blockchain.info and look at the address the transaction comes from and the INPUT script with that address.
IF there is another transaction of the same amount that also has the same input script, it is a double spend. You cannot have a regular transaction/client that reuses an input script (hence why change addresses are needed or two outputs are used to ensure a new input script is created in the same address).

AFAIK, even if blockchain.info only broadcasts and attempts to mine one of the transactions, it will still show both transactions in the block explorer.

Ok, If happen really double spend transaction.. First TX (fake) , second TX is reall and confirmed.
How can I see first TX or it's disappear?

And if I have 2 TX and push first TX to pool with 0 fees, will TX confirm?



In your story, both the first tx and the second tx are valid. The difference between the two transactions is that there was a miner out there whose mining node had the "real" tx in it's mempool. This miner found this tx interesting enough (the fee was sufficiently high) to put this tx in the block he was currently solving, and by pure luck, the hash he generated from the header of this block was under the current diff.

If the "real" tx gets added to a block, and this block is propagated to the network, all other nodes will remove the unspent outputs used for the "real" tx from their UTXO set, this will invalidate the "false" tx they had in their mempool because the "false" tx is now using unspent outputs that are no longer in the node's UTXO set (in case they had the false tx instead of the real one in the first place).

A site like blockchain.info, however, has a total independent database where they usually log things like double spends... It's only in such an external database you'll find the "false" transaction...

So, at a certain point, before the "real" transaction was put into a valid block, both transactions had a chance of becoming the "real" transaction, and after the "real" transaction was put into a block, the "false" transaction will dissapear from the network in a matter of seconds and can only be found in external databases that are maintained by thirth parties like blockchain.info.

As for your second question: yes, 0 sat transactions CAN in fact be broadcasted AND can in fact end up in a valid block... However, some nodes do not want to relay 0 fee transactions, and some miners won't add 0 fee transactions into the block they're currently working on, even if their mempool is empty... So, there are decent odds that a 0 fee transaction will long be pruned from the mempool of allmost all nodes before there even is a remote chance of it ending up in a block... It's all odds and averages tough. The odds of winning the bit pool in the national lottery are extremely small, but still, there are people that win the damn thing every couple of weeks/months.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!