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

Improvement to public inputs in contract #12

Open
sebastiantf opened this issue Feb 27, 2024 · 0 comments
Open

Improvement to public inputs in contract #12

sebastiantf opened this issue Feb 27, 2024 · 0 comments

Comments

@sebastiantf
Copy link
Collaborator

Description

The publicInputs input to the contract is taken as an array. But its not a homogenous array. The expected public inputs are: user leaf hash, MST root followed by root balances:

/**
* Verify the proof of user inclusion into the liabilities tree
* @param proof ZK proof
* @param publicInputs proof inputs
*/
function verifyInclusionProof(
bytes memory proof,
uint256[] memory publicInputs,
uint256 timestamp
) public view returns (bool) {

Since they are not homogenous or not values that have the same meaning, it might be better DX/UX to have them as separate meaningful inputs and combine them into an array within the function before submitting them to the verifier. eg. how the zkDrops contract does it: https://github.com/a16z/zkdrops/blob/a4e58bdad8391ffc133c3643c449be5d18b69832/zkdrops-contracts/contracts/PrivateAirdrop.sol#L42-L46
Screenshot 2024-02-27 at 12 22 25 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant