Skip to content

Gateway incentivization

Pau edited this page Aug 20, 2020 · 11 revisions

This document is a work-in-progress proposal.

Description

In order to incentive the Gateways network, design and implement a reward system. Gateways will get credits for each valid relayed vote.

A Proof-of-Relay must be defined, the user adds a cryptographic proof that later on the Gateway can use to demonstrate he relayed its vote.

  1. a user generates a Prof-of-Relay when sending a vote through a specific Gateway. To this aim, the voting ZK-snarks circuit must be extended. The user should use the pubKey of the Gateway as private input and generate a relay proof which will be required as a public output.
  2. the Gateway can demonstrate he actually relayed the vote by demonstrating he owns the private key to which the public key was used for generating the relayer proof

Relayer Vote Proof

Assume that Relayer proof = hash (relayerPubKey + processID)

A voter can generate a valid proof using the usual inputs of the voting ZK-snark circuit, but adding:

  1. Relayer Public Key
  2. Relayer Proof

This way the vote will be attached to a specific Relayer Public Key.

|______________voting phase____________________|____relayed votes computation___|___ reward phase ___...
[block]-[block]-[block]-[block]-[block]-[block]-[block]-[block]-[block]-[block]-[block]-[block][block]...

Publish reward merkle root

Once election is finished, the relayed vote computation phase starts. All valid relayerProofs of the Vochain are added into a merkle tree:

                        [Root]
[1:relayerProof1] [22:relayerProof2] [13:RelayerProof3]

Meaning the first digits the number of valid relayed votes. So relayer2 has relayed 22 votes.

The ROOT of this merkle tree is sent by the oracle to the ethereum reward smart contract together with the results of the election.

Claim funds

To claim the funds the relayer must provide a valid proof (demonstrating the ownership of the public key) and the following inputs:

  • priv: relayer priv key
  • priv: mkproof
  • pub: relayer pubKey
  • pub: processID
  • pub: number of vote claims
  • pub: root

The SNARK will demonstrate that the proover is the owner of the private key which public key is the responsible for relaying N votes.

If the SNARK proof is valid and there has not been any reward claim for the given processID and pubKey, the smart contract sends funds to ethAddress(relayerPubkey)

Dependencies

  • [zk-Snarks]

Circuits

vocdoni_circuit-Copy_of_Copy_of_Page-1

Related articles

Clone this wiki locally