Optional
getIntended for use by Zupass. Given a PCD, returns some information about how this PCD should be displayed to the user within Zupass app.
Optional
getGiven the arguments passed into PCDPackage#prove, returns options on how to render the Prove Screen for this PCDPackage.
Optional
initInitializes this PCDPackage so that it can be used in the current context. This is an optional field, because not all packages need to be initialized.
The unique name identifying the type of PCD this package encapsulates.
Sibling method to PCDPackage.serialize - converts SerializedPCD.pcd back into an instance of this package's PCD type.
Serializes an instance of this package's PCD so that it can be stored on disk or sent over a network.
More concretely, this function returns a promise of SerializedPCD<PCD<C, P>>
and PCDPackage.deserialize takes SerializedPCD<PCD<C, P>>.pcd
as a parameter
and returns an instance of PCD<C, P>.
This function lets consumers of the PCD encapsulated by this PCDPackage verify whether the PCD's PCD#claim corresponds correctly to its PCD#proof.
Generated using TypeDoc
Each type of PCD has a corresponding PCDPackage. The PCDPackage of a PCD type defines the code necessary to derive meaning from and operate on the data within a PCD.
Type Param
C the type of PCD.claim for the PCD encapsulated by this PCDPackage
Type Param
P the type of PCD.proof for the PCD encapsulated by this PCDPackage
Type Param
A - the type of the arguments passed into PCDPackage#prove to instantiate a new PCD. It is important that A can be serialized and deserialized using {@code JSON.stringify} {@code JSON.parse}, because these arguments should be able to be passed over the wire trivially. This may cause the type of A to be less convenient that desired. Eg. you may have to pass {@code BigInt}s in as strings, etc. Another important note about A is that each of its fields must implement the Argument interface. This is important because it enables Zupass to introspect the arguments, and to implement useful features like the {@code GenericProveScreen}, which is a screen that automatically builds a UI which lets a user input all the arguments required to instantiate a new instance of a particular PCD based on the request it gets from a third party.
Typeparam
I the type of the arguments passed into PCDPackage#init, if the init function is present to instantiate a new PCD