<p>A few weeks back I had asked a <a href="https://bitcoin.stackexchange.com/questions/37655/implicit-tacit-mechanisms-in-bitcoin-core-disclosing-selfish-mining">question about how honest nodes could detect a Selfish Mine Attack and if there were mechanisms that would disclose selfish mining</a>.</p>
<p>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 <strong>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?</strong>
Or do I miss something?</p>
<p>For a better understanding of my question, I'll sketch it here (h=honest node; s=selfish node):<br/></p>
<ol>
<li><strong>SCENARIO</strong> (<em>failing selfish mine</em>): first generate secret block, then connect to honest node:<br/>
<ul>
<li>h: start bitcoin server.<br/></li>
<li>s: start bitcoin server.<br/></li>
<li>s: create block #1 (child of genesis block)<br/></li>
<li>h: addnode &quot;s&quot; add<br/>
---<em>version, verack, getaddr and ping messages exchanged (no pong messages!?)</em>---<br/>
---<em>wireshark strangely doesn't show any getheaders, headers, getdata or block messages</em>---<br/> <em>BUT ...</em><br/></li>
<li>h: updatetip: best= block#1!!!<br/></li>
</ul>
</li>
</ol>
<p><em><strong>How is this possible without having sent even headers messages, in first place?</strong></em></p>
<p>WHEREAS:</p>
<ol start="2">
<li><strong>SCENARIO</strong> (<em>successfull selfish mine</em>): first connect to honest node, then generate secret block<br/>
<ul>
<li>h: start bitcoin server.<br/></li>
<li>s: start bitcoin server.<br/>
---<em>version, verack, getaddr and ping messages exchanged (no pong messages!?)</em>---<br/></li>
<li>s: create block #1 (child of genesis block)<br/>
---<em>honest node doesn't react and wireshark verifies this by showing no packet exchange</em>---</li>
</ul>
</li>
</ol>
<hr />
<p><strong>EDIT:</strong><br/>
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!?</p>

CC BY-SA 3.0
2015-06-18T18:03:59.530Z
That's very strange. You should get, at minimum, an `inv`, a `getdata`, and a `block` message.
Nick ODell
CC BY-SA 3.0
2015-06-18T18:05:25.253Z
@NickODell: With 2. Scenario everythings going as planned.. but 1. Scenario is strange but true.
Aliakbar Ahmadi
CC BY-SA 3.0
2015-06-18T18:07:28.960Z
Hmmm. Could you post a wireshark log of scenario #1 to a filehosting site, and link it here?
Nick ODell
CC BY-SA 3.0
2015-06-18T18:25:17.093Z
@NickODell: This is a wireshark-specific pcapng-file: http://www.filedropper.com/selfishnessfailedpackets can you open it? If not I'll upload hexdumps one by one and upload them. And this is a screenshot: http://www.filedropper.com/selfishminingtest
Aliakbar Ahmadi
CC BY-SA 3.0
2015-06-19T02:19:18.063Z
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
CC BY-SA 3.0
2015-06-19T09:47:10.243Z
Ok weird. I didn't see any of those, yes please can you send a screenshot?
Aliakbar Ahmadi
CC BY-SA 3.0
2015-06-19T09:47:40.177Z
Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/24983/discussion-between-aliakbar-ahmadi-and-nick-odell).
Aliakbar Ahmadi
<message><testing><regtest><selfish-mining>
Leakage of information about selfish mining - what message is responsible?
Aliakbar Ahmadi
# Leakage of information about selfish mining - what message is responsible?

(Asked by: username_0 on 2015-06-18)

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](https://bitcoin.stackexchange.com/questions/37655/implicit-tacit-mechanisms-in-bitcoin-core-disclosing-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:

2. **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!?

**Tags:** message, testing, regtest, selfish-mining

> **Comments:**
> **username_1**: That's very strange. You should get, at minimum, an `inv`, a `getdata`, and a `block` message.  
> **username_0**: @username_1: With 2. Scenario everythings going as planned.. but 1. Scenario is strange but true.  
> **username_1**: Hmmm. Could you post a wireshark log of scenario #1 to a filehosting site, and link it here?  
> **username_0**: @username_1: This is a wireshark-specific pcapng-file: http://www.filedropper.com/selfishnessfailedpackets can you open it? If not I'll upload hexdumps one by one and upload them. And this is a screenshot: http://www.filedropper.com/selfishminingtest  
> **username_1**: 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?  
> **username_0**: Ok weird. I didn't see any of those, yes please can you send a screenshot?  
> **username_0**: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/24983/discussion-between-username_0-and-username_1-username_1).  

---

## 0 answers

