Bitcoin Forum
January 25, 2020, 04:29:40 AM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to place tx in own mempool without broadcasting?  (Read 102 times)
luv2drnkbr
Hero Member
*****
Offline Offline

Activity: 794
Merit: 1001



View Profile
February 15, 2018, 03:43:34 PM
 #1

Is there a way I can add a transaction to my own memory pool without broadcasting it to the network?  Imagine I am mining my own transactions and want them kept secret from the network unless they are in a block.  (For example, a time-locked commitment that triggers another event which I want to make sure can only happen AFTER my tx is in a block.)

As far as I can figure, the only way to do this is to mine the transaction myself.  And right now, the only way I can think to do that is to run two nodes where one is a bridge "blocks only" node and is the sole node that the other (mining) node connects to.  Then I can add transactions to the mining node manually.  But then it won't know about any other transactions on the network that I might want to also include in the block I am mining.

Is there a way to accomplish this?  To have my transaction in my block template without broadcasting it?

1579926580
Hero Member
*
Offline Offline

Posts: 1579926580

View Profile Personal Message (Offline)

Ignore
1579926580
Reply with quote  #2

1579926580
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1579926580
Hero Member
*
Offline Offline

Posts: 1579926580

View Profile Personal Message (Offline)

Ignore
1579926580
Reply with quote  #2

1579926580
Report to moderator
1579926580
Hero Member
*
Offline Offline

Posts: 1579926580

View Profile Personal Message (Offline)

Ignore
1579926580
Reply with quote  #2

1579926580
Report to moderator
1579926580
Hero Member
*
Offline Offline

Posts: 1579926580

View Profile Personal Message (Offline)

Ignore
1579926580
Reply with quote  #2

1579926580
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 2016
Merit: 3011


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


View Profile WWW
February 16, 2018, 01:10:09 AM
Merited by RGBKey (2)
 #2

You can modify Bitcoin Core from source to disable transaction relay for things that come from the sendrawtransaction RPC command. Just remove or comment out these lines: https://github.com/bitcoin/bitcoin/blob/master/src/rpc/rawtransaction.cpp#L1018-L1022

luv2drnkbr
Hero Member
*****
Offline Offline

Activity: 794
Merit: 1001



View Profile
February 16, 2018, 04:59:21 PM
 #3

Oh gee that's a good idea.  And that just applies to the RPC call, right?  So it wouldn't interfere with broadcasting the transaction if/when the block is mined..??

Assuming that's the case, that's exactly what I'm looking for, thanks!  One quick question, is that code you highlighted also responsible for using sendrawtransaction via the bitcoin-cli program, or do I need to find and commend out code somewhere else for doing it via the cli?  Either way, it's no trouble to use the RPC interface, so you've definitely given me a working solution.  Thanks!

achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 2016
Merit: 3011


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


View Profile WWW
February 16, 2018, 06:18:41 PM
 #4

Oh gee that's a good idea.  And that just applies to the RPC call, right?  So it wouldn't interfere with broadcasting the transaction if/when the block is mined..??
Yes, it should only applies to the RPC call. Of course you should test that for yourself before actually using it.

Assuming that's the case, that's exactly what I'm looking for, thanks!  One quick question, is that code you highlighted also responsible for using sendrawtransaction via the bitcoin-cli program, or do I need to find and commend out code somewhere else for doing it via the cli?  Either way, it's no trouble to use the RPC interface, so you've definitely given me a working solution.  Thanks!
You can use bitcoin-cli. bitcoin-cli is just a tool to interact with the RPC interface.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!