Building bitcoind from modified "selfish" code - possible? how?

0

For a long time I've been trying to find out ways for running a "selfish mine" 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?

Aliakbar Ahmadi

Posted 2015-05-27T17:11:41.930

Reputation: 1 415

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 – 2015-05-28T10:09:08.410

thanks, I'll edit the post in a while for a clearifying things. – Aliakbar Ahmadi – 2015-05-28T10:21:50.120

No answers