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

Add newResultsCommitment, newSpentVoiceCreditsCommitment, newPerVOSpentVoiceCreditsCommitment to the tally output file #760

Closed
yuetloo opened this issue Oct 20, 2023 · 0 comments · Fixed by #877
Assignees

Comments

@yuetloo
Copy link
Contributor

yuetloo commented Oct 20, 2023

It looks like from the comment of Poll.verifyTallyResult() here, newResultsCommitment, newSpentVoiceCreditsCommitment, newPerVOSpentVoiceCreditsCommitment will be need to verify tally output data on chain.

Including the fields in the tally output file (tally.json) will save web application the work to calculate these values when submitting the tally data on chain for verification.

The genProof command already calculates these values here (https://github.com/privacy-scaling-explorations/maci/blob/master/cli/ts/genProofs.ts#L549-L572). Just need to write them out to the tally file.

Here's a sample tally.json generated from the genProof command.

{
    "provider": "http://localhost:8545",
    "maci": "0xAF68B245Ec82A1443fC4100BFB020C34e0361F7E",
    "pollId": 0,
    "newTallyCommitment": "0x1dc2362bdef5fd7e5fa7d2fec1cb9846444bdaf750f0490b2780ddf644379102",
    "results": {
        "tally": [
            "15",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0"
        ],
        "salt": "0x19a2ab58158161384b0eabafce6b3d188056f215c83c1534d00158875901ac5e"
    },
    "totalSpentVoiceCredits": {
        "spent": "15",
        "salt": "0x5abd6f3a1d9ec435564a97c80f439e4409ef95fe80380d4db2a98a10633542f"
    },
    "perVOSpentVoiceCredits": {
        "tally": [
            "15",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0",
            "0"
        ],
        "salt": "0x2d7076c44b72a8a7e6a4a934709ab420b2902c41b59196ade17cfec47c282273"
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants