Skip to content

Commit a40a200

Browse files
committed
2 parents 36b946f + 1bb7c04 commit a40a200

32 files changed

+165
-46
lines changed

15_0_Using_i2p.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Chapter 15: Using i2p
2+
3+
The Invisible Internet Project (I2P) is a fully encrypted private network layer. It uses a distributed [network database](https://geti2p.net/en/docs/how/network-database) and encrypted unidirectional tunnels between your and your peers.
4+
5+
Basic differences between Tor and i2p:
6+
7+
| | Tor | i2p |
8+
| :--- | :---: | ---: |
9+
| Routing | [Onion](https://www.onion-router.net/) | [Garlic](https://geti2p.net/en/docs/how/garlic-routing) |
10+
| Network Database | Trusted [Directory Servers](https://blog.torproject.org/possible-upcoming-attempts-disable-tor-network) | [Distributed network database](https://geti2p.net/en/docs/how/network-database) |
11+
| Relay | **Two-way** encrypted connections between each Relay | **One-way** connections between every server in its tunnels |
12+
| Hidden services | Slow | Fast |
13+
14+
Read more: https://geti2p.net/en/comparison/tor
15+
16+
It is not installed by [Bitcoin Standup](https://github.com/BlockchainCommons/Bitcoin-Standup-Scripts) right now as i2p support was recently added in Bitcoin core. However, you can try it manually by following the steps mentioned in [Section One](15_1_i2p_service.md).
17+
18+
## Objectives for This Chapter
19+
20+
After working through this chapter, a developer will be able to:
21+
22+
* Run Bitcoin Core as an I2P (Invisible Internet Project) service
23+
24+
Supporting objectives include the ability to:
25+
26+
* Understand the i2p Network
27+
* Learn difference between Tor and i2p
28+
29+
## Table of Contents
30+
31+
* [Section One: Bitcoin Core as an I2P (Invisible Internet Project) service](15_1_i2p_service.md)

15_1_i2p_service.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# 15.1: Bitcoin Core as an I2P (Invisible Internet Project) service
2+
3+
Users should consider different trade-offs involved in using i2p with other networks in Bitcoin Core for better privacy:
4+
5+
- Sybil Attacks and Network Partitioning is possible with `onlynet=i2p`
6+
- Running Onion service with i2p service is experimental for now.
7+
- For maximum privacy, it is preferable to disable accepting incoming connections.
8+
9+
Read more: https://bitcoin.stackexchange.com/questions/107060/tor-and-i2p-tradeoffs-in-bitcoin-core
10+
11+
Follow the below steps to run Bitcoin Core i2p service:
12+
13+
1. You can install `i2pd` on Ubuntu with below commands:
14+
15+
```
16+
sudo add-apt-repository ppa:purplei2p/i2pd
17+
sudo apt-get update
18+
sudo apt-get install i2pd
19+
```
20+
21+
For installing on other OS: https://i2pd.readthedocs.io/en/latest/user-guide/install/
22+
23+
2. Then [run](https://i2pd.readthedocs.io/en/latest/user-guide/run/) it and check if its running:
24+
25+
```
26+
$ sudo systemctl start i2pd.service
27+
```
28+
29+
You should see it running on port 7656:
30+
31+
```
32+
$ ss -nlt
33+
34+
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
35+
36+
LISTEN 0 4096 127.0.0.1:7656 0.0.0.0:*
37+
```
38+
39+
3. Add the following lines in `bitcoin.conf`. Config logging option `debug=i2p` is used to have additional information in the debug log about your I2P configuration and connections (Default location on Linux: ~/.bitcoin/bitcoin.conf):
40+
41+
```
42+
i2psam=127.0.0.1:7656
43+
debug=i2p
44+
```
45+
46+
5. Restart `bitcoind`
47+
48+
```
49+
$ bitcoind
50+
```
51+
52+
6. 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_:
53+
```
54+
2021-06-15T20:36:16Z i2paccept thread start
55+
2021-06-15T20:36:16Z I2P: Creating SAM session with 127.0.0.1:7656
56+
57+
2021-06-15T20:36:56Z I2P: SAM session created: session id=3e0f35228b, my address=bmwyyuzyqdc5dcx27s4baltbu6zw7rbqfl2nmclt45i7ng3ul4pa.b32.i2p:18333
58+
2021-06-15T20:36:56Z AddLocal(bmwyyuzyqdc5dcx27s4baltbu6zw7rbqfl2nmclt45i7ng3ul4pa.b32.i2p:18333,4)
59+
```
60+
61+
7. 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*:
62+
```
63+
~/.bitcoin/testnet3$ ls
64+
65+
anchors.dat chainstate i2p_private_key settings.json
66+
banlist.dat debug.log mempool.dat wallets
67+
blocks fee_estimates.dat peers.dat
68+
```
69+
70+
8. `bitcoin-cli -netinfo` or `bitcoin-cli getnetworkinfo`returns i2p address:
71+
72+
```
73+
Local addresses
74+
bmwyyuzyqdc5dcx27s4baltbu6zw7rbqfl2nmclt45i7ng3ul4pa.b32.i2p port 18333 score 4
75+
```
76+
77+
## Summary: Bitcoin Core as an I2P (Invisible Internet Project) service
78+
79+
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, less people use it, experiment with it and report bugs if you find any issues.
80+
81+
> :information_source: **NOTE:** _i2pd_ (C++) is different from _i2prouter_ (Java), you will need `i2pd` for Bitcoin Core.
82+
83+
Move on to "Programming with RPC" with [Chapter Sixteen: Talking to Bitcoind with C](16_0_Talking_to_Bitcoind.md).
84+
85+
Or, if you're not a programmer, you can skip to [Chapter Nineteen: Understanding Your Lightning Seutp](https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line/blob/master/19_0_Understanding_Your_Lightning_Setup.md) to continue your command-line education with the Lightning Network.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)