A few weeks back I had asked a question about how honest nodes could detect a Selfish Mine Attack and if there were mechanisms that would disclose selfish mining.
In a very first step: I've slightly changed the Bitcoin source code in a way that a selfish node (built from that modified code) run on regtest shouldn't shouldn't report its secret blocks. Now, this doesn't ALWAYS work out because a honest node connected to the selfish node somehow, in a certain scenario, gets to know about hidden blocks and updates its blockchain. I would like to know through what kind of messages/mechanisms a selfish node could blabber out about its headers and eventually blocks, if not through headers and block messages? Or do I miss something?
For a better understanding of my question, I'll sketch it here (h=honest node; s=selfish node):
- SCENARIO (failing selfish mine): first generate secret block, then connect to honest node:
- h: start bitcoin server.
- s: start bitcoin server.
- s: create block #1 (child of genesis block)
- h: addnode "s" add
---version, verack, getaddr and ping messages exchanged (no pong messages!?)---
---wireshark strangely doesn't show any getheaders, headers, getdata or block messages---
BUT ... - h: updatetip: best= block#1!!!
- h: start bitcoin server.
How is this possible without having sent even headers messages, in first place?
WHEREAS:
- SCENARIO (successfull selfish mine): first connect to honest node, then generate secret block
- h: start bitcoin server.
- s: start bitcoin server.
---version, verack, getaddr and ping messages exchanged (no pong messages!?)--- - s: create block #1 (child of genesis block)
---honest node doesn't react and wireshark verifies this by showing no packet exchange---
- h: start bitcoin server.
EDIT:
I looked up hash of block#1 (in reversed byte order) in EVERY message's hexdump but it wasn't there - still honest node was able to update to hidden chain in 1. Scenario!?
inv
, agetdata
, and ablock
message.