How can I use Bitcoin Core with the I2P anonymous network protocol?
Jon Atack answered this on Twitter.
Configuration and setup
First install and start I2P (version 2.35 or above).
$ apt install i2pd $ systemctl enable i2pd.service $ systemctl start i2pd.service
bitcoin.conf file add (I will assume you run Bitcoin Core v22+ and want to use both Tor and I2P but remove
onlynet=onion if not interested in Tor):
debug=tor debug=i2p onlynet=onion onlynet=i2p i2psam=127.0.0.1:7656
There are 2 config options for I2P. Only the second one is required to be set for I2P to work.
-i2pacceptincoming If set and -i2psam is also set then incoming I2P connections are accepted via the SAM proxy. If this is not set but -i2psam is set then only outgoing connections will be made to the I2P network. Ignored if -i2psam is not set. Listening for incoming I2P connections is done through the SAM proxy, not by binding to a local address and port (default: 1) -i2psam=<ip:port> I2P SAM proxy to reach I2P peers and accept I2P connections (default: none)
Connecting to I2P peers
There are some hardcoded I2P seeds at the bottom of this file to get started with connections. Scroll down to
# manually added 2021-05 for minimal i2p bootstrap support
You can connect to these seeds with
-seednode in your configuration file (
peers.dat is empty and you start up with
-dnsseed=0 then your node will only know the hardcoded seeds.)
Once you have connections you can view your I2P peers:
watch -t ./src/bitcoin-cli -netinfo 4
(For more information on
-netinfo see the help documentation using
bitcoin-cli -netinfo help or this StackExchange question)
Historical discussion of supporting I2P back in 2012 is here. (Thanks to Adam Jonas for finding this)