0

From the answer of this question Can miners mine their own transactions? it seems that if someone wanted to make a transaction on the ethereum blockchain for the smallest transaction price (gas) possible, they could run a miner to mine the specific transaction. My question is: How can this be done? (the necessary steps)

1 Answer 1

4

As I mentioned in the answer to the post you've referenced, putting your own transactions into a block doesn't make that block easier to mine. You'd still be competing against the rest of the miners, who may or may not have included your low-priced transaction in the block they're mining. You'd probably1 be better off broadcasting the transaction and hoping someone else - perhaps with far greater hashing power than you - picks it up. (i.e. Use the power of the rest of the network rather than cutting yourself off from it.)

To actually answer your question though, there are a couple of options I can think of. (Other people may have other ideas.)

  1. If you're using the Parity client, use the --tx-queue-strategy flag to prioritise low priced transactions. (Though this won't guarantee yours is included if the transaction pool is full of cheap transactions.) I think the same can be done with the --gasprice option. Geth doesn't have a way to set maximum limits for gas price, only minimum limits, so you can't prioritise low prices.
  2. The only way I can see to guarantee that your own transactions are prioritised is to edit the code. For Geth, I've mentioned where transactions from the memory pool are sorted in this previous answer. You'd need to inspect the from address in each transaction, and only add to the block you're mining if the address is yours. (I think. There might be an easier way of creating a local transaction pool containing only your transactions, but that would need some digging and design.)

1 I've no way of quantifying this...

2
  • I think you can quantify the benefit of broadcasting the transaction fairly easily. Using a gas price estimator, you can estimate how many blocks it will take for your transaction to be included at the price you want; call this x. Then you find out what your expected time, in blocks, to mine a block is (using, for example, a mining calculator); call this y. Then you look at the ratio of x to y. No? Of course, you pay the low fee to someone else rather than spend nothing because you paid yourself (at the expense, perhaps, of getting an uncle block or something).
    – lungj
    Commented Jul 19, 2018 at 4:16
  • @RichardHorrocks thank you for this answer. Can you please go into a little detail about where and how you'd add the criteria to only accept TXs from a certain address?
    – Zach
    Commented Nov 12, 2018 at 6:08

Your Answer

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

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