Bitcoin Forum
April 19, 2024, 10:42:15 PM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question about doublespend  (Read 166 times)
kzv (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1285

OpenTrade - Open Source Cryptocurrency Exchange


View Profile WWW
November 28, 2018, 10:18:16 AM
 #1

Hi

I have look at this code https://github.com/bitcoin/bitcoin/blob/master/src/consensus/tx_verify.cpp#L183
So my question: if bad miner will include into his block a transaction with duplicate inputs then bitcoin nodes will not check this and the block will valid?

OpenTrade - Open Source Cryptocurrency Exchange
1713566535
Hero Member
*
Offline Offline

Posts: 1713566535

View Profile Personal Message (Offline)

Ignore
1713566535
Reply with quote  #2

1713566535
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713566535
Hero Member
*
Offline Offline

Posts: 1713566535

View Profile Personal Message (Offline)

Ignore
1713566535
Reply with quote  #2

1713566535
Report to moderator
1713566535
Hero Member
*
Offline Offline

Posts: 1713566535

View Profile Personal Message (Offline)

Ignore
1713566535
Reply with quote  #2

1713566535
Report to moderator
1713566535
Hero Member
*
Offline Offline

Posts: 1713566535

View Profile Personal Message (Offline)

Ignore
1713566535
Reply with quote  #2

1713566535
Report to moderator
HeRetiK
Legendary
*
Offline Offline

Activity: 2912
Merit: 2066


Cashback 15%


View Profile
November 28, 2018, 10:37:16 AM
Merited by mocacinno (1), LoyceV (1)
 #2

Hi

I have look at this code https://github.com/bitcoin/bitcoin/blob/master/src/consensus/tx_verify.cpp#L183
So my question: if bad miner will include into his block a transaction with duplicate inputs then bitcoin nodes will not check this and the block will valid?

No. A block that includes a double-spend is invalid and as such will be discarded by the other nodes. (both mining and non-mining nodes)

Edit: If I recall correctly a misusage of this function is what caused vulnerability CVE-2018–17144, which would have potentially allowed for double-spend attacks the way you described.

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

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

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

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

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

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











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











▄▄▄▄█
kzv (OP)
Legendary
*
Offline Offline

Activity: 1722
Merit: 1285

OpenTrade - Open Source Cryptocurrency Exchange


View Profile WWW
November 28, 2018, 10:52:00 AM
 #3

Hi

I have look at this code https://github.com/bitcoin/bitcoin/blob/master/src/consensus/tx_verify.cpp#L183
So my question: if bad miner will include into his block a transaction with duplicate inputs then bitcoin nodes will not check this and the block will valid?

No. A block that includes a double-spend is invalid and as such will be discarded by the other nodes. (both mining and non-mining nodes)

Edit: If I recall correctly a misusage of this function is what caused vulnerability CVE-2018–17144, which would have potentially allowed for double-spend attacks the way you described.

Thank you.

OpenTrade - Open Source Cryptocurrency Exchange
HeRetiK
Legendary
*
Offline Offline

Activity: 2912
Merit: 2066


Cashback 15%


View Profile
November 28, 2018, 10:57:09 AM
Merited by LoyceV (1)
 #4

Hi

I have look at this code https://github.com/bitcoin/bitcoin/blob/master/src/consensus/tx_verify.cpp#L183
So my question: if bad miner will include into his block a transaction with duplicate inputs then bitcoin nodes will not check this and the block will valid?

No. A block that includes a double-spend is invalid and as such will be discarded by the other nodes. (both mining and non-mining nodes)

Edit: If I recall correctly a misusage of this function is what caused vulnerability CVE-2018–17144, which would have potentially allowed for double-spend attacks the way you described.

Thank you.

You're welcome. I did a little digging and if I'm not mistaken this was the commit that fixed it:

https://github.com/bitcoin/bitcoin/commit/4b8a3f5d235f40be8102506ab26caad005cc40d6

I'm not sure why they didn't remove the comment about skipping this check in CheckBlock() though.

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

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

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

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

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

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











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











▄▄▄▄█
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!