3

For research purposes, I want to send transactions to the Bitcoin network and measure when they are received (yes, I am aware of existing websites which have statistics about these averages, but they can't provide me with more detailed statistics).

Specifically, I want to:

  1. Send transactions through multiple nodes that should have different outbound neighbors (I don't want all my transactions to be tunneled through the same neighbors).
  2. Receive the transactions at other nodes under my control (for measurements), but I would like to avoid having these nodes validate the entire blockchain first.
  3. Avoid unintended spam attack.

Should I use full nodes, half nodes, or something else? Is there a well documented and easy to read implementation that I might find useful for my purpose (C++ isn't usually my go-to tool)? Any sort of advice will be highly appreciated.

If I am not mistaken, this should not cause a spam attack since the transactions will all come from newly created coins (if that is the right term) and should be prioritized below almost all the real transactions, but please correct me if I got this wrong.

P.S. please assume I am an idiot, so spell out stuff like "oh, just use RPC"... thanks!

1 Answer 1

4

You should use full nodes on both sending and receiving end

Sending Tx

  • Use the -connect option to broadcast your tx through selected neighbours. Use https://bitnodes.21.co/ to find neighbours. Use the wallet commands in bitcoind and send a transaction to address in your own wallet

Receiving Tx

  • Use -walletnotify option in bitcoind to get notifcation of incoming wallet transaction. I don't think it is easy to receive mempool tx without validating the blockchain first. Anyway this is one time effort, once you have it synced on one node you can easily copy the whole .bitcoin directory to other nodes.

About language you don't need to use C++ at all. For sending tx you need to do RPC calls. This can be easily done using bash commands or you can use https://github.com/jgarzik/python-bitcoinrpc in python. For receiving, the notify script can be any language php/python, it will just get your tx id as parameter and then you can do whatever you want.

Don't worry about spam. Its difficult to spam the network unless you have lots of bitcoins to waste in tx fees. Just make sure you put enough tx fees so that it get relayed through the network. For your experiment, you can actually try with different tx fees to observe the propagation time through the network.

Let me know when your research is over. Curious to see the results :D

5
  • This is very helpful - thanks! I will definitely keep you posted. Can you elaborate more on how larger fees affect propagation? I was not aware of the relation (and it will affect my research budget, or the scale of my experiment)
    – UriCS
    May 26, 2017 at 5:46
  • This basically depends on the minrelaytxfee on the node github.com/bitcoin/bitcoin/blob/v0.11.0/doc/…. Only thing is tx fee doesn't need to be very low. I don't think you will get any difference in propagation after tx fee crosses a barrier. May 26, 2017 at 5:56
  • Got it. I will experiment, but do you have any notion of the approximate satoshi/Byte we are talking about? I want to plan ahead correctly. according to bitcoinfees.21.co it appears even 1-30 satoshi work. Thanks again!
    – UriCS
    May 26, 2017 at 6:04
  • Default value is 1000 satoshi per KB bitcoin.stackexchange.com/questions/48235/…. So, yes even 1 satoshi/byte could work. May 26, 2017 at 6:11
  • You rock dude. I would upvote you but my account is too noob to allow it, and my stack overflow is too noob to merge my reputation across domains. Thanks!
    – UriCS
    May 26, 2017 at 6:14

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.