Merge bitcoin/bitcoin#35696: i2p: update leaseset encryption types
What changed, and why it matters
This change updates Bitcoin Core's I2P (Invisible Internet Project) privacy network settings to use newer, stronger encryption for the published 'leaseset' that describes how other peers can contact a node. The old setting included ElGamal encryption, which the I2P project now labels 'legacy' and no longer recommends. This is a hardening improvement rather than a fix for a known active attack, but it reduces future cryptographic risk for users who route Bitcoin traffic over I2P.
Treat as a routine hardening update. Users running I2P-enabled Bitcoin Core nodes should upgrade to benefit from modern lease set encryption. No emergency response is warranted because the change does not address a demonstrated exploit and the old setting remains interoperable.
Security signals we found
Cryptographic algorithm update (ElGamal to MLKEM-768)
Use of I2P 'legacy' encryption type removed
Configuration-only change in network privacy layer
No memory safety, input validation, or consensus code changed
Evidence from the diff
The commit changes the SAMv3 SESSION CREATE parameter i2cp.leaseSetEncType from ‘4,0’ to ‘6,4’ in src/i2p.cpp. Per I2P documentation, type 4 is ECIES-X25519 and type 0 is ElGamal; type 6 is MLKEM-768. The new list therefore replaces ElGamal with MLKEM-768 while keeping ECIES-X25519. This aligns Bitcoin Core with current I2P project recommendations and removes a legacy encryption type from I2P lease sets.
Changed components
src/i2p.cppI2P SAM session creationI2P lease set encryption negotiationInspect captured patch +2 / −2
### src/i2p.cpp
@@ -425,7 +425,7 @@ void Session::CreateIfNotCreatedAlready()
const Reply& reply = SendRequestAndGetReply(
*sock,
strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=TRANSIENT SIGNATURE_TYPE=7 "
- "i2cp.leaseSetEncType=4,0 inbound.quantity=1 outbound.quantity=1",
+ "i2cp.leaseSetEncType=6,4 inbound.quantity=1 outbound.quantity=1",
session_id));
m_private_key = DecodeI2PBase64(reply.Get("DESTINATION"));
@@ -443,7 +443,7 @@ void Session::CreateIfNotCreatedAlready()
SendRequestAndGetReply(*sock,
strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=%s "
- "i2cp.leaseSetEncType=4,0 inbound.quantity=3 outbound.quantity=3",
+ "i2cp.leaseSetEncType=6,4 inbound.quantity=3 outbound.quantity=3",
session_id,
private_key_b64));
}Why this scored 35/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.