Skip to main content

48/RLN-INTEREP-SPEC

Abstract

This spec integrates Interep into the RLN spec. Interep is a group management protocol that allows for the creation of groups of users and the management of their membership. It is used to manage the membership of the RLN group.

Interep ties in web2 identities with reputation, and sorts the users into groups based on their reputation score. For example, a GitHub user with over 100 followers is considered to have "gold" reputation.

Interep uses Semaphore under the hood to allow anonymous signaling of membership in a group. Therefore, a user with a "gold" reputation can prove the existence of their membership without revealing their identity.

RLN is used for spam prevention, and Interep is used for group management.

By using Interep with RLN, we allow users to join RLN membership groups without the need for on-chain financial stake.

Motivation

To have Sybil-Resistant group management, there are implementations of RLN which make use of financial stake on-chain. However, this is not ideal because it reduces the barrier of entry for honest participants.

In this case, honest participants will most likely have a web2 identity accessible to them, which can be used for joining an Interep reputation group. By modifying the RLN spec to use Interep, we can have Sybil-Resistant group management without the need for on-chain financial stake.

Since RLN and Interep both use Semaphore-style credentials, it is possible to use the same set of credentials for both.

Functional Operation

Using Interep with RLN involves the following steps -

  1. Generate Semaphore credentials
  2. Verify reputation and join Interep group
  3. Join RLN membership group via interaction with Smart Contract, by passing a proof of membership to the Interep group

1. Generate Semaphore credentials

Semaphore credentials are generated in a standard way, depicted in the Semaphore documentation.

2. Verify reputation and join Interep group

Using the Interep app deployed on Goerli, the user can check their reputation tier and join the corresponding group. This results in a transaction to the Interep contract, which adds them to the group.

3. Join RLN membership group

Instead of sending funds to the RLN contract to join the membership group, the user can send a proof of membership to the Interep group. This proof is generated by the user, and is verified by the contract. The contract ensures that the user is a member of the Interep group, and then adds them to the RLN membership group.

Following is the modified signature of the register function in the RLN contract -

    /// @param groupId: Id of the group.
/// @param signal: Semaphore signal.
/// @param nullifierHash: Nullifier hash.
/// @param externalNullifier: External nullifier.
/// @param proof: Zero-knowledge proof.
/// @param idCommitment: ID Commitment of the member.
function register(
uint256 groupId,
bytes32 signal,
uint256 nullifierHash,
uint256 externalNullifier,
uint256[8] calldata proof,
uint256 idCommitment
)

Verification of messages

Messages are verified the same way as in the RLN spec.

Slashing

The slashing mechanism is the same as in the RLN spec. It is important to note that the slashing may not have the intended effect on the user, since the only consequence is that they cannot send messages. This is due to the fact that the user can send a identity commitment in the registration to the RLN contract, which is different than the one used in the Interep group.

Proof of Concept

A proof of concept is available at vacp2p/rln-interp-contract which integrates Interep with RLN.

Security Considerations

  1. As mentioned in Slashing, the slashing mechanism may not have the intended effect on the user.
  2. This spec inherits the security considerations of the RLN spec.
  3. This spec inherits the security considerations of Interep.
  4. A user may make multiple registrations using the same Interep proofs but different identity commitments. The way to mitigate this is to check if the nullifier hash has been detected previously in proof verification.

References

  1. RLN spec
  2. Interep
  3. Semaphore
  4. Decentralized cloudflare using Interep
  5. Interep contracts
  6. RLN contract
  7. RLNP2P