This document details the production deployment, security architecture, and protocol features of the qr_verifier.aleo smart contract on the Aleo blockchain.
- Program Name:
qr_verifier.aleo - Transaction ID:
at1lvgmm5dwwx6kucvdq4v0zycyp2rv8njuss2z97xazqr9yfsa3ugsw0jyvm - Network: Aleo Testnet
- Deployment Fee: 4.22 credits
- Admin Address:
aleo1cmay45pre5evtl72vj8zma9ayj0u2xrdkdv86w2zyz7pnmg7svxq0dzr9c
The qr_verifier.aleo protocol was refactored and secured to resolve several architectural issues:
-
Verification Proof Overwrite Protection (Security Fix):
- Vulnerability: The original design allowed any verifier to overwrite an existing verification proof using the same
proof_id. This could lead to history tampering or "proof hijacking." - Fix: Implemented a strict existence check in the
finalize_verify_qrblock:This ensures that once a verification is recorded, it is immutable and cannot be overwritten.assert(!Mapping::contains(verification_proofs, proof_id));
- Vulnerability: The original design allowed any verifier to overwrite an existing verification proof using the same
-
Identifier Normalization:
- Fix: Shortened transition and finalize identifiers (e.g.,
increment_count) to comply with Aleo's 31-byte limit, ensuring successful compilation and deployment.
- Fix: Shortened transition and finalize identifiers (e.g.,
-
Reserved Keyword Resolution:
- Fix: Renamed the internal
recordvariable tonew_recordto avoid collision with the Leo reserved keywordrecord.
- Fix: Renamed the internal
- Purpose: Records a successful QR credential verification on the blockchain.
- Inputs:
commitment_hash: (field) The hash of the credential being verified.proof_id: (field) A unique identifier for this specific verification instance.
- Data: Stores the verifier's address, block height, and validity status.
- Purpose: Tracks the total number of times a specific credential has been verified.
- Data: Maintains a public mapping of
commitment_hash => count.
Deployed and Secured by Jules, Automated Aleo Software Engineer.