r/dogemining • • Feb 05 '14

Something is rotten in the state of DOGE mining

645 Upvotes

Shibes, something stinks in doge land. A problem in the design of dogecoin means that dishonest (or perhaps we should call them "creative") miners can take a disproportionate share of rewards, leaving everyone else to earn less than they deserve. Many of you have probably noticed that calculators estimate payouts larger than what you earn in practice (for example, dustcoin estimates ~1500DOGE/day @ 200KH/s while Non Stop Mine pays about a quarter of that rate), and most have written it off as bad luck: the blocks your pool found happened to be small, or your pool happened to be unlucky, and such is life. At least another friendly Shibe is having a better day, and it'll come around in tips anyway! Unfortunately, the truth is much darker.

The "random" DOGE rewards per block are not random. In fact, the value of each block is predetermined by a simple equation applied to the hash of the previous block. A creative miner can take advantage of this fact to mine dogecoin when the potential reward is high, and switch to litecoin when the potential reward is low. During some rounds, the reward is so small it isn't worth the electricity spent finding it; during more rounds, the reward is less than can be earned mining LTC; in a few rounds, the reward is spectacular. Honest miners mine with the expectation of earning an average of 500,000 DOGE per block, but when people are selectively mining the high-profit DOGE rounds, the average reward falls for honest miners.

So the question is: is this problem theoretical, or are honest miners really losing value to cheaters? I spent some time digging, and it appears that cheating is rampant! There are a few ways cheating can be detected.

If there is outside competition for high-value blocks, then pools should on average be finding blocks worth less than 500,000 DOGE (because some of the valuable blocks, but none of the low-value blocks, will be found by cheaters). The largest pool, Dogehouse, reports some useful averages: over all time, the pool has found 11,241 valid blocks worth 5365077071.0746 DOGE, for an average of 477,277 DOGE (including fees, which should actually raise the average above 500,000!). That's 4.5% below the expected average block value. Is it simply bad luck? No. With so many blocks found, there's about a 7% chance that the average will be above 505,000 or below 495,000; there's a <<1% chance their average will be above 510,000 or below 490,000, and effectively NO chance of seeing an average below 485,000. 477,000 is simply preposterous. Dogepool is either mind-bogglingly unlucky, or something is fishy.

Maybe Dogehouse is doing something fishy...but we can look at other pools. Dogechain's pool's all-time average block value is similar: 478847 DOGE. They're a smaller pool so the odds of this being bad luck aren't astronomical, but it's not very likely. Fast-pool's average is 477892. They're big enough that the odds are again astronomical.

And this only accounts for people cheating outside of the pools. Cheaters can operate inside our pools (more on this later)!

Maybe there's something wrong with the pools. They mostly run similar software. All their owners could be lying to us. We can check for signs of cheating independent of the pools: if more people are mining high-value blocks than low-value blocks, the hash-rate will be higher when the next block is high-value, so high-value blocks will be found faster than low-value blocks. Here's what you find if you look at 5000 recent blocks (blocks 80,001 to 85,000) and measure the average time to find a block, broken out by the block value:

  • 0-99,999 reward: 64.3 seconds (465 blocks)

  • 100,000-199,999 reward: 62.6 seconds (486 blocks)

  • 200,000-299,999 reward: 68.5 seconds (521 blocks)

  • 300,000-399,999 reward: 70.2 seconds (500 blocks)

  • 400,000-499,999 reward: 58.0 seconds (523 blocks)

  • 500,000-599,999 reward: 59.4 seconds (488 blocks)

  • 600,000-699,999 reward: 58.7 seconds (500 blocks)

  • 700,000-799,999 reward: 55.6 seconds (514 blocks)

  • 800,000-899,999 reward: 56.7 seconds (471 blocks)

  • 900,000-999,999 reward: 58.1 seconds (479 blocks)

I had to drop about 50 blocks which were missing good timestamps, but they're evenly distributed and shouldn't skew the averages.

The pattern is clear: the network is finding high-value blocks significantly faster than low-value blocks. Low-value rounds take as much as 10% longer than intended, and high-value rounds take around 5% less time than intended. Significant hashrate belongs to miners that cheat.

I mentioned cheaters can operate inside our pools. The payment algorithms used by most pools were carefully designed for bitcoin's (effectively) fixed block reward. They reliably protect against cheaters trying to hop in and out of pools based on short-term profitability, by making payouts solely dependent on the unknowable future (the straightforward pool payment schemes allow cheaters to look at a pool's recent history and use that to take an unfair share of its earnings; read this awesome paper for details). Since the future reward for a bitcoin pool is completely unknowable, PPLNS does not protect against a hopper who knows the future. In the case of Dogecoin, the future reward IS knowable, and PPLNS offers no protection.

Dogehouse is so big we can reasonably assume they'll find any particular block. Dogehouse is using a PPLNS target similar to an ordinary round's length. Someone who mines only during high-value rounds will, with high confidence, earn significantly more DOGE per share submitted than someone who mines Dogecoin 24/7. They also experience much lower variance in earnings.

The random block reward size needs to be removed. It's fun, but it rewards cheaters. Developing a more secure random block value selection technique is possible, but based on observations of GitHub, I do not trust the Dogecoin creator to get it right. Even subtle errors re-open the opportunity for cheating.

While I believe cheating is already unacceptably common, many will disagree until it worsens. To force the issue, I've included everything you need to join the cheaters.

Patch dogecoin/src/main.cpp:

diff --git a/src/main.cpp b/src/main.cpp
index 2af23af..8c32dad 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1794,6 +1794,8 @@ bool CBlock::ConnectBlock(CValidationState &state, CBlockIndex* pindex, CCoinsVi
         prevHash = pindex->pprev->GetBlockHash();
     }
 
+fprintf(stdout, "Next block value: %lld\n", GetBlockValue(pindex->nHeight, 0, GetHash()));
+fflush(stdout);
     if (vtx[0].GetValueOut() > GetBlockValue(pindex->nHeight, nFees, prevHash))
         return state.DoS(100, error("ConnectBlock() : coinbase pays too much (actual=%"PRI64d" vs limit=%"PRI64d")", vtx[0].GetValueOut(), GetBlockValue(pindex->nHeight, nFees, prevHash)));

Perl script to control cgminer:

#!/usr/bin/perl

use strict;
use warnings;

my $ltcMiner  = "192.168.1.1 4029";
my $dogeMiner = "192.168.1.1 4028";

open (INSTREAM, "dogecoind|") or die;
my $lastPool = 0; # LTC
while (my $line = <INSTREAM>) {
	if ($line =~ /Next block value: ([\d].*)/) {
		my $val = $1;
		if ($val >= 70000000000000) {
			# High-value DOGE round
			if ($lastPool == 0) {
				# Switch from LTC to DOGE
				$lastPool = 1;
				&onoff($dogeMiner, "en");
				&onoff($ltcMiner, "dis");
			} else {
				# Already mining DOGE
			}
		} elsif ($lastPool == 1) {
			# Low-value DOGE round and currently mining DOGE
			$lastPool = 0;
			print " Switching to LTC\n";
			&onoff($ltcMiner, "en");
			&onoff($dogeMiner, "dis");
		} else {
			# Low-value DOGE round; already mining LTC anyway
		}
	}
}
close (INSTREAM);
exit;

sub onoff {
	my $miner = shift;
	my $enDis = shift;
	open (OUT1, "|nc $miner") or die $!;
	print OUT1 "gpu${enDis}able|0";
	close (OUT1);
}

Then, simply run two instances of cgminer with separate API ports, one configured for LTC and the other configured for DOGE.


r/dogemining • • Feb 12 '14

Things that are hot.

Thumbnail
imgur.com
310 Upvotes

r/dogemining • • Mar 08 '14

My childhood wish has came true!!!

Post image
259 Upvotes

r/dogemining • • Feb 06 '14

All your Dogecoin are belong to us!

Thumbnail
imgur.com
257 Upvotes

r/dogemining • • Jan 28 '21

Y’all better get on Doge Coin or FOMO will be on your foreheads!! If Doge Coin hits 30k I’ll pay anyone’s student loans if you share and up this pictures and comments

Post image
232 Upvotes

r/dogemining • • Feb 21 '14

It's the miner successes that count

Post image
191 Upvotes

r/dogemining • • Feb 25 '14

Welcome to Dogecoin mining

Post image
188 Upvotes

r/dogemining • • Apr 04 '14

My New Rig!

Thumbnail
fbcdn-sphotos-d-a.akamaihd.net
187 Upvotes

r/dogemining • • Jan 17 '14

Any fellow CPU miners out there?

Thumbnail
imgur.com
178 Upvotes

r/dogemining • • Feb 04 '14

Am I the only one who is bored of seeing pictures of graphics cards still in a box ? I can see that at the store . I'd much rather see your finished rig !

166 Upvotes

r/dogemining • • Apr 02 '14

290x Doge Farm

Thumbnail
imgur.com
151 Upvotes

r/dogemining • • Feb 08 '14

What I thought my first 12 hours of mining would be like.

Post image
150 Upvotes

r/dogemining • • Feb 03 '14

i started mining and earned 5 DOGE yesterday

Thumbnail
imgur.com
149 Upvotes

r/dogemining • • Feb 23 '14

Wife said living-room was too cold

Post image
139 Upvotes

r/dogemining • • Feb 01 '14

Just got my first power bill for a full month's mining

Post image
138 Upvotes

r/dogemining • • Jan 29 '21

Here is the plan !!! DOGE to the moon 🚀🚀

Post image
131 Upvotes

r/dogemining • • Apr 29 '14

What kind of hashrate can I expect from my new rig?

Post image
130 Upvotes

r/dogemining • • May 13 '14

Why has no one done this with their mining rig? [Fixed]

Post image
126 Upvotes

r/dogemining • • Feb 15 '14

Mining Rig + Thermal Camera == ??

125 Upvotes

Time for some science! Just happened to have access to a thermal camera for the weekend, so naturally I grabbed some pics of the rig.

Much doge, such heat

Enjoy!


r/dogemining • • Feb 09 '14

I found a block.

124 Upvotes

I have been mining for around a 1.5 years. First bitcoin then litecoin and now doge. I have never once found a block ever. I've always felt bad about it. I felt like a parasite just leeching off of blockfinders in pools, but last night it happened! I saw a 1,000 doge bonus in my pool transactions and sure enough it was there. MY block. My humble 6950 generated a hash that found a block that the dogechain will have to deal with forever. Frozen out of space and time. A record of my time on this earth. Damn this shit is cool.


r/dogemining • • Jan 29 '14

Hashrate went up, gpu temps went down?

124 Upvotes

r/dogemining • • Jan 30 '14

500% shares, orphaned block

120 Upvotes

r/dogemining • • Feb 17 '14

[ATTENTION] Hard fork detected on the network! Please read!

118 Upvotes

As a few of you probably know right now, there was a hard fork on the network a couple hours before this post. It seems that, like the last one, there was nodes on the network on older versions, and they borked when a transaction that was too big came through the network.

Things you should do:

  • Make sure you're on the latest version of Dogecoin-QT

  • Keep you any Doge you have wherever it is (tipbots, exchanges, pools) until they verify that they are on the latest client AND the right blockchain. Most pools are freezing anyways while doing a self-audit just to assure users, but be safe just in case.

  • If your pool is not on the right side of the fork, switch to a pool that it. Any hashing buried into the wrong side of the fork is null and void.

Above all, don't panic. Hard forks are issues, but they are not insurmountable. Make sure you and the services you use are on the good blockchain, and carry on.

EDIT: The sticky on /r/dogecoin with more info can be found here

EDIT2: Pool owners, please modmail this subreddit when you're on the right fork, and I'll update my posts saying that you're a safe pool.

EDIT3: You can independently verify a traditional pool by comparing its block and diff (mostly the diff) against Dogehouse and a P2P pool by comparing their last blocks found against doge.st. If a pool doesn't list their diff on their site, you can see by connecting to the pool's stratum (cgminer will tell you the network diff according to that pool, which you compare against Dogehouse), or check the current block hash against your wallet like this as per /u/Reddevilmenance.


r/dogemining • • Mar 28 '14

5.1Mh/s Mining Rig Hidden Behind T.V. Runs Safe And Cool Too.

Thumbnail
imgur.com
117 Upvotes