3

I'm new into this world.

I (think to) know that usually blocks are mined from most rewarded to less rewarded. So if I offer very low gas price for a transaction, it can be take a long time to be mined, if it will be. Right?

I am thinking if I could setup a miner client to mine ONLY very low-valued blocks, because, I hope, there is less people trying to solve them.

My end goal is to be able to make transactions at a lower cost and be 'sure' that someone will try to mine it anyway

Is it possibile to configure a client to mine only low-valued blocks?

Is it possibile to lower transaction costs creating a pool of low-cost only miners?

1
  • I'm not commenting on the usefulness of mining only low value tx, but on how to do it if you really want. Just fork a client, modify the tx selection algorithm, make it pick only low value tx in the pool and you're done. If you don't modify anything else and you keep the mining process compatible with the chain you are done. You could add an option to the client named like --reverse-tx-selection-order to make it less hard coded and keep the default behaviour. Dec 27, 2019 at 19:03

3 Answers 3

5

Block mining process in general looks like this:

  1. Miner picks transactions to be included into the block and validates them
  2. Miner organizes transactions, their receipts, resulting blockchain state into Merkle trees and calculates root hashes of them
  3. Miner chooses random nonce value
  4. Miner constructs block header from various information that, among other things, includes nonce, previous block hash, and root hashes of Merkle trees calculated at step 2
  5. Miner calculates hash of block header
  6. If hash is not good enough, miner goes to step 3
  7. If hash is good enough, miner publishes new block and takes reward

If at step 1 you will pick set of transactions that is very different from transaction sets picked by rival miners, this will not help you in any way. Actually, different miners usually pick different transaction sets.

2

Yes, miners include transactions in blocks from the most rewarded to the least rewarded. But after the transactions are selected, the entire process for mining the block remains the same(i.e choose a random nonce value and calculate the hash repetitively until the hash is good enough) no matter which transactions you include.

So even if you configure your miner(or pool) to include transactions with low gasPrice, it still has to compete with all other miners.

1

I am thinking if I could setup a miner client to mine ONLY very low-valued blocks, because, I hope, there is less people trying to solve them.

Every miner is always trying to solve a different block.

If two miners are not coordinated, they are each trying to mine blocks that reward them and not the other miner. So miners who aren't coordinating are trying to solve different blocks already.

If two miners are coordinated, they will coordinate to ensure that they are not trying to solve the same block as repeated effort is wasteful. So miners who are coordinating are trying to solve different blocks already.

So trying to mine lower-valued transactions conveys no benefit. You are also trying to solve a block that only you are working on, but you get less in transaction fees if you succeed. So it's a net loss.

Even prioritizing your own transactions doesn't do you much good. Every one of your own transactions you prioritize over a transaction that would have paid you more costs you the same amount as you saved on the transaction fee.

For example, say you have a transaction that you're willing to pay a transaction fee of 100 for to ensure it doesn't take too terribly long to get in even if you don't successfully mine a block. Then say you include your own transaction instead of a transaction from someone else that had a 200 unit fee. You save the 100 units you would have had to pay to let your transaction get in eventually but you also cost yourself 200 units because you didn't get the 200 unit fee from the other transaction. Your net loss is 100 units -- exactly what you could have added to the transaction fee to get the transaction in the block had someone else mined it.

The net effect is nothing at all when you mine your own transactions. Except that you have to wait longer to get your transaction in if you don't get lucky and happen to mine a block while it's pending. So it's a net loss.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.