zPass issuance program
The program above demonstrates an example implementation of a zPass issuance program. This program issues a private zPass
record to a user, which can be utilized in various scenarios, such as third-party applications that support this specific zPass program. The zPass
record is highly flexible and can contain any value type supported by Aleo, tailored to the needs of the integrating applications.
The Credentials
object is divided into private and public components, allowing the program to selectively disclose certain information publicly while keeping sensitive data private. This design provides flexibility, enabling verifiers to access publicly disclosed information without compromising the privacy of the user.
Additionally, the program introduces two extra mappings to enhance functionality and security. These mappings are used to track the issuance count and prevent the double issuance of the same zPass record.
Similar to the Verify offchain program, the issue
transition reconstructs the full credentials and verifies them against the issuer's signature to ensure authenticity. Once the verification is successful, the program issues a zPass record to the caller and stores the commitment of the credentials on-chain. To enhance security, salt is used to add randomness to the commitment, ensuring uniqueness and making it resistant to preimage attacks. This commitment serves as a safeguard to prevent double issuance, ensuring the integrity of the zPass issuance process.
Last updated