0

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):

  1. 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!!!

How is this possible without having sent even headers messages, in first place?

WHEREAS:

  1. 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---

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!?

  • That's very strange. You should get, at minimum, an inv, a getdata, and a block message. – Nick ODell Jun 18 '15 at 18:03
  • @NickODell: With 2. Scenario everythings going as planned.. but 1. Scenario is strange but true. – Aliakbar Ahmadi Jun 18 '15 at 18:05
  • Hmmm. Could you post a wireshark log of scenario #1 to a filehosting site, and link it here? – Nick ODell Jun 18 '15 at 18:07
  • @NickODell: This is a wireshark-specific pcapng-file: filedropper.com/selfishnessfailedpackets can you open it? If not I'll upload hexdumps one by one and upload them. And this is a screenshot: filedropper.com/selfishminingtest – Aliakbar Ahmadi Jun 18 '15 at 18:25
  • I can open it. I don't see the same thing - I see pong, getheaders, headers. Want a screenshot, or do you see it too? – Nick ODell Jun 19 '15 at 2:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.