tachyon-i2p
Safe async wrapper around i2pd-sys, giving Tokio code a
Destination (an I2P eepsite identity, reachable at a .b32.i2p address) with an I2pStream
connection type that implements AsyncRead/AsyncWrite — no external i2pd/Java-I2P process,
no SAM bridge, no separate service to run alongside your binary.
Status: pre-0.1 (
0.0.2). Usable standalone, and also developed alongside and consumed by thetachyon-webworkspace (via itsi2pfeature). The API may still change without notice.
Why this crate exists, and why it's unsafe internally
libi2pd (the underlying router, from PurpleI2P/i2pd) is a
C++ library with no stable C ABI. i2pd-sys bridges it through a small hand-written extern "C"
shim; this crate is where every unsafe call site into that shim lives, so that consumers (like
tachyon-web) never have to relax their own forbid(unsafe_code). The public API is 100% safe
Rust — no pub unsafe fn, no raw pointers exposed — but that safety rests entirely on this
crate's own review of libi2pd's threading/ownership contracts (documented inline at each unsafe
block, and in i2pd-sys/shim/shim.h), not on any external memory-safety guarantee the way a pure-Rust
dependency would give you.
Usage
[]
= "0.0.2"
use ;
async
Only one I2pRouter may run per process — libi2pd keeps its router context as a process-wide
global, not a per-instance object.
Crypto backend: aws-lc (default) vs fips
Mirrors i2pd-sys's own two mutually exclusive features, passed straight through:
aws-lc(default): regular AWS-LC.fips: the FIPS 140-3-validated AWS-LC-FIPS module instead — mutually exclusive withaws-lc, so needsdefault-features = false, features = ["fips"]. Seei2pd-sys's README ("FIPS" section) for what this does and does not get you before reaching for it to satisfy a compliance requirement.
License
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.