Pages:
Author

Topic: New to mining: Bitcoin, Litecoin, algorithms, hardware - page 2. (Read 3420 times)

jr. member
Activity: 48
Merit: 1
Some personal text
I have rented some compute power to try out some mining, mostly on AWS but also Linode, and three laptops at home. I'm using cpuminer. I have six miners going at a total of about 800 khash/sec (this is in a pool at litecoinpool.org). I would try solo mining, Bitcoin or Litecoin, but I know I need specialised ASICs like AntMiners, is that right? Are older ones being sold on eBay for $100 to $300 a good way to try it out before dropping a few thousand dollars on new mining hardware?

I was thinking on the possibility of finding a block, or a probability, but I take it that would be difficult to compute because of the competitive lottery - is it that the more firepower you have to crunch those hashes, the more probability you have of finding a candidate block that has a relationship to the "target" whatever that is?

I've tried to read the Bitcoin source and looked at slow but more educational mining software to try and understand it a bit more, but not sure if I'm really getting it. I'd like to write a pseduocode algorithm and implement my own toy miner and just see if I can get it to work. If I can explain the mining process for Litecoin and Bitcoin at a conceptual and technical level, I'd be happy with my mining experience. I don't expect to make anything unless I go for some mining hardware later on.

I think in Bitcoin (I'm also trying to find a reasonable comparison to adjust for Litecoin) what happens is that the miner collects some pending transactions in the order they arrive on the network into a pool, and selects some so that if a block is found it won't be too large, is that roughly why the debate about a solution to the 1MB hard limit is going on?

So the mining software creates a block maybe from a template, and calculates the merkle root of the transcations from the pending pool, including a coinbase among the transactions. The header in the new candidate block contains a version number, the hash of the previous block on the blockchain, the merkle root of the coinbase + pending transactions, the current timestamp (is it updated every time a computation is done?), the target (from getdifficulty()?), and a nonce.

New block to try and add to blockchain:
--> Version
--> Hash previous block
--> Merkle root of pending transactions and coinbase
--> timestamp
--> bits (current target)
--> nonce

... and to try and find a new block, the miner iterates over this new blockheader, updating the nonce until it fails (rejected by network? someone found it first?) or until sha256(sha256( new blockheader )) < target? If not found, increment nonce, (adjust timestamp?), and try double hashing again until either it fails or succeeds.

If that's correct, is mining Litecoin roughly the same thing but scrypt is added after hashing? I'm not entirely sure what the Litecoin Wiki is saying about the use of scrypt. Example code uses sha256, but near the end it seems to be saying that miners concatenate the hex strings in little or big endian, then use the scrypt parameters N = 1024, r = p = 1, and 80 bytes from previous block header which is fed to scrypt, then checked against the target.

So far I haven't found a clear explanation of what exactly is going on with mining. I take it that a miner gets the latest block from a full node with the entire block chain, and queries some daemon for the current difficulty/target, and the daemon supplies it with some pending transactions, and then the computation is done, which is broadcast to the network if candidate_block < target.

Aside from that, when I join a pool such as litecoinpool.org and put in about 850khash/sec. and make around 0.001774308936 LTC /day, I can see it will take quite a long time to get a litecoin if the pool mines a block. Otherwise I can get a litecoin every now and then if I just keep going with some work like this, although it doesn't seem worth it at all unless I have something like an Antminer (or several of them) for Litecoin.  Not sure about Bitcoin, it seems that is just going to be far too difficult and I wouldn't be able to afford a few of the latest AntMiners to get even with the purchase later on if I actually find some blocks.  Maybe it's the same for Litecoin...

Thanks if anyone can answer quesitons, and wants to keep up the discussion on being new to mining, and especially the algorithms for mining and exactly what happens to mine a new block.
Pages:
Jump to: