#32065 i2p: make a time gap between creating transient sessions and using them
https://github.com/bitcoin/bitcoin/pull/32065 · · +94/-47 in 4 files, 3 commits · labels: P2P, Needs rebase
Goal
- Prevent adversaries from linking I2P connection events through timing correlation
- Improves privacy for I2P users running outbound-only connections with transient sessions
Decouples I2P transient session creation from actual connection initiation. Bitcoin Core previously issued `SESSION CREATE` immediately before `STREAM CONNECT`, enabling external observers to correlate session establishment with outbound connection timing. The patch pre-creates a single transient session ahead of time so connections use an existing session with an arbitrary time delay.
Problem: When connecting to I2P peers using transient sessions, creating and immediately using a session in quick succession allows adversaries monitoring network traffic to correlate activity and link connection events. Users running outbound I2P connections without listening mode have their privacy weakened by this timing correlation.
Category: P2P (#24 of 65)
P3 · DoS protection
- P3 because it provides meaningful privacy hardening against network-level metadata leakage on I2P
- The benefit is narrow since it only affects nodes operating with transient sessions
P3 because it provides meaningful privacy hardening against network-level metadata leakage for I2P users. Author noted that immediate succession of session creation and connection 'could ease network activity monitoring by an adversary'. The benefit is narrow because it only impacts nodes operating with transient sessions (`-i2pacceptincoming=0`).
Membership: Modifies outbound connection logic in `src/net.cpp` and transient session lifetime in `src/i2p.cpp`.
Factors: security/stability 1, bug 0, performance 0, user value 1, leverage 0
Reviewability: Stale: Needs rebase
- Needs rebase due to merge conflicts
- Author has been inactive on the PR for several months
The PR has merge conflicts against master and has seen no author activity for 140 days.
Author status: silent since 2026-04-30
Resolved concerns:
- I2P router developers expressed concern that maintaining a pool of up to 10 idle sessions would waste network resources; author resolved this by reducing the standby cache to a single session.
Agreement: Strong
- Concept supported for privacy gains by upstream I2P developers (zzzi2p, eyedeekay)
- Resource overhead concern resolved by shrinking standby cache to one session (zzzi2p, eyedeekay)
- Reviewers are waiting on an author rebase to proceed (sedited)
Concept supported by I2P developers; resource usage concerns resolved by caching only one session
Upstream I2P developers provided Concept ACKs emphasizing the privacy benefits of decoupling session creation from stream usage. Their initial concerns about network overhead were addressed when the author reduced the standby pool from 10 to a single session.
- zzzi2p and eyedeekay Concept ACKed the privacy improvement while cautioning against large standby pools.
- vasild updated the design to retain only one pre-created session, resolving the resource overhead concerns.
- sedited pinged for a rebase asking if the author remains interested.
Review verdicts (DrahtBot): 0
- Concept ACK: zzzi2p, eyedeekay, 1440000bytes
Files
3 lines under test/bench/ci.
- src/net.cpp +50/-23
- src/net.h +35/-23
- src/i2p.cpp +7/-0
- src/test/util/net.h +2/-1
Card
PR #32065 introduces a time gap between creating transient I2P sessions and initiating connections over them to hinder network traffic correlation. For nodes running without a listening I2P address, creating sessions in advance decouples `SESSION CREATE` from `STREAM CONNECT`. I2P developers Concept ACKed the privacy improvement, and earlier concerns regarding idle tunnel resource usage were addressed by shrinking the pre-created session cache to one. The PR is currently stale and needs a rebase after several months of author inactivity.