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] Update Client Service to enable Regulator for transfers #1372

Open
daveroga opened this issue Feb 4, 2023 · 0 comments · Fixed by #1373
Open

[FEATURE] Update Client Service to enable Regulator for transfers #1372

daveroga opened this issue Feb 4, 2023 · 0 comments · Fixed by #1373

Comments

@daveroga
Copy link
Contributor

daveroga commented Feb 4, 2023

Is your feature request related to a problem? Please describe.
We have the need of having a regulator for some scenarios that should be able to see the information of commitments selected.

Describe the solution you'd like
We will enable a regulator mode in the nightfall-client share the secrets with this regulator
Update the Nightfall Client Service to enable Regulator for transfers

  • A client can work with or without Regulator with a configured parameter REGULATOR_URL that will be set with the regulator API URL by the client. If this parameter is set then the client will force all the transfers with the compressed secrets to enable decryption by the Regulator.
  • Implement 3 way Diffie-Hellman for the share of the secrets encrypted.
  • If Alice wants to send a transfer to Bob and we use a Regulator, in the transfer the client will generate a new transfer key x and will register { PKa, PKb, PKx, pkx * PKb } to the Regulator if not registered previously for that sender and receiver, and will receive a response with { pkr * PKb }. We need to know this pkx, PKx associated with this sender-receiver for next transfers of this sender-receiver. Find a deterministic way to recalculate it.
  • With this (pkr * PKb) * pkx and a XOR of a random nonce will encrypt the commitment information so it's different encrypting key every transfer. This nonce could be stored in the 14 bytes value of the packedInfo of the transaction, not used in the transfer.
  • Create/update circuits to enable this regulator mode transfer.
  • The first solution will be create a separate transfer circuit with regulator.
  • Add the corresponding tests for circuits and logic.

Describe alternatives you've considered

How can this be tested
Create unit tests for circuits involved and kem dem test for the 3 way diffie helman to implement.

Additional context
This feature will be implemented in the feature branch feature-regulator

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 a pull request may close this issue.

1 participant