FreeBSD Anonymous Bitcoin Wallet With TOR

Bitcoin is not anonymous, it is pseudo-anonymous – most experienced members of the bitcoin community know this. However, most people don't understand why Bitcoin cannot be called anonymous, how Bitcoin users can be identified – and what can be done to prevent this.

Bitcoin as a conditionally anonymous cryptocurrency, transactions in which do not reveal the name of the owner of the Bitcoin wallet. At the same time, information about ongoing transactions is available to everyone, because records regarding them are kept in public registers. Thanks to this, it is possible to track and compare the owner's identity with ongoing Bitcoin transactions. Attempts to convert cryptocurrencies through exchanges into fiat money (dollars, euros, rubles and other “traditional” currencies) are moments where the identity of the wallet owner can be identified.

In late June 2017, victims of the NotPetya encryption virus paid attackers approximately $10 thousand in Bitcoin to ransom their files. The creators of the malicious software disguised as ransomware were able to anonymously withdraw funds from their Bitcoin wallets on July 4, 2017, despite efforts by law enforcement agencies to trace the owners.

To cover their tracks, the hackers used a method called bitcoin mixing, or what is often called a bitcoin tumbler. With this procedure, users can transfer cryptocurrency into a system that distributes money to hundreds of thousands of wallets within it. After this, the bitcoin ends up in the storage required by the sender.

There are three reasons why Bitcoin is considered anonymous:
  1. First, unlike bank accounts and most other payment systems, Bitcoin addresses are not tied to the user's identity at the protocol level. Anyone can create a new randomly generated Bitcoin address (and associated private key) at any time without having to provide anyone with personal information.
  2. Second, transactions are also not tied to user identity. This way, if a miner agrees to include a transaction in a block, anyone can transfer bitcoins from one address to another without having to reveal any personal information. As with cash, the recipient of the money does not need to know the sender.
  3. And third, Bitcoin transaction information is sent via randomly selected P2P network nodes. Although Bitcoin nodes are connected to each other via IP addresses, they do not know whether the transactions they receive were made by the node sending the information or simply forwarding it.
In this article about Crypto Currency, we try to discuss how to make Bitcoin Anonymous with the help of the TOR application. In practice, to create Bitcoin Anonymous, when writing this article, the FreeBSD 13.2 system is used.



1. TOR Installation and Configuration

OK, first let's start by installing TOR Network, here's how to install TOR on a FreeBSD system.

root@ns1:~ # pkg install tor
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
tor: 0.4.7.13
The command above is how to install TOR with the pkg package. For those of you who like to install using the ports system, here are the commands.

root@ns1:~ # cd /usr/ports/security/tor
root@ns1:/usr/ports/security/tor #
make install clean
The next step, after the installation process is complete, is to configure TOR. For more details about the TOR installation and configuration process, you can read the article "Installation And Configuration TOR On FreeBSD Server".

The main TOR config file is located at /usr/local/etc/tor/torrc. Edit the file and activate the script below on the file.

root@ns1:~ # ee /usr/local/etc/tor/torrc
SOCKSPort 192.168.5.2:9050
SOCKSPolicy accept 192.168.5.2/24
DNSPort 192.168.5.2:9053
Log notice syslog
RunAsDaemon 1
DataDirectory /var/db/tor
ControlPort 9051
HiddenServiceDir /var/db/tor/bitcoin/
HiddenServicePort 8333 192.168.5.2:8333
Then activate start up rc.d, so that TOR can run automatically when the computer reboots or restarts.

root@ns1:~ # ee /etc/rc.conf
tor_enable="YES"
tor_instances=""
tor_conf="/usr/local/etc/tor/torrc"
tor_user="_tor"
tor_group="_tor"
tor_datadir="/var/db/tor"


2. Bitcoin Installation and Configuration

To install Bitcoin, it is recommended to use the ports system, because with this method all Bitcoin dependencies can be installed perfectly. The following is how to install Bitcoin with the FreeBSD ports system.

root@ns1:~ # cd /usr/ports/net-p2p/bitcoin
root@ns1:/usr/ports/net-p2p/bitcoin #
make install clean
During the installation, options will appear that you can choose according to your needs, in this article we will check all of these options.



Bitcoin installation can also be done in other ways. You can read a complete explanation regarding Bitcoin installation in the article "Guide For Setting Up And Mining Bitcoin BTC On FreeBSD". In this article, we assume you have read the article, so we immediately configure Bitcoin so that it can connect to the TOR Network network.


3. Connecting Bitcoin with TOR

In part 3 we will discuss how to connect Bitcoin Core Wallet to the TOR Network server. The main Tor onion file is located in the /var/db/tor/bitcoin/hostname file.

root@ns1:~ # ee /var/db/tor/bitcoin/hostname
zywbdxiug6353tvks46c6gzpr3t2jhc4mm6e2pa5pftbnd3yykmkctyd.onion
The contents of this file will connect Bitcoin with the TOR network anonymously. After we get the .onion file, then we continue by configuring the /usr/local/etc/bitcoin.conf file.

root@ns1:~ # ee /usr/local/etc/bitcoin.conf
rpcuser=iwanse1212
rpcpassword=iwanse_1212
#rpcbind=127.0.0.1, 192.168.5.2
rpcallowip=127.0.0.1
server=1
daemon=1
gen=0
port=8333
rpcport=8332

proxy=192.168.5.2:9050
listen=1
bind=192.168.5.2
discover=1
externalip=zywbdxiug6353tvks46c6gzpr3t2jhc4mm6e2pa5pftbnd3yykmkctyd.onion
onlynet=onion

addnode=sato7wjyyc5wr7ssj24q4yeiwsd4vp7ruc6sea2vztwkikbhx5mslnad.onion:8333
addnode=shinjxqy427avxlboncgwutwl53ynfgzhh4ev246ncvdwl4pwmx4rlqd.onion:8333
addnode=nakaiqmpnvtryxsr4ed4g3poko4swq5d2hqzz6fqhmtl7plii5hi34ad.onion:8333
addnode=motozgkgpbhhxs3ize3eudhgwz277l3q7r6jspewjdtfzzbmtni7x6ad.onion:8333
addnode=26dclk7xbzy4f6gaspbxzsmhhb332ozcjhaaksyq4x66ia5ckfdsryad.onion:8333
addnode=2it222nsdjr6xeamcynu2ddsctbovdgfgy5dcstw6u6k44pnxjcttmad.onion:8333
addnode=2jmtxvyup3ijr7u6uvu7ijtnojx4g5wodvaedivbv74w4vzntxbrhvad.onion:8333
addnode=sato7wjyyc5wr7ssj24q4yeiwsd4vp7ruc6sea2vztwkikbhx5mslnad.onion:8333
addnode=shinjxqy427avxlboncgwutwl53ynfgzhh4ev246ncvdwl4pwmx4rlqd.onion:8333
addnode=nakaiqmpnvtryxsr4ed4g3poko4swq5d2hqzz6fqhmtl7plii5hi34ad.onion:8333
addnode=motozgkgpbhhxs3ize3eudhgwz277l3q7r6jspewjdtfzzbmtni7x6ad.onion:8333
After that we create a symlink to the /root folder.

root@ns1:~ # ln -s /var/db/bitcoin /root/.bitcoin
root@ns1:~ #
ln -s /usr/local/etc/bitcoin.conf /root/.bitcoin
If the symlink file has been created, the next step is to create a start up rc.d in the /etc/rc.conf file.

root@ns1:~ # ee /etc/rc.conf
bitcoind_enable="YES"
bitcoind_user="bitcoin"
bitcoind_group="bitcoin"
bitcoind_data_dir="/var/db/bitcoin"
The final step in configuration is to reboot the computer or you can also restart Bitcoin, but it is best to reboot/restart the computer at the beginning of the configuration. The command below is used to restart the Bitcoin program.

root@ns1:~ # service bitcoind restart


4. Test Bitcoin

After the steps above have been carried out and nothing has been missed, now we try to test whether Bitcoin is connected to the TOR network. Type the command below to view the Bitcoin and TOR networks.

root@ns1:~ # service bitcoind restart
root@ns1:~ #
bitcoin-cli getblockchaininfo
{
"chain": "main",
"blocks":
185008,
"headers": 806682,
"bestblockhash": "000000000000068b678282b2ec7d5e3f17add5ce1cc3dcf71d6f48ffbb9bc896",
"difficulty": 1583177.847444009,
"time": 1339955740,
"mediantime": 1339953777,
"verificationprogress": 0.004859871523494127,
"initialblockdownload": true,
"chainwork": "00000000000000000000000000000000000000000000001366594d3db4970233",
"size_on_disk": 2122223223,
"pruned": false,
"warnings": ""
}
Pay attention to the blue writing, currently our Bitcoin network has been synchronized up to block 185008. Wait for 3 or 5 minutes, if this number increases, it means our Bitcoin network can be connected to TOR.

root@ns1:~ # bitcoin-cli getblockchaininfo
{
"chain": "main",
"blocks":
186698,
"headers": 806682,
"bestblockhash": "00000000000007b5e6a1cd7ed89e63e7d63659ee1bce8dd65ec83d58b86c48b8",
"difficulty": 1726566.55919348,
"time": 1340936488,
"mediantime": 1340933909,
"verificationprogress": 0.005239946366819443,
"initialblockdownload": true,
"chainwork": "000000000000000000000000000000000000000000000014105088546ee78a1c",
"size_on_disk": 2291710528,
"pruned": false,
"warnings": ""
}
After 3 or 5 minutes it turns out the block number has changed, meaning we have succeeded in creating Anonymous Bitcoin via the TOR network. Now let's look at the Bitcoin network, whether it says proxy and .onion. Type the following command to check the Bitcoin network.

root@ns1:~ # bitcoin-cli getnetworkinfo
{
"version": 250000,
"subversion": "/Satoshi:25.0.0/",
"protocolversion": 70016,
"localservices": "0000000000000409",
"localservicesnames": [
"NETWORK",
"WITNESS",
"NETWORK_LIMITED"
],
"localrelay": true,
"timeoffset": -1,
"networkactive": true,
"connections": 11,
"connections_in": 0,
"connections_out": 11,
"networks": [
{
"name": "ipv4",
"limited": true,
"reachable": false,
"proxy": "192.168.5.2:9050",
"proxy_randomize_credentials": true
},
{
"name": "ipv6",
"limited": true,
"reachable": false,
"proxy": "192.168.5.2:9050",
"proxy_randomize_credentials": true
},
{
"name": "onion",
"limited": false,
"reachable": true,
"proxy": "192.168.5.2:9050",
"proxy_randomize_credentials": true
},
{
"name": "i2p",
"limited": true,
"reachable": false,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "cjdns",
"limited": true,
"reachable": false,
"proxy": "192.168.5.2:9050",
"proxy_randomize_credentials": true
}
],
"relayfee": 0.00001000,
"incrementalfee": 0.00001000,
"localaddresses": [
{
"address": "zywbdxiug6353tvks46c6gzpr3t2jhc4mm6e2pa5pftbnd3yykmkctyd.onion",
"port": 8333,
"score": 4
}
],
"warnings": ""
}

It turns out that it says proxy and .onion, meaning now our Core Bitcoin Wallet has become Anonymous. We just have to wait for the synchronization process so that the Bitcoin core wallet can be used to carry out Bitcoin receiving and transferring transactions. You need to remember, the Bitcoin synchronization process takes days, because the number of blocks is quite large. It can even take 3 or 4 days if our internet network is slow.

Even though TOR has its drawbacks and is not 100% an effective solution for securing the Bitcoin network, having TOR can provide more protection compared to simply running a Bitcoin core wallet without TOR.
Iwan Setiawan

I Like Adventure: Mahameru Mount, Rinjani Mount I Like Writer FreeBSD

Post a Comment

Previous Post Next Post