Skip to content

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

@daveroga

Description

@daveroga

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions