-
Notifications
You must be signed in to change notification settings - Fork 8
Gateway incentivization
This document is a work-in-progress proposal.
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.
- 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.
- 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
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:
- Relayer Public Key
- 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]...
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.
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)
- [zk-Snarks]