-
Notifications
You must be signed in to change notification settings - Fork 11
Home
My goals for this project was to make a C# router for I2P that was:
- Small
- Simple to understand
- Standalone to be simple to integrate and use
- Fast avoiding memory copies
Some of the results:
- As I started with .NET 3.5, I used BouncyCastle to get a BigInteger.
- It also uses Chaos.NaCl to get EdDSA-SHA512-Ed25519 that is frequently used in I2P
- NTCP was made single threaded to be simple to follow, but it needs attention, and should probably use "async"
- The code is bigger than I wanted it to be
I really wanted the code to have some real use application before uploading it, but I currently have no time to work on it due to other commitments.
In its current state, it can route I2P traffic, discover routers and endpoints and receive and transmit Garlic. The router has no Flood Fill functionality, but it should be pretty easy to add. I was working on I2CP and a streaming library at the time of the last commit.
To seed the router database, you can copy the files from another I2P router to the directory printed at startup by the example program as "NetDb: Path: ...".
I hope this can be used for something. Perhaps to understand some part of the I2P protocol. Making this, I looked a lot at the Purple I2P and Java implementations. If you find it useful for something or just want to donate, you can do that to BTC: 1CBfaj7mmzNPm2W9PKDGjtrwco7Y34dqFe
References:
PurpleI2P (C++) : https://github.com/PurpleI2P/i2pd
Reference (Java): https://github.com/i2p/i2p.i2p
Status update 2020-02-25:
Bootstrapping is implemented so running the small demo I2P/Program.cs work without any extra files.
Sending and receiving datagrams work now, and ElGamal/AES+SessionTags is implemented.
Status update 2020-03-11:
Added a subset of the I2CP protocol used by BiglyBT to see if the router works. It does not.
Most things looks OK. Published destinations can be found. The demo projects I2PEchoClient/Server can find each other and exchange data through tunnels.
The only clue I got what could be wrong is that i2pd reports "ElGamal decrypt hash doesn't match" when receiving Garlic to a destination. The strange thing is that the same ElGamal code works to update floodfills with published lease sets packed in Garlic. The only reason I can think of what can go wrong is that the wrong public key is used when doing the EG encryption, but I cannot find what could be causing that.