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

feat(waku-stealth-commitments): waku stealth commitment protocol #2490

Merged
merged 6 commits into from
Mar 6, 2024

Conversation

rymnc
Copy link
Contributor

@rymnc rymnc commented Feb 29, 2024

Description

Adds a wakustealthcommitment application/tool/service to the apps/ directory - it should be used for generating stealth addresses/commitments for users.

This can be useful in a variety of ways, but needs to be fleshed out for curve operations, FFI api used will be from erc-5564-bn254 or native use of constantine.

Changes

  • Updates waku.nimble, Makefile
  • Creates new app wakustealthcommitments

How to test

  1. Instructions are in readme
waku_stealth_commitments.1.mp4

Comment on lines 34 to 38
proc handler(topic: PubsubTopic, msg: WakuMessage): Future[void] {.async, gcsafe.} =
if msg.contentTopic == contentTopic:
SCPHandler(msg)

wakuApp.node.subscribe((kind: PubsubSub, topic: DefaultPubsubTopic), some(handler))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

hey @alrevuelta, for some reason while running this application, this handler gets called for messages it is sending. am i missing a config field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

noticed we set triggerSelf to true here ->

triggerSelf = true,

Copy link
Contributor

Choose a reason for hiding this comment

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

yep

Copy link

github-actions bot commented Feb 29, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2490

Built from c7d3680

@rymnc rymnc changed the title feat(waku-stealth-commitments): initialize app feat(waku-stealth-commitments): waku stealth commitment protocol Mar 1, 2024
@rymnc rymnc marked this pull request as ready for review March 4, 2024 12:12
Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

Mmm. I'd suggest moving wakustealthcommitments for now to the examples subfolder. In some sense, this is still an example/POC to illustrate how nodes can run the stealth commitment protocol. I imagine that at some point the correct way to use this would be to fully integrate the protocol into wakunode2, create a request API, etc. Until then the reference can live as an example and I wouldn't create a Make target/nimble task for it (people can build and run it using nim c -r as already described in the README). Wdyt?

Makefile Outdated
@@ -206,6 +206,10 @@ chat2: | build deps librln
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim chat2 $(NIM_PARAMS) waku.nims

wakustealthcommitments: | build deps librln
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps remove Make target (and nimble task)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in fea64e0

```sh
cd <path-to-nwaku>
source env.sh
nim c --out:build/wakustealthcommitments --verbosity:0 --hints:off -d:chronicles_log_level=INFO -d:git_version="v0.24.0-rc.0-62-g7da25c" -d:release --passL:-lm --passL:liberc_5564_bn254.a --debugger:native apps/wakustealthcommitments/wakustealthcommitments.nim
Copy link
Contributor

Choose a reason for hiding this comment

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

Could have been make wakustealthcommitments here, but I think this should remain like this as I suggest removing the Make target in any case (as it will be temporary until we incorporate stealth commitment protocol into the node itself).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It couldn't have, without setting up a proper pipeline for the erc-5564-bn254 static lib.
removing the makefile entry in any case

@rymnc rymnc requested a review from jm-clius March 5, 2024 08:15
Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

For my understanding, how we should use that protocol to enhance the communication privacy?

@rymnc
Copy link
Contributor Author

rymnc commented Mar 6, 2024

LGTM! Thanks!

For my understanding, how we should use that protocol to enhance the communication privacy?

image
This should be the way commitments are registered to maintain privacy!

Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for this - very cool.

@rymnc rymnc merged commit 0def490 into master Mar 6, 2024
8 checks passed
@rymnc rymnc deleted the waku-stealth-commitments branch March 6, 2024 13:14
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.

None yet

4 participants