Push Bitcoin transactions with privacy focused broacast tool
Use of pushtx for broadcasting transactions in a privacy focused environment
How can we broadcast a pre-built end signed on-chain transaction with an external tool, with a particular eye to privacy? I recently tested a tool for this purpose and i found it very useful for that purpose, so i decided to write down this article to show how to use it and what kind of results to expect from it.
This tool is called pushtx and can be found at github at the following repository:
https://github.com/alfred-hodler/pushtx
this script is written in rust.
Installing
If you want to use cargo for install, the first step is installing cargo if your system still does not have it yet. This can be accomplished by running
$ sudo apt install cargo
then we can just install the tool with
$ cargo install pushtx-cli
after some seconds of few minutes you will have the script installed in your home directory. in my case:
/home/massmux/.cargo/bin
your home directory obviously will be different.
Using the script
First of all you have to use your favourite wallet to create your transaction. In my case, i used electrum but you can use a different wallet as well. As usual you will choose utxos as inputs and define outputs, fee, etc and finally you will have your draft transaction ready to be signed, then click on preview to check it out.
Now you can sign it and you can copy the sign transaction hex to the clipboard like that (this is an example made on the testnet):
Now that you have your hex transaction you can use actually the script. Just open a shell consolle and run the script:
the flag -t stands for “testnet” and informs the sript that this transaction must be broadcasted to the Bitcoin test network.
The output will look like this:
this means that the script checked if tor is available on the system (you need to have it, important!) and then connects to it, finds random peers and then broadcast the transaction to these peers through that connection.
You can now explore the transaction (be careful because in a real case, exploring the transaction with a public explorer may leak your IP address, so better using tor even for this purpose). Here is what you get:
As you can see the transaction got correctly propagated through the network right now and will be mined shortly. The way this transaction has been broacasted is with enhanced focus on privacy for the reasons shown above.
Enjoy!