I've recently decided to tinker with solo mining because
according to this Digitalcoin (DGC) should take about a 0.58 day (~14 hr, but SEE BELOW at how fast I'm finding blocks) to find a new
block at my current 1400 khash/s rate with my two Titans. And right now Digitalcoin is one of the highest valued at
http://dustcoin.com/ (and has been for about a week).
I am new to solo mining (heck, still a mining newbie!); so, please post corrections and I'll update this how-to.
What is solo mining? Solo mining is using your system resources to mine for 1 single "block". Once you find a "block", you are awarded XX number of coins in that currency for finding that block. The "reward" is the the amount of coins that end up in your "wallet."
Ok, so what exactly is a "block"?I am taking a guess (until I get confirmation); but, think about what exactly "mining" is using your system resources for. It is to generate a cryptic hash string. Here's an example of a real Litecoin hash:
adf6e2e56df692822f5e064a8b6404a05d67cccd64bc90f57f65b46805e9a54b
A single "
block" is this hash wrapped in metadata. That meta holds the information about the block. Here's that same Litecoin hash above in the real block # 29255 of the Litecoin blockchain located here:
https://litecoin.info/Scrypt#Example_dbdump_of_block_29255 ./dbdump.py --datadir=/home/mining/.litecoin/ --block 29255
Block height: 29255
BLOCK adf6e2e56df692822f5e064a8b6404a05d67cccd64bc90f57f65b46805e9a54b
Next block: 0000000000000000000000000000000000000000000000000000000000000000
Time: Wed Nov 9 16:15:52 2011 Nonce: 3562614017
nBits: 0x0x1d018ea7
hashMerkleRoot: 0x066b2a758399d5f19b5c6073d09b500d925982adc4b3edd352efe14667a8ca9f
Previous block: 279f6330ccbbb9103b9e3a5350765052081ddbae898f1ef6b8c64f3bcef715f6
1 transactions:
1 tx in, 1 out
TxIn: COIN GENERATED coinbase:04b217bb4e022309
TxOut: value: 50.000000 pubkey: 1HXG8MWvUFNU3pLpQUJueSC4kHcrNepuwC Script: 65:0448...b8cd CHECKSIG
Raw block header: 01000000f615f7ce3b4fc6b8f61e8f89aedb1d0852507650533a9e3b10b9bbcc30639f279fcaa86746e1ef52d3edb3c4ad8259920d509bd073605c9bf1d59983752a6b06b817bb4ea78e011d012d59d4
That information makes up the entire single "block" at the public address of adf6e2e56df692822f5e064a8b6404a05d67cccd64bc90f57f65b46805e9a54b.
Mining is generating these raw hashes, as fast as possible, and comparing them to "
known blocks" in the blockchain. Known blocks is the public ledger for coin type that has been published. The actual known hashes are not known, and that's the whole point of mining: to find them! You create a hash, and compare it to the public ledger in some additional hashing technique, including the difficulty factor. If a match is found, bingo, you found a "block"!
Thinking about password cracking. There is encryption of passwords and there are hashing of passwords. What's the difference between encrypting and hashing? Encryption is reversible if you have the encryption key; whereas, hashing is one-way and none-reversible. The only way to find a hashed password is to brute-force attack a database. You brute force by taking a string you think is a password, e.g. "MyPassword", and hashing it. Then compare that hash to what is stored in the database. If you find a matching hash, guess what, you know the password used before it was hashed.
Solo Mining is attempting to find those blocks on your own. You iterate through as many hashes as possible until you find a "block". Most coins can take a long time to find a block with their current difficulty. Pool Hashing is the process of pooling your resources with others to find those blocks faster. If you have 1000 people generating the same hash rate as you, chances are you will all find a block 1000x faster.
"Chances are" is an interesting statement.You see, it is unknown in how long it will take you to find a block. Your 2nd hash could be a match, or your 12th trillion hash could be a match. That's the randomness and difficulty factor of it. The difference is low difficulties make finding matches faster. That's why most people pool their resources.
What are some of the risks? I've read a lot of warnings on solo mining, so note some cautions before taking on this adventure:
- You could spend all this time mining for a block, find a block, but it could be a duplicate of another block someone has already found.
- Or the block you find could be too stale to be accepted. E.g. you lose everything with it being "Rejected" or classified as "Stale."
- Most blocks are easiest to find at launch of a new coin. After time, blocks become very difficult and time consuming to generate - e.g. "difficulty" levels.
- As an example, at my 1400 khash/s as of today, it would take me about 9 days to find 1 block of Dogecoin. Much slow.
- It would take me a little over 6 months to find 1 single Litecoin block solo mining - which may be invalid by then.
- It would also take me about 3 years to get 1 block of bitcoin, which would be 25 coins at the current reward. But still, 3 years!
- If you don't finish a block, all that time mining is wasted electrical costs. For example, say you are able to estimate mining a block in about 22 days. You start and you are up and down, playing games, rebooting, studying for school, etc. You've spent about $15 in electrical costs so far. That's it, you've lost it.
What are the advantages then?In a word: rewards. The rewards, as mentioned above, are the amount of coins awarded when a block has been completed and accepted.
You will see this in your log you when complete a single block:
[2014-01-07 17:34:51] GPU #1: GeForce GTX TITAN, 2983680 hashes, 592.57 khash/s[2014-01-07 17:34:51] GPU #0: GeForce GTX TITAN, 3212160 hashes, 649.43 khash/s[2014-01-07 17:34:54] GPU #0: GeForce GTX TITAN, 1545600 hashes, 636.70 khash/s[2014-01-07 17:34:54] accepted: 1/1 (100.00%), 1229 khash/s (yay!!!)[2014-01-07 17:34:56] GPU #1: GeForce GTX TITAN, 2970240 hashes, 595.12 khash/s[2014-01-07 17:34:59] GPU #0: GeForce GTX TITAN, 3185280 hashes, 644.39 khash/s[2014-01-07 17:35:01] GPU #1: GeForce GTX TITAN, 2983680 hashes, 594.58 khash/s ^- I was eagerly awaiting mine all day since all I got were hashes. BAM, got my first Digitalcoin and 15.10 coins in my wallet!
There are also other advantages I am noticing:
- Less network traffic. You are mining directly against your local machine, not connecting to an external pool. (Does anyone know if this works offline, or with intermediate connectivity?)
- No "DoS" attacks against the pools. This is your local machine, do as you wish.
- Want to fall back? No problem, setup a DOS batch or linux shell script to loop after a timeout - to retry your own wallet. Or, setup multiple different wallets in case your main wallet app crashes. (I am not sure what happens if you have multiple copies of the same wallet open across different machines. Does your mining 'transfer' over to the other one? I wouldn't think so, since only "blocks" gets submitted/transferred."
- You aren't sharing the awards with other users - especially VARIABLE pools that give slight advantages to lower-hashing users (less than 500 khash/s from what I've been seeing). It's a bunch of voodoo and hard to know exactly what the pool is doing (though I am sure most can be trusted).
- No pool fees - you are your own pool!
- You also get a cool "mining" icon instead of a coin icon in your wallet, like this:
How do you estimate how long it would take to mine a single block?This is hard to figure out with fluctionations in the difficulty, the risks stated above, etc. It can vary greatly.
I basically used
www.coinwarz.com to estimate that at my 1400 khash/s scrypt rate, I could find a single block of DGC coin every 0.58 day at the time of this posting (welll, 8 hours ago when I started). That's a single block every ~14hr or so.
I also wrote a quick javascript snippet for those that want to see the math and run it yourself:
http://jsfiddle.net/eduncan911/UXJR5/ ^- update this to the difficulty factor of whatever coin you are interested in, and your khash rate. Use
www.coinwarz.com to find the difficulty as they list just about everyone.
Well, that's a rough estimate and can vary greatly. So....
What were your results Eric?Again, take this with a grain of salt because of the risks noted above. I just started solo mining this morning and have found my first two blocks!
[2014-01-07 10:15:06] 2 miner threads started, using 'scrypt' algorithm.[2014-01-07 17:34:54] accepted: 1/1 (100.00%), 1229 khash/s (yay!!!)[2014-01-07 20:25:03] accepted: 2/2 (100.00%), 1206 khash/s (yay!!!) Notice that I found my first block in just over 7 hours? And then a 2nd one just shy of 3 hours later! Not 14 hours that was originally estimated, but just 7 hours and then 3! I'll leave it going and will come back to update this post. But, at this rate, I'm on target to earn 55 coins in a 24hr period, not 28 coins as estimated by other DGC pools and coinwarz.com.
Uh, that's a serious advantage to solo mining! I am sitting on 30.10 DGC right now, which is worth 0.01184313 or $~10 USD at the time of this update ($881 BTC). At this rate, I might clear $25 or $30 worth in a single day! Not bad for a couple of Titans. Man I want my 7990s to get here fast!
I'll tell you what though. The first, or maybe second rejection I get (if any) will quickly put me off of solo mining and I'll be back to pooling.
What should you do then?Basically, you want to join a pool and mine there. That's first and foremost the best advice because the pool shares the risks noted above (stales, rejections, etc). Pool mining finds several blocks quickly, and depending on their hashrate, could dish out rewards several times a day. Pool mining also usually accepts your mining quickly, like several per minute. You can spin up and shut down as often as you want, with credit given on just your short time mining.
Only if a coin comes along, or if one is launching soon (like
Kanye West Coin, lol), or if a coin has a very short block finding rate, would solo mining be interesting for the reward.
Basically, it's a gamble. You are gambling you can find blocks faster than the estimated difficulty factor of the coin, before it ramps up the difficulty. So, I will be gambling that I can find digitalcoins faster than the 0.58 day (14hr) estimate of my hashrate and current difficulty factor.
Ok, thanks for the info... Shut up and tell me how do you setup solo mine then!This is not a completely guide. I am only going to mention a Windows method for right now. When I get my linux boxes up, I'll update the guide on how to do it on Linux. But no matter the platform, the basics are this:
- Setup a Wallet, open the wallet, and keep it running on the desired machine.
- Most wallet software is also a "Server"! Yep, it opens a port and lets you mine directly against the wallet - especially these Wallet-QT bitcoin wallet clones that the Alt coins are using (Dogecoin-qt, Litecoin-qt, Digitalcoin-qt, etc).
- It takes a little special configuration file to configure a Wallet to act as a server. See below.
- Configure your miner (cgminer, cudaminer, etc) to talk to your Wallet's IP address (or if on the same machine, localhost or 127.0.0.1).
Optionally, most of these -QT wallet windows applications also lets you CPU mine. I am not going to cover that in this How To.
Step 1. Download a Wallet application and set it up normally with an address. Every coin has a nice Introduction webpage instructing you on how to download their wallet, and how to set it up. Make sure to Encrypt it!
Step 2. Close the Wallet app, and edit the conf file. The default location is in the C:\Users\[username]\AppData\Roaming\[Wallet_name]\ directory. For example:
C:\Users\Eric\AppData\Roaming\Digitalcoin\digitalcoin.conf It should be there already. If not, you may want to grab the one that was included in the ZIP file of your wallet. b If there wasn't one included with your Wallet (e.g. 66 Coin), then you can just create one called "Wallet executable".exe. For example, for 66 Coin, call it:
Digitalcoin.exe's config file is: digitalcoin.conf
66.exe's config file is: 66.conf
Do note that the config file MUST be in the directory listed above in the Roaming part. That's the only place it is read from. Technically, newer versions/distros of these wallet apps will let you change this location. I don't support this in this How To as that is an advanced topic using command line parameters.
Step 3. Enter these values in that conf file. Make sure they only appear once. Do not delete anything already in the conf file:
listen=1daemon=1server=1rpcuser=jamesrpcpassword=deanrpcport=3333rpcconnect=127.0.0.1rpcallowip=172.16.*.* rpcuser and rpcpassword can be anything. Do note that it is transmitted over clear text over your local network. So don't use something too cryptik. Heck, if someone does guess your username/password, why not let them mine coins for you!
rcpallowip isn't really needed from what I read, but I put mine there anyways with my IP mask. I do plan on using more machines to connect to it (making sure the firewall port is open for 3333).
I think rpcconnect is the IP address to bind to. I'm guessing, and I'll find out later when I try to use multiple machines. If so, then you want to set this to your actual IP address. Or, I think you can even omit the entire rpcconnect and it may bind to all IPs (I think that's what I read in the readme). I only have it as that's what everyone else had.
Step 4. Create a new shortcut to your Wallet application executable. You can right-click on digitalcoin.exe, select Send To, and click Desktop (shortcut). This creates a shortcut on your desktop (in which you can add to your Taskbar (Win7/8) and Start Menu (Win8) later by right-clicking that shortcut on your desktop). Name this shortcut "Digitalcoin (Server)"
You need to right-click that shortcut on your desktop, goto Properties, and at the end of the TARGET, you need to enter -server. Like this:
"C:\Users\Eric\Google Drive\Program Files\Digitalcoin\digitalcoin-qt.exe" -server ^- Note, your application will be unzipped to a different directly. This is specific to my machine, where I use Google Drive to share "portable" apps so I don't have to frack with setting them up multiple times across different machines. This is NOT my AppData\Roaming folder either!
^- Note 2 that I originally had the digitalcoin.conf file here, at this location. It didn't seem to be read or found. I had to move it to the AppData\Roaming\digitalcoin\ folder for it to be seen! You'll get the error as well if it is not there.
Step 5. Double-click the "Digitalcoin (Server)" shortcut, and let the Wallet open. With the -server parameter, it must read the conf file - in which it will tell you if there are any errors. Now, sit back and let the blocks sync before continuing. I let it sync overnight, as I mined more Dogecoins in the fast-pool I was using.
Step 6. Last, but NOT least: change your miner(s) to point to your new Wallet! If on the same machine, using cudaminer, that command line would look like:
C:\cudaminer-2013-12-18\x86\cudaminer -d 0,1 -i 0,0 -m 1,1 -l T14x30,T14x30 -H 1 -o localhost:3333 -O james:dean 2>> logfile.txt ^- that is the exact line I am running with my Titans. You can ignore the options, and focus only on the -o and -O parts.
^- note, you may want to start logging your output. You can do this with cudaminer with "2>> filename.txt". Make sure the "2" is there next to the 2>>. The author of cudaminer does some weird piping of printf and requires this type of redirect.
If you are using cgminer or alike, just change the stratum+tcp://host-name.com to "localhost:3333", that's all. If it doesn't connect, try tcp or http like stratum+tcp://localhost:3333 or stratum+
http://localhost:3333. I haven't got my ATI machines up yet so I haven't used cgminer yet to know.
Felina. That's it, you are now mining!
Again, heed the advice to lookup the estimated time to find a block for your coin of choice (e.g. at coinwarz.com). I am only doing this with short times for blocks because I don't want to wait. Mainly because starring at 100s of lines like these for hours...
[2014-01-07 15:21:17] GPU #1: GeForce GTX TITAN, 3494400 hashes, 695.86 khash/s[2014-01-07 15:21:17] GPU #0: GeForce GTX TITAN, 3521280 hashes, 705.72 khash/s[2014-01-07 15:21:22] GPU #1: GeForce GTX TITAN, 3480960 hashes, 696.22 khash/s[2014-01-07 15:21:22] GPU #0: GeForce GTX TITAN, 3534720 hashes, 704.01 khash/s[2014-01-07 15:21:27] GPU #1: GeForce GTX TITAN, 3494400 hashes, 695.44 khash/s[2014-01-07 15:21:27] GPU #0: GeForce GTX TITAN, 3521280 hashes, 706.13 khash/s[2014-01-07 15:21:32] GPU #1: GeForce GTX TITAN, 3480960 hashes, 691.75 khash/s[2014-01-07 15:21:32] GPU #0: GeForce GTX TITAN, 3534720 hashes, 694.70 khash/s[2014-01-07 15:21:37] GPU #1: GeForce GTX TITAN, 3467520 hashes, 694.09 khash/s[2014-01-07 15:21:37] GPU #0: GeForce GTX TITAN, 3480960 hashes, 702.40 khash/s[2014-01-07 15:21:42] GPU #1: GeForce GTX TITAN, 3480960 hashes, 694.84 khash/s[2014-01-07 15:21:42] GPU #0: GeForce GTX TITAN, 3521280 hashes, 703.03 khash/s[2014-01-07 15:21:47] GPU #1: GeForce GTX TITAN, 3480960 hashes, 695.93 khash/s[2014-01-07 15:21:47] GPU #0: GeForce GTX TITAN, 3521280 hashes, 709.67 khash/s ...with no other feedback makes me weary. I had to wait 7 hours to find my first block. Nail biting, but it worked!
Enjoy and please donate if this helped you!
DGC: DNVSmmGSDkDbV6a6xQfNSSuTWASnKpGstf <- this is Digitalcoin
DOGE: D7cpuqwzgSu4VBrX8vhUo7t4SNC19NzEzr <- this is Dogecoin (confusing eh?)
LTC: LY9omkj3nncPDhM3TVbyru7hAwwUwuYuXJ
BTC: 16aoCMuo9XAGsPuKK9NL4xWr8B9fsSvMx
post edited by eduncan911 - 2014/01/26 12:05:18