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

Improved Mixnet design: Random mixnet destination #307

Merged
merged 7 commits into from
Aug 21, 2023

Conversation

youngjoon-lee
Copy link
Contributor

@youngjoon-lee youngjoon-lee commented Aug 17, 2023

In the previous design #302, the problem was that message senders must specify the mixnet destination (== the IP of MixnetClient). Please note that it's different from the message routing destination.
But, in reality, senders doesn't have any information about the IP of MixnetClients available.

Instead, I improved the design like this:

  • A nomos-node always embed a MixnetClient that receives Sphinx packets, reconstructs messages, and sends them to the network backend in its nomos-node.
    • Actually, this is the same in the previous design.
  • If you want to run a MixnetNode, you must know at least one MixnetClient address.
    • In other words, MixnetNode operators should run their own nomos-node as well.
  • When message senders choose 3 MixnetNode from MixnetTopology, they choose one more MixnetNode as a destination, randomly.
  • Finallly, all message fragments (sent from a message sender) are forwarded to the destination MixnetNode. Then, the message is reconstructed and is broadcasted/routed to all other nomos-nodes.
  • On the other hand, as a nomos-node operator, it's not mandatory to run MixnetNode.
image

With this design, the message sender doesn't need to know about the mixnet destination, as Alvaro suggested.

At the next PR, I'll show how to integrate these to the nomos-node.

mixnet/client/src/config.rs Outdated Show resolved Hide resolved
mixnet/client/src/lib.rs Outdated Show resolved Hide resolved
youngjoon-lee and others added 5 commits August 18, 2023 15:55
* Refactor body type to encapsulate data

* Use final payload as generic async read

* fix sending SphinxPacket

* use a common protocol for sending final payload to mixclient

* add a missing TODO comment

---------

Co-authored-by: Youngjoon Lee <taxihighway@gmail.com>
#[derive(Serialize, Deserialize, Clone, Debug)]
pub enum MixnetClientMode {
Sender,
SenderReceiver(SocketAddr),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making mixclient listen connections, I’ll make mixnode open another port only for the mixclient. I think that makes much sense. Then, the mixclient API could be much cleaner.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ll do this at the next PR to not make this PR bigger. Because this PR works now, I think we can go with this, as long as we agree on the MixnetClientMode design

@youngjoon-lee youngjoon-lee marked this pull request as draft August 19, 2023 01:34
@youngjoon-lee youngjoon-lee marked this pull request as ready for review August 19, 2023 02:00
@youngjoon-lee youngjoon-lee merged commit 79d20ef into mixnet-node Aug 21, 2023
2 checks passed
@youngjoon-lee youngjoon-lee deleted the mixnet-design-change branch August 21, 2023 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants