ARC-0102 zPass Model #84
biplavosti
started this conversation in
ARCs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
arc: 0102
title: zPass Model
authors: [email protected]
discussion: ARC-0102 zPass Model
topic: Application
status: Draft
created: 01-16-2025
Abstract
This proposal introduces a method to convert hierarchical data models into verifiable, issuable data structures leveraging Merkle trees. The approach ensures data integrity, privacy, and selective disclosure for both onchain and offchain usages. By assigning unique identifiers to data elements, hashing key-value pairs, and integrating salted values, this creates a robust data certification mechanism. Verification mechanisms enable efficient proofs for individual data points while maintaining privacy and security.
Blockchain applications often require verifiable data representations for use cases like identity verification, certificate issuance, or auditability. This proposal addresses challenges such as brute force attacks on exposed data, privacy in onchain sharing, and efficient verification by:
Specification
Aleo record
Functions
sig
is the issuer signature on thehash
of the Certificate model illustrated below.Certificate Model
Certificate Hash Calculation
Flatten hierarchical data into normalized key-value pairs.
Normalized key-value pairs:
Hash each normalized key to create unique identifiers for corresponding values. These identifiers are public data for a specific certificate model from an issuer.
Salted Values
To prevent brute force attacks, concatenate a salt with the value before hashing:
Key identifiers and values are combined and hashed to create leaf hashes:
The leaves are sorted and hashed to compute the certificate hash:
Verifier
Verification involves proving the validity of a data point using the Merkle proof:
User Interaction
Applications requiring value inclusion check request the user for the merkle proof on a value of a key identifier with a parameter: Key Identifier.
User responds with the salt, value and the merkle proof.
The Verification logic looks as below:
Applications requiring key inclusion check request the user for merkle proof of a Key Identifier.
User responds with the hash of corresponding salt + value and merkle proof without exposing the salt nor the value.
The verification logic looks as below:
Aleo Compatible Data Conversion
If the data is a string, first apply encodeToF(data) to convert it to a field type
Aleo compatible Operations
Verification
Offchain Selective Disclosure
When revealing specific data points for offchain usages, use a private section to store hashes of shielded leaves.
Certificate Hash
Combine hashes from the Private section with revealed data and compute the Merkle root
Metadata
Incorporate
metadata
for additional offchain data.Notes
type
,private
andmetadata
are reserved keywords and[]
is a special symbol appended to the key containing an array value.private
andmetadata
are not included in the certificate hash issued onchain and are for offchain uses only.space (0x20)
. So, the salt should not contain a space in itself.SHA-256
hashing algorithm is used for all purposes.Test Cases
encodeToF Implementation
Certificate Sample
Normalized Certificate
Calculate Key Identifier
Calculate Leaves
Merkle tree and Root Calculation
Verify dob
Reference Implementations
Dependencies
Backwards Compatibility
Not necessary.
Security & Compliance
References
Beta Was this translation helpful? Give feedback.
All reactions