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

Feature/noise protocol #416

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cyberhumble
Copy link

@cyberhumble cyberhumble commented Feb 15, 2025

This is a draft pull request. I did an early implementation for the noise protocol in coinswap with the handshake pattern NK. I did it only for the req_sigs_for_sender step in the protocol, to get feedback before continuing further. Notice:

  • This is not compiling yet, because I changed the send_message logic, etc.
  • I added a very verbose description of almost every new line of code so you could understand better what I am doing without having to read the noise protocol framework specification.
  • I added only one static noise pair key for every maker, only for developing purposes. We need to handle that static private key carefully, with persistence and of course it should be a different random one for each maker.
  • I used Noise_NK_25519_ChaChaPoly_SHA256 pattern, it can be changed, for example ChaCha20-Poly1305 for AES256-GCM or the hash function.
  • I combined the coinswap handshake with the noise NK handshake for minimizing overhead, but we can do also noise handshake, and then, after the transport state is settled, we can do coinswap handshake.

Good to check:
Noise protocol spec: https://noiseprotocol.org/noise.html
Snow crate: https://github.com/mcginty/snow
NoiseExplorer for the NK pattern: https://noiseexplorer.com/patterns/NK/ -> it gives a security analysis for each message in the NK pattern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant