A Public VC is essentially a fully publicly available VCs that do not contain significant private data, typically used for the registration of public entity identities. For instance, our ValidID platform. Public VC contains the attester's attestation signature.

Rationale for Introducing Public VC

Public Verifiable Credentials (VCs) are introduced to streamline the VC structure by removing redundant data, thus reducing data size and saving gas fees in situations where VCs are used publicly, such as on the validID platform. Additionally, Public VC aims to standardize the hashing method to Ethereum's keccak256 to ensure consistency and interoperability.

Structure and Use of Public VC

Public VC generally contains public information required for identity registration. The user provides certain information (like company name, address, website, and phone number) to an attester who constructs a MerkleTree from these data and generates a roothash. Notably, unlike regular VCs, Public VCs omit the nonce hashing step in their creation process, but retain the same DigestHash calculation method.

Adoption of MerkleTree in Public VC

Despite the possibility of directly signing a JSON combining the required information, the MerkleTree structure is favored for its ability to support selective disclosure in Verifiable Presentation (VP) scenarios, offering more flexibility and privacy control.

Basic Construction

Public VC does not change or add any data structures => Determine whether the VC is a Public VC via checking if the nonceMap is omitted. This is the only criterion to distinguish Public VC from general VC (Private VC).

MerkleTree Construction for Public VC

The procedure for building a Merkle Tree in a public VC mirrors that of a private VC. The key distinction is that, if the nonceMap is empty, the original data undergoes a keccak256 hash operation directly. Consequently, the Merkle Tree for a Public VC is constructed solely using the original data.

The dependency used for the MerkleTree construction is the same as private VC.

For more information, you may refer to the MerkleTree SDK