@revocable(n) pragma, where n denotes a positive integer indicating the depth of the sparse merkle tree used for managing revoked signatures. An SMT of depth n can accommodate 2^n signatures. Developers should determine an optimal value by estimating the maximum number of credentials an issuer might distribute for a given context or type. The range for the depth spans from a minimum of 2 to a maximum of 248.
A semi-formal definition in BFN is as following:
- Bool: Representing a boolean value, during proof generation, credential owners can choose to reveal or hide its value. This is due to its inherent limitation of equality check operation, which, when executed, inevitably discloses the value. For each bool-typed field, there will be one corresponding public signal in the proof, where
0means the value is hidden, and1means the value is false, and2means the value is true. - Property (string): Referred as “property type” in this document, this type is primarily designed for representing innumerable properties, such as “name”. However, issuers can apply this value to enumerations as well. Issuers can use this type to store a string value. Internally, the string value will be converted to a hash value. There are three type parameters:
- The
widthrepresents the width of the hash value. It must be byte-aligned and up to 248-bit; - The
hash_algorithmdesignates which hash is used to transform the string into a hash value. If the hash value exceeds the specifiedwidth, only thewidthleast significant bits will be used. The accepted values arep | k | c, wherepstands for poseidon hash,kfor keccak256, andcfor a user-defined hash algorithm. - The optional parameter
num_equals_to_checks, default to 1, specifies the number of values to be compared for one proof. There will benum_equals_to_checksoutput signals, where their least significant bit represents the equality, and the[width+1…1]bits convey the value that underwent comparison.
- The
- Scalars: Representing unsigned integers with bit-lengths spanning from 8 to 256, scalars are equipped to support range checks.
- Fixed-length array: This type encapsulates arrays of the previously mentioned types. Operations specific to the underlying type can be executed on either an individual element or the entire array, facilitated by the
one_ofandall_ofoperators. Note that theany_ofoperator is redundant, as during the proofing phase, the holder is aware of which element is the desired value.
While the protocol does not impose a restriction on the number of fields in the body part, the verification stack might set a limit due to its inherent constraints of circuit size. For example babyzk stack limits the number of claims by setting the limit of public inputs to 256, including intrinsic signals.