<p>Theoretically, if you can mine blocks then you can certainly include your own transactions in the block.</p>

<p>Practically, you are competing with <em>every other miner on the planet</em> to find the next block. If you "win", you get the block reward plus you get to choose which transactions are included in your block. If somebody else wins, you get no say in the matter. Unless you have a very large mining operation, the chance of you winning is so small that it's never going to happen.</p>

<p>Miners who <em>do</em> make new blocks today (somebody has to, after all) may choose to include their own transactions in their blocks.</p>

CC BY-SA 3.0
2017-04-18T21:05:56.733Z
dont you choose the transactions before performing the mining operation?  To clarify my question, can you avoid the competition and mine your own transaction into their own block separate from the rest of the network until you do find the mining nonce solution and then add that to the longest chain
Studnt
CC BY-SA 3.0
2017-04-18T22:07:55.420Z
You can keep your blocks secret but that means other can't build on top of them. Every block has 1 (and only 1) parent. If you have less than 50% of the hashing power of the entire network, you can't out-compete the others. They will make blocks faster. Because when a block will drop is random, you *might* be able to get a block before anyone else does, and you *might* even get another one on top of that one before the others get 2 blocks ahead of the starting position, but you can't defeat the law of big numbers and will lose the race in the long term.
UTF-8
CC BY-SA 3.0
2017-04-19T00:59:31.880Z
@Studnt But that would take a long time. And by including your transaction in the block, you'd give up the space that you could use to include someone else's transaction and thus give up their fee. What would the benefit be?
David Schwartz
CC BY-SA 3.0
2017-04-19T01:46:03.090Z
I guess there is no reason to keep the block/txs secret because if you dont pay a fee, no one else will include it in a block...or if someone does even better! @DavidSchwartz I guess the benefit would be that you could maybe avoid orphan blocks by just mining your txs because then no one else would be creating blocks with those txs?
Studnt
CC BY-SA 3.0
2017-04-19T14:16:31.800Z
@Studnt that is not how it works. The bitcoin mining ecosystem produces one single chain of blocks that is shared across the whole world. There is on average one block per 10 minutes. The contents of blocks has nothing to do with that. You need to compete with everyone else who produces blocks regardless of what you put in them.
Pieter Wuille
CC BY-SA 3.0
2017-04-18T20:25:32.310Z
2017-04-18T20:25:32.310Z
Greg Hewgill
<p>The fees people pay for transactions aren't destroyed. They are paid to the miner who mined the block. Each block typically contains about 2'500 transactions. For this to work, you have to make about as many blocks as transactions. Your transaction fee then is less than 0.1% of the fees you get from others. Plus, the block reward currently is way higher than the total transaction fees taken per block. You'd be at less than 0.01%. So if you can make a block, why not do it all the time and easily get 10'000 the money you save?</p>

CC BY-SA 3.0
2017-04-18T21:37:53.703Z
wrt the saved fees, what i was saying is that normally you have to include a fee to incentivize miners to include your tx into the block. Otherwise miners would just keep creating blocks out of other higher fee txs and your would be stowed away into a mempool i think is what its called??? If you were able to mine your transactions yourself, you wouldnt need to incentivize anyone with a fee because you are already incentivized to verify the block
Studnt
CC BY-SA 3.0
2017-04-18T22:04:36.030Z
Yes, that's correct.
UTF-8
CC BY-SA 3.0
2017-04-19T01:00:42.597Z
@Studnt But then you'd just be cheating yourself. How would that help you? By including your own transaction, you'd forfeit the fee of someone else's transaction that you could have included instead.
David Schwartz
CC BY-SA 3.0
2017-04-19T01:50:33.343Z
@DavidSchwartz Im getting the impression that regardless of what is in the block, the difficulty of finding the nonce is the same. So mining your own txs is no easier than mining everyones or no ones...and that you dont avoid any mining competition by withholding your own txs and making a block out of them
Studnt
CC BY-SA 3.0
2017-04-19T03:59:27.050Z
@Studnt Either you are in a hurry to get your transaction confirmed or you're not. If you're in a hurry, you had better let other people mine it. If you aren't in a hurry, you're going to pay the minimum fee anyway, so what benefit do you get from mining your own transaction instead of someone else's?
David Schwartz
CC BY-SA 3.0
2017-04-19T05:48:40.810Z
@DavidSchwartz It would benefit you if the miner fees > cost of mining it yourself...but it sounds like mining it yourself is much more costly
Studnt
CC BY-SA 3.0
2017-04-19T14:24:06.143Z
@Studnt The cost of mining a block is currently about 14 BTC. And that's when you don't care when exactly you mine a block. A little less, of course, so miners make a profit. The cost of mining a block always is about as much as the miner gets for doing so because it's a self-regulatory system. But even that is assuming you have access to really cheap electricity. People mine where electricity is the cheapest.
UTF-8
CC BY-SA 3.0
2017-04-19T15:37:51.010Z
@Studnt It still wouldn't benefit you. Because in order to mine your transaction, you'd have to forego the opportunity to mine someone else's. And since you weren't in a hurry, your transaction would be the cheapest.
David Schwartz
CC BY-SA 3.0
2017-04-18T20:11:35.940Z
2017-04-18T20:11:35.940Z
UTF-8
<p>If you can separate block-creation consensus from coin-creation work, a coin could use self-hashing transactions to prevent the need for pools. The transaction would include a destination address, a difficulty you set yourself, a block number in the near future that gives enough time for a block-creator to include it, and a nonce. You hash the txn until the nonce solves the difficulty that you chose.  <a href="https://zawy1.blogspot.com/2019/03/a-virtual-pow-to-prevent-51-attacks.html" rel="nofollow noreferrer">https://zawy1.blogspot.com/2019/03/a-virtual-pow-to-prevent-51-attacks.html</a></p>

CC BY-SA 4.0
2019-03-12T14:38:46.720Z
2019-03-12T14:38:46.720Z
zawy
<p>i was looking at it from the purpose of trying to figure out how <a href="https://app.originstamp.org/home" rel="nofollow noreferrer">https://app.originstamp.org/home</a> does free trusted timestamping based on sending bitcoins to i assume their own accounts, with a hash.</p>

<p>So the use case of being able to mine your own transactions is for an app that requires secured time stamping, like if users needed to timestamp legal documents.</p>

<p>1) no transaction fee<br>
  2) you put your miner in your same network, so no network fee and lower latency<br>
  3) You dont have to wait forever for the transaction to be processed if you are trying to reduce fees. I dont know anything about fees vs time for minimum sum BTC transfers to happen, and if running a small miner server to perform this within my network is what it takes to not have to worry about it... it's something to be explored  </p>

CC BY-SA 3.0
2017-07-26T14:56:24.650Z
Both you and the OP seem to misunderstand something.  Namely, you seem to think that transactions are mined.  They are not.  Blocks of transactions are what actually get mined, and that makes a world of difference.  For more details, see my answer here:  https://bitcoin.stackexchange.com/questions/49569/why-does-the-blockchain-need-blocks/49570#49570
Jestin
CC BY-SA 3.0
2017-07-29T04:42:30.470Z
So after doing more research after the post, i found out that mining a 'standard' block would take a single small machine at least a day. Most of the content available on block size, seems to be talking about increasing a hardcoded 1mb limit. Is it possible on a server side, to process an extremely small block size (ie..only my own internal transactions)?
hansel ke
CC BY-SA 3.0
2017-07-30T22:28:06.427Z
I don't know where you got your information, but mining a single block would take much longer than a day.  In fact, it would take much longer than a human lifespan.  You would be dead before you'd mine a block.  The size of a block is not a factor in how long it takes to mine a block.  Mining a block with just your transaction would take the same amount of time as mining a block with a million transactions.  Also, there is no such thing as "server side" in Bitcoin.  It is a peer to peer network.  I don't believe you have done enough research to understand what you are taking about.
Jestin
CC BY-SA 3.0
2017-07-26T08:35:48.087Z
2017-07-26T08:35:48.087Z
hansel ke
<p>If no, why not? And is it you physically/theoretically or practically cannot?</p>

<p>If yes, is this ever practical and does anyone do it? 
As I see it now, no matter what you are taking a fraction/subset of bitcoins entire hashing power so the difficulty of finding a nonce would take longer than 10 minutes to confirm.</p>

<p>As I see it, for this to be practical...
Block reward + saved fees > mining costs * time</p>

<p>Where saved fees are the result of not having to pay other miners fees since you are doing it yourself and time is the time it takes to find the nonce. 
note: this miner wouldnt have to be running full time</p>

CC BY-SA 3.0
2017-05-03T19:25:05.313Z
It won't save you any fees really, as the space you'd use in your own blocks for your own transactions won't be available for storing other transactions - so you pay the opportunity cost equal to the fees those would pay.
Pieter Wuille
<mining-profitability><mining-theory>
Can you mine your own transactions yourself?
Studnt
# Can you mine your own transactions yourself?

(Asked by: username_0 on 2017-04-18)

If no, why not? And is it you physically/theoretically or practically cannot?

If yes, is this ever practical and does anyone do it?
As I see it now, no matter what you are taking a fraction/subset of bitcoins entire hashing power so the difficulty of finding a nonce would take longer than 10 minutes to confirm.

As I see it, for this to be practical...
Block reward + saved fees > mining costs \* time

Where saved fees are the result of not having to pay other miners fees since you are doing it yourself and time is the time it takes to find the nonce.
note: this miner wouldnt have to be running full time

**Tags:** mining-profitability, mining-theory

> **Comments:**
> **username_1**: It won't save you any fees really, as the space you'd use in your own blocks for your own transactions won't be available for storing other transactions - so you pay the opportunity cost equal to the fees those would pay.  

---

## 4 answers

### Answer by username_2 on 2017-04-18. Score: 6

Theoretically, if you can mine blocks then you can certainly include your own transactions in the block.

Practically, you are competing with *every other miner on the planet* to find the next block. If you "win", you get the block reward plus you get to choose which transactions are included in your block. If somebody else wins, you get no say in the matter. Unless you have a very large mining operation, the chance of you winning is so small that it's never going to happen.

Miners who *do* make new blocks today (somebody has to, after all) may choose to include their own transactions in their blocks.

> **Comments:**
> **username_0**: dont you choose the transactions before performing the mining operation?  To clarify my question, can you avoid the competition and mine your own transaction into their own block separate from the rest of the network until you do find the mining nonce solution and then add that to the longest chain  
> **username_3**: You can keep your blocks secret but that means other can't build on top of them. Every block has 1 (and only 1) parent. If you have less than 50% of the hashing power of the entire network, you can't out-compete the others. They will make blocks faster. Because when a block will drop is random, you *might* be able to get a block before anyone else does, and you *might* even get another one on top of that one before the others get 2 blocks ahead of the starting position, but you can't defeat the law of big numbers and will lose the race in the long term.  
> **username_4**: @username_0 But that would take a long time. And by including your transaction in the block, you'd give up the space that you could use to include someone else's transaction and thus give up their fee. What would the benefit be?  
> **username_0**: I guess there is no reason to keep the block/txs secret because if you dont pay a fee, no one else will include it in a block...or if someone does even better! @username_4 I guess the benefit would be that you could maybe avoid orphan blocks by just mining your txs because then no one else would be creating blocks with those txs?  
> **username_1**: @username_0 that is not how it works. The bitcoin mining ecosystem produces one single chain of blocks that is shared across the whole world. There is on average one block per 10 minutes. The contents of blocks has nothing to do with that. You need to compete with everyone else who produces blocks regardless of what you put in them.  

---

### Answer by username_3 on 2017-04-18. Score: 2

The fees people pay for transactions aren't destroyed. They are paid to the miner who mined the block. Each block typically contains about 2'500 transactions. For this to work, you have to make about as many blocks as transactions. Your transaction fee then is less than 0.1% of the fees you get from others. Plus, the block reward currently is way higher than the total transaction fees taken per block. You'd be at less than 0.01%. So if you can make a block, why not do it all the time and easily get 10'000 the money you save?

> **Comments:**
> **username_0**: wrt the saved fees, what i was saying is that normally you have to include a fee to incentivize miners to include your tx into the block. Otherwise miners would just keep creating blocks out of other higher fee txs and your would be stowed away into a mempool i think is what its called??? If you were able to mine your transactions yourself, you wouldnt need to incentivize anyone with a fee because you are already incentivized to verify the block  
> **username_3**: Yes, that's correct.  
> **username_4**: @username_0 But then you'd just be cheating yourself. How would that help you? By including your own transaction, you'd forfeit the fee of someone else's transaction that you could have included instead.  
> **username_0**: @username_4 Im getting the impression that regardless of what is in the block, the difficulty of finding the nonce is the same. So mining your own txs is no easier than mining everyones or no ones...and that you dont avoid any mining competition by withholding your own txs and making a block out of them  
> **username_4**: @username_0 Either you are in a hurry to get your transaction confirmed or you're not. If you're in a hurry, you had better let other people mine it. If you aren't in a hurry, you're going to pay the minimum fee anyway, so what benefit do you get from mining your own transaction instead of someone else's?  
> **username_0**: @username_4 It would benefit you if the miner fees > cost of mining it yourself...but it sounds like mining it yourself is much more costly  
> **username_3**: @username_0 The cost of mining a block is currently about 14 BTC. And that's when you don't care when exactly you mine a block. A little less, of course, so miners make a profit. The cost of mining a block always is about as much as the miner gets for doing so because it's a self-regulatory system. But even that is assuming you have access to really cheap electricity. People mine where electricity is the cheapest.  
> **username_4**: @username_0 It still wouldn't benefit you. Because in order to mine your transaction, you'd have to forego the opportunity to mine someone else's. And since you weren't in a hurry, your transaction would be the cheapest.  

---

### Answer by username_5 on 2019-03-12. Score: 0

If you can separate block-creation consensus from coin-creation work, a coin could use self-hashing transactions to prevent the need for pools. The transaction would include a destination address, a difficulty you set yourself, a block number in the near future that gives enough time for a block-creator to include it, and a nonce. You hash the txn until the nonce solves the difficulty that you chose. <https://zawy1.blogspot.com/2019/03/a-virtual-pow-to-prevent-51-attacks.html>


---

### Answer by username_6 on 2017-07-26. Score: -1

i was looking at it from the purpose of trying to figure out how <https://app.originstamp.org/home> does free trusted timestamping based on sending bitcoins to i assume their own accounts, with a hash.

So the use case of being able to mine your own transactions is for an app that requires secured time stamping, like if users needed to timestamp legal documents.

1) no transaction fee  
2) you put your miner in your same network, so no network fee and lower latency  
3) You dont have to wait forever for the transaction to be processed if you are trying to reduce fees. I dont know anything about fees vs time for minimum sum BTC transfers to happen, and if running a small miner server to perform this within my network is what it takes to not have to worry about it... it's something to be explored

> **Comments:**
> **username_7**: Both you and the OP seem to misunderstand something.  Namely, you seem to think that transactions are mined.  They are not.  Blocks of transactions are what actually get mined, and that makes a world of difference.  For more details, see my answer here:  https://bitcoin.stackexchange.com/questions/49569/why-does-the-blockchain-need-blocks/49570#49570  
> **username_6**: So after doing more research after the post, i found out that mining a 'standard' block would take a single small machine at least a day. Most of the content available on block size, seems to be talking about increasing a hardcoded 1mb limit. Is it possible on a server side, to process an extremely small block size (ie..only my own internal transactions)?  
> **username_7**: I don't know where you got your information, but mining a single block would take much longer than a day.  In fact, it would take much longer than a human lifespan.  You would be dead before you'd mine a block.  The size of a block is not a factor in how long it takes to mine a block.  Mining a block with just your transaction would take the same amount of time as mining a block with a million transactions.  Also, there is no such thing as "server side" in Bitcoin.  It is a peer to peer network.  I don't believe you have done enough research to understand what you are taking about.  

---

