-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat/add proof soulbound nft #2
base: feat/refactor
Are you sure you want to change the base?
Conversation
contracts/src/ZKEmailProof.sol
Outdated
) public { | ||
// Owner should be committed to in each proof. This prevents | ||
// frontrunning safeMint with a valid proof but malicious "to" address | ||
if (address(uint160(proof[0])) != to) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't sure on correct format here @Bisht13 - would the address be in the proof like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be publicOutputs[1]
contracts/src/ZKEmailProof.sol
Outdated
uint256 blueprintId; | ||
uint256[] proof; | ||
address verifier; | ||
string publicOutputs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't sure on correct format here and ran out of time. Perhaps this would be an array of key value strings or similar and then we could add them to the metadata in the same way that proofJson
is added in tokenURI()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proof is going to be [uint[2], uint[2][2], uint[2]] always, publicOutputs is going to be uint256[], then we also need a decoded public output field which would be included in the token uri
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO notes
- Use
[uint[2], uint[2][2], uint[2]]
for proof - Loop over public (
uint256[]
) outputs the same way the proof currently works - Add decoded public outputs which should be flattened json
Didn't have time to add a fleshed out test with a detailed flattened json. But @Bisht13 was envisioning something like this - wdyt? unflattened:
flattened:
|
So the unflattened JSON would always be like
Thus, the flattened JSON would never need a |
- Specify correct proof type - Loop over publicOutputs - Add decodedPublicOutputs - Split logic into separate functions to avoid stack too deep
715bad3
to
af6592a
Compare
@Bisht13 there are a few different ways we could do flattened json. The reason I am skeptical of the approach you outlined is we loose information. In this case, If nested json structures are not expected, then your solution makes sense. |
Adds soulbound NFT representing a valid ZK Email proof
tokenURI
,safeMint
andsafeTransferFrom