-
Notifications
You must be signed in to change notification settings - Fork 1
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
init default zkp packer #56
Conversation
packers/zkp.go
Outdated
@@ -237,3 +240,83 @@ func unmarshalPubSignals(obj circuits.PubSignalsUnmarshaller, pubSignals []strin | |||
func (p *ZKPPacker) MediaType() iden3comm.MediaType { | |||
return MediaTypeZKPMessage | |||
} | |||
|
|||
// DefaultZKPPakcerOption is a function that sets the default ZKP packer options | |||
type DefaultZKPPakcerOption func(*defaultZKPPacker) |
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.
Pakcer
packers/zkp.go
Outdated
return errors.Errorf("error getting global state info by state '%s': %v", | ||
globalState, err) | ||
} | ||
// if (big.NewInt(0)).Cmp(globalStateInfo.CreatedAtTimestamp) == 0 { |
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.
commented code
packers/zkp.go
Outdated
} | ||
|
||
// DefaultZKPPacker creates a default ZKP packer with the provided verification key and resolvers | ||
func DefaultZKPPacker(verificationKey []byte, resolvers map[int]eth.Resolver, opts ...DefaultZKPPakcerOption) *ZKPPacker { |
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.
why we have resolvers as option and as explicit parameter?
regarding that
|
This I like much more. And Iden3comm package in this case should extend go-circuits structure |
Next Steps for Improvement:
Default Function for Verification Setup:
ZkpPacker
with verification functionality. However, we face limitations when trying to create a default function for the proofing setup.Example:
Current implementation:
Proposed refactor:
Flexible Management of Default Packagers:
AuthV2Groth16
. Users may want to work with:Possible solutions:
Simple implementation (but risk of users using wrong packer for verification or proofing keys):
Mid-level complexity for developers, easier for users:
Both solutions are easy to extend. We just need to add new constructors for new authentication circuits, or even non-authentication circuits.