3.5 KiB
15.1: Bitcoin Core as an I2P (Invisible Internet Project) service
Users should consider different trade-offs involved in using i2p with other networks in Bitcoin Core for better privacy:
- Sybil Attacks and Network Partitioning is possible with
onlynet=i2p
- Running Onion service with i2p service is experimental for now.
- For maximum privacy, it is preferable to disable accepting incoming connections.
Read more: https://bitcoin.stackexchange.com/questions/107060/tor-and-i2p-tradeoffs-in-bitcoin-core
Follow the below steps to run Bitcoin Core i2p service:
-
You can install
i2pd
on Ubuntu with below commands:sudo add-apt-repository ppa:purplei2p/i2pd sudo apt-get update sudo apt-get install i2pd
For installing on other OS: https://i2pd.readthedocs.io/en/latest/user-guide/install/
-
Then run it and check if its running:
$ sudo systemctl start i2pd.service
You should see it running on port 7656:
$ ss -nlt State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 4096 127.0.0.1:7656 0.0.0.0:*
-
Add the following lines in
bitcoin.conf
. Config logging optiondebug=i2p
is used to have additional information in the debug log about your I2P configuration and connections (Default location on Linux: ~/.bitcoin/bitcoin.conf):i2psam=127.0.0.1:7656 debug=i2p
-
Restart
bitcoind
$ bitcoind
-
Check
debug.log
if i2p was setup correctly or any errors printed in logs. I2P address is mentioned in the logs and ends with b32.i2p:2021-06-15T20:36:16Z i2paccept thread start 2021-06-15T20:36:16Z I2P: Creating SAM session with 127.0.0.1:7656 2021-06-15T20:36:56Z I2P: SAM session created: session id=3e0f35228b, my address=bmwyyuzyqdc5dcx27s4baltbu6zw7rbqfl2nmclt45i7ng3ul4pa.b32.i2p:18333 2021-06-15T20:36:56Z AddLocal(bmwyyuzyqdc5dcx27s4baltbu6zw7rbqfl2nmclt45i7ng3ul4pa.b32.i2p:18333,4)
-
Confirm
i2p_private_key
was created in Bitcoin Core data directory. The first time Bitcoin Core connects to the I2P router, its I2P address (and corresponding private key) will be automatically generated and saved in a file named i2p_private_key:~/.bitcoin/testnet3$ ls anchors.dat chainstate i2p_private_key settings.json banlist.dat debug.log mempool.dat wallets blocks fee_estimates.dat peers.dat
-
bitcoin-cli -netinfo
orbitcoin-cli getnetworkinfo
returns i2p address:Local addresses bmwyyuzyqdc5dcx27s4baltbu6zw7rbqfl2nmclt45i7ng3ul4pa.b32.i2p port 18333 score 4
Summary: Bitcoin Core as an I2P (Invisible Internet Project) service
It is always good to have alternatives for privacy and not depend only on Tor to run Bitcoin Core as hidden service. Since i2p was recently added in Bitcoin Core, not many people use it. Experiment with it and report bugs if you find any issues.
ℹ️ NOTE: i2pd (C++) is different from i2prouter (Java), you will need
i2pd
for Bitcoin Core.
Move on to "Programming with RPC" with Chapter Sixteen: Talking to Bitcoind with C.
Or, if you're not a programmer, you can skip to Chapter Nineteen: Understanding Your Lightning Seutp to continue your command-line education with the Lightning Network.