<p>For a long time I've been trying to find out ways for running a "<a href="http://arxiv.org/abs/1311.0243" rel="nofollow">selfish mine</a>" algorithm on bitcoind's regtest mode.<br/></p>

<p><strong>Now I'm wondering if my plan is feasible, at all!?</strong> <br/>
So I'll just outline my planned procedure with the hope that I will get useful hints and won't get discouraged since I believe I can achieve my goal with the help of developers and investment of some extra time:<br/></p>

<p>I'm intending to change Bitcoin Core 0.10.0 source code - or a more "suitable" version - in a way that after building bitcoind, in regtest the bitcoind server that is started acts as a selfish miner.<br/>
This selfish miner shall connect to other bitcoind nodes that are instances of bitcoind, built out of non-modified code.</p>

<p>My idea is to change a part of the code that communicates (e.g. inv message-part!?) with other nodes: as a selfish miner, newly found blocks should only be shared with other nodes dependent on the selfish mine algorithm so I thought of implementing control structures (if, while, etc.) that work with a comparison of inv message's amount of inventory entries or a similar comparison - e.g. selfish node has found a block and appends it to its inventory and doesn't publish this block if size(selfish.inventory) > size(honest.inventory).</p>

<p>Now a challenge for me is to find out <strong>which part of the source code to modify?</strong> Since it consists of multiple modules that define resembling functions, parameters etc.</p>

<p>I'm ready to read up big amount of code, but the problem is I don't know what part is relevant for my problem.</p>

<p><strong>What do you think? Is my intention realistic? What are good approaches to a solution?</strong></p>

CC BY-SA 3.0
2015-05-28T10:09:08.410Z
I think you'll find a lot more help forthcoming (and your project will be easier for *you*) if you can delineate your intentions more clearly. What I'm reading is very vague. Start by defining "selfish miner" and it may be people can opine on that
Wizard Of Ozzie
CC BY-SA 3.0
2015-05-28T10:21:50.120Z
thanks, I'll edit the post in a while for a clearifying things.
Aliakbar Ahmadi
<bitcoind><regtest><selfish-mining>
Building bitcoind from modified "selfish" code - possible? how?
Aliakbar Ahmadi
# Building bitcoind from modified "selfish" code - possible? how?

(Asked by: username_0 on 2015-05-27)

For a long time I've been trying to find out ways for running a "[selfish mine](http://arxiv.org/abs/1311.0243)" algorithm on bitcoind's regtest mode.

**Now I'm wondering if my plan is feasible, at all!?**   
So I'll just outline my planned procedure with the hope that I will get useful hints and won't get discouraged since I believe I can achieve my goal with the help of developers and investment of some extra time:

I'm intending to change Bitcoin Core 0.10.0 source code - or a more "suitable" version - in a way that after building bitcoind, in regtest the bitcoind server that is started acts as a selfish miner.  
This selfish miner shall connect to other bitcoind nodes that are instances of bitcoind, built out of non-modified code.

My idea is to change a part of the code that communicates (e.g. inv message-part!?) with other nodes: as a selfish miner, newly found blocks should only be shared with other nodes dependent on the selfish mine algorithm so I thought of implementing control structures (if, while, etc.) that work with a comparison of inv message's amount of inventory entries or a similar comparison - e.g. selfish node has found a block and appends it to its inventory and doesn't publish this block if size(selfish.inventory) > size(honest.inventory).

Now a challenge for me is to find out **which part of the source code to modify?** Since it consists of multiple modules that define resembling functions, parameters etc.

I'm ready to read up big amount of code, but the problem is I don't know what part is relevant for my problem.

**What do you think? Is my intention realistic? What are good approaches to a solution?**

**Tags:** bitcoind, regtest, selfish-mining

> **Comments:**
> **username_1**: I think you'll find a lot more help forthcoming (and your project will be easier for *you*) if you can delineate your intentions more clearly. What I'm reading is very vague. Start by defining "selfish miner" and it may be people can opine on that  
> **username_0**: thanks, I'll edit the post in a while for a clearifying things.  

---

## 0 answers

