Mining Flashcards

1
Q

How to mine in Blockchain?

A

Step 0: Download the entire Bitcoin blockchain.

This only has to be done once. This allows us to know the history so we can validate future transactions. Note: This step is optional if you mine in a mining pool or are doing lightweight mining.

Step 1: Verify transacctions.

  • You store newly received, unprocessed transactions in a “mempool,” where all pending transactions live before making their way into a block.
  • You then choose the transactions with the highest fee per byte or size ratio to verify.
  • You verify the validity of each transaction by running the unlocking script.
  • If that script runs successfully, then the transaction is included within our block.

Step2: Create the block with the given transactions and necessary metadata, such as time, version, and target.

  • Construct the block data from our list of valid transactions.
  • Construct the Merkle Root by hashing the hashes of each pair of transactions
  • Construct the Previous Block Hash by hashing the previous block’s header

Step 3: Find the proof-of-work that solves the partial preimage hash puzzle.

  • A valid nonce makes the hash of the block header less than some algorithmically generated value known as the “target.”
  • By finding the nonce, we have translated the energy burned in computation into voting power, as designed by the Proof-of-Work consensus protocol.
  • Note: There are two different nonces, the header nonce and the coinbase nonce. In the event that no permutation of the header nonce solves the hash puzzle, alter the coinbase nonce. This changes the Merkle root, yielding an entirely different hash puzzle.

Step 4: Broadcast your block if you have not yet seen any competitor blocks.

  • After finding the valid proof-of-work, broadcast the block as soon as possible.
  • Other miners will validate the block for themselves before accepting it into their chain and propagating it further through the network.

Step 5: Receive the Profit.

If your block makes it into the longest chain, you profit!

  • You receive both the block reward and the transaction fees,
  • All the transactions within that block are added to the transaction history.If your block makes it into the longest chain, you profit!
    You receive both the block reward and the transaction fees,
    All the transactions within that block are added to the transaction history.
    Note: When two valid blocks are submitted to the network at roughly the same time, resulting in a fork, honest miners choose to mine on whichever block they see first. You will not receive block reward if the other fork grows longer.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the Transacction Fee?

A

Transaction fees are the second form of profit for miners.
The transaction fee is a price set by the sender of a transaction. You can consider the transaction fee the cost of service for using the power of the Bitcoin
network. Providing transaction fees are not required for a transaction to go through, but they incentivize miners to consider choosing your transaction over other ones due to limited block space.
Because a miner can only approve so many transactions at once given the one megabyte size limit, they will want to choose the transactions that give them the most profit within that block. In fact, the way the miner calculates the transactions they will collect into a block
is through maximizing the ratio of transaction fees to unit of storage.
What this means is that the overall transaction fees for their block will be maximized, as they’re taking all the most profitable transactions.
Notice one thing: as the block reward diminishes, transaction fees will go up if miners seek the same amount of profit in bitcoins.
As block rewards approach zero, transaction fees will become the primary source of revenue
for miners.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a Block Reward?

A

The block reward is a reward that goes to a miner whose block is included in the longest chain.
As of May 2018, the block reward is around 12.5 bitcoins.
As mentioned before, the miner includes a special transaction to themselves: the coinbase transaction.
That transaction is what both allows for the minting of bitcoins and, more importantly, incentivizes honest actors to validate blocks. To understand better the rationale for the block reward, remember that profit is the
primary motivator for any activity, and that a higher incentive for honest behavior leads to a more secure network. This is because the block reward halves every 210,000 (two hundred and ten thousand) blocks,
which is approximately 4 years.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a Mining Pool?

A

Mining pools allow individual miners to join their hash power together.
This way, they will collectively find blocks and get rewards more often, even if they only
get a smaller amount with each block the pool finds.
Mining pools are run by a pool manager, or pool operator, that takes care of running
a Bitcoin full node and distributing jobs to other miners.
They also take a cut of the rewards as compensation.This way, miners don’t even have to store the blockchain themselves: similar to cloud
computing, they give pools access to their hardware in exchange for a share of profits
from the pool.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does the Mining Pool Schemes work?

A

There are various schemes for payout that mining pool use. The two most fundamental categories are Pay-per-Share and Proportional.
You can probably gather the basic ideas from the names.
Pay-per-share schemes will pay you a fixed amount of money for each share.
This payment is guaranteed and constant per share, regardless of how much reward the pool makes.
Most pools use this scheme, as it’s easy to implement and to understand.
As you can tell, this is more advantageous for the miner, as variance of their payout is reduced.
This implies that pools take on more risk because they will incur costs if blocks aren’t found by the pool.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the pros and cons of Mining Pools?

A

So now that we’re familiar with mining pool schemes, we can talk about the pros and cons of mining pools.
The pros of mining pools are that they give individual and smaller miners the opportunity to make profit without waiting decades to get payment.
On top of that, software changes are easy to make.
Only one person is running a full node for the mining pool, and that person can upgrade on behalf of the pool.
Cons include trust in the pool manager.
You have to rely on them not to misuse your mining power and not to withhold rewards.
This is a consequence of centralization.
On top of that, a multitude of attacks are enabled by mining pools, which we will discussfurther in the Game Theory lecture.
The community typically dislikes large mining pools.
For example, GHash.io once approached 50% of the network mining power.
Miners within GHash voluntarily pulled out of the mining pool because they were aware of the dangers of approaching 51% of the network.
In addition, another concern is that a single entity might be hiding their total amount of mining power.
We see here that BTC.com has about 29% of the mining power in their pool, but what’s to stop them from submitting hashpower to other pools? This is known as laundering hashes, by hiding the origin of mining power.
This allows you to leverage great amounts of mining power without revealing your prowess to the community.
By doing so, you experience no backlash while still receiving major profits.
Because of this, the graph is only a high-level estimate.
We don’t know the true concentration of control over mining hardware, and we may never know.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the Hash Rate?

A

ash Rate, also Hash Power, is the measuring unit that measures how much power Bitcoin network is consuming to be continuously functional. By continuously functional I mean how much hash power is it consuming to generate/find blocks at the normal mean time of 10 minutes.

If you remember, in my previous article What is a Bitcoin hash I explained thoroughly that Bitcoin network consumes a lot of energy because it has to solve mathematical intensive computations regularly to find the blocks.

These computations for finding the blocks are basically mathematical puzzles that a miner cannot just guess without a lot of computation.

To successfully mine a block, a miner needs to hash the block’s header in such a way that it is less than or equal to the “target.”

The target, at the time of writing this article, is that the SHA-256 hash of a block’s header must be a 256-bit alphanumeric string, and must start with 18 zeros. The target changes as the difficulty change every 2016 blocks.

And the miners arrive at this particular hash (or target) by varying a small portion of the block’s headers, which is called a “nonce.” A nonce always starts with “0” and is incremented every time for obtaining the required hash (or target).
Since the varying of the nonce is hit and miss, the chances of getting this particular hash (or target), which starts with these many zeros, is very low. Therefore, many attempts must be made by a miner by varying the nonce.

And this number of attempts made per second is called hash rate or hash power. And this hash power or guessing attempts are made by miners who mine the Bitcoin blocks by a process called Bitcoin mining.

Hash rate denominations

1 kH/s is 1,000 (one thousand) hashes per second
1 MH/s is 1,000,000 (one million) hashes per second.
1 GH/s is 1,000,000,000 (one billion) hashes per second.
1 TH/s is 1,000,000,000,000 (one trillion) hashes per second.
1 PH/s is 1,000,000,000,000,000 (one quadrillion) hashes per second.
1 EH/s is 1,000,000,000,000,000,000 (one quintillion) hashes per second.

Comman Hash rate Conversions

1 MH/s = 1,000 kH/s
1 GH/s = 1,000 MH/s = 1,000,000 kH/s
1 TH/s = 1,000 GH/s = 1,000,000 MH/s = 1,000,000,000 kH/s
and so forth
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the Mining Pool Paradox?

A

So this leads to the paradox that: the more secure Bitcoin gets, with more and more hash power, the greater the appeal is for joining a mining pool, since your individual hash
power decreases when more hash power joins the network.

So, the question is, would you rather have a huge payout every couple decades as a solo
miner, or a small but regular payout mining in a pool.
Obviously, pool mining sounds more attractive due to its low variance.
And anyways, your ASICs will probably be really out of date in a couple years, so you can’t
realistically afford to have high variance in your mining payout.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the types of Miners?

A

Of course, remember that there are various types of miners.

  • Some of these are known as “Reference Clients”–these control a wallet to store private keys, a routing node to communicate with others, a blockchain to validate transactions, and mining software to submit hashing power to the network. This is the code released by Bitcoin Core to miners.
  • Solo miners, on the other hand, have no wallet functionality, probably have some other separate wallet software, and solely mine. Aside from the wallet, they are identical to the Reference Client.
  • Mining nodes are general nodes which have some mining hardware and a protocol by which they connect to a mining pool. There is the Stratum mining protocol, an unofficial standard for submitting hashpower to a pool, but it’s not the only possibility. These nodes, you’ll notice, have no burden of storing any information. They only need to store code and control hardware to interact with the mining pools.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly