Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I2P integration #7

Open
layters opened this issue Sep 13, 2022 · 0 comments
Open

I2P integration #7

layters opened this issue Sep 13, 2022 · 0 comments
Labels
💰 bounty Get paid by completing a task 🆘 help wanted Extra attention is needed urgent Required to move forward 👍 enhancement New feature or request
Milestone

Comments

@layters
Copy link
Owner

layters commented Sep 13, 2022

Details

By default all peers will be anonymized through the use of i2pd. Like how Monero has mandatory privacy, i2pd will be mandatory for routing the network traffic of users. This is the only way to make neroshop truly private and decentralized.
Currently, I'm facing issues relating to bypassing NAT routers and firewalls while using the low-level C API (POSIX) sockets provided by the operating system and I need urgent help with i2pd integration.

Tor is primarily focused on TCP-based traffic and does not provide native support for routing UDP traffic so i2p is the only way forward since the neroshop DHT is based on the UDP protocol. Also, I believe i2p is a much more suitable option when it comes to DHT networks, torrenting, etc.

i2pd and i2psam are already bundled with the code as submodules and can be built into static libraries. However, neither is currently being utilized due to a lack of documentation and understanding of the i2p network ☹️ .

Edit: As of #270 , the entire i2pd router has been embedded within the neroshop daemon so now there is no need to download, install or run an external router.

i2pd vs i2psam
  1. libi2pd allows us to embed a router in an application (in this case, the neroshop daemon) so an external one is not required and it provides the SAMv3 API server.

  2. i2psam gives us socket-like abstractions of I2P connections, using the API server provided by an external router

Either library can be used, though i2pd is preferred.

Additional Information

The neroshop DHT node uses two separate UDP sockets for communication - one for listening to and responding to requests via the Node::run() function and the other is a temporary socket that is used for sending queries to other nodes in the network via the Node::send_query() function. I want to know how I can route both the inbound and outbound traffic of the Node using i2p.

You will most likely be using i2p's SAMv3 API

You may rewrite node.cpp if you have to!

The neroshop daemon should start the i2pd router the moment it is opened and the node should create a session (b32.i2p address) which can be hashed with sha3_256 and used as the node_id.
From there, the session can create multiple streams to communicate with other peers in the network. I'm not familiar with the i2p network so I probably don't know what I'm saying.

Related links

neroshop networking stack:
https://github.com/larteyoh/testshop/blob/main/src/core/protocol/p2p/node.cpp
https://github.com/larteyoh/testshop/blob/main/src/daemon/main.cpp

libi2pd (SAMv3 API + router):
https://github.com/PurpleI2P/i2pd/blob/openssl/libi2pd_client/SAM.cpp
https://github.com/PurpleI2P/i2pd/blob/openssl/libi2pd_client/SAM.hpp

https://github.com/PurpleI2P/i2pd/tree/openssl/libi2pd

i2psam:
https://github.com/i2p/i2psam/blob/master/i2psam.cpp
https://github.com/i2p/i2psam/blob/master/i2psam.h

Official i2p docs:
https://geti2p.net/en/docs/applications/embedding
https://geti2p.net/en/docs/api/samv3

Related projects
monero-project/monero-gui#4263

Examples

https://github.com/i2p/i2psam?tab=readme-ov-file#example

Related issues

#124
#228

Bounty reward 

$2500 USD (via crypto)

@layters layters added 👍 enhancement New feature or request 🆘 help wanted Extra attention is needed labels Sep 13, 2022
@layters layters added this to the todo milestone Sep 13, 2022
@layters layters added the 💰 bounty Get paid by completing a task label Oct 4, 2022
@layters layters changed the title Tor integration Tor integration [$250] Oct 4, 2022
@layters layters changed the title Tor integration [$250] Tor and I2P integration [$250] Oct 6, 2022
@layters layters pinned this issue Oct 23, 2022
@layters layters changed the title Tor and I2P integration [$250] Tor and I2P integration Oct 23, 2022
@layters layters unpinned this issue Feb 12, 2023
@layters layters removed the 💰 bounty Get paid by completing a task label Apr 8, 2023
@layters layters pinned this issue Jul 3, 2023
@layters layters changed the title Tor and I2P integration ~~Tor and ~~I2P integration Jul 5, 2023
@layters layters changed the title ~~Tor and ~~I2P integration ~~Tor and~~ I2P integration Jul 5, 2023
@layters layters changed the title ~~Tor and~~ I2P integration I2P integration Jul 5, 2023
@layters layters added the 💰 bounty Get paid by completing a task label Jul 5, 2023
@layters layters added the urgent Required to move forward label Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💰 bounty Get paid by completing a task 🆘 help wanted Extra attention is needed urgent Required to move forward 👍 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant