Predicate types
OpenAC’s Show circuit consumes numeric-coded comparisons. Operators in the SDK:
export const PredicateOp = {
LE: 0,
GE: 1,
EQ: 2,
} as const;
Age ≥ threshold
Encode age or birthdate claims as integers in the normalized claim vector (wallet responsibility), then use PredicateOp.GE / LE against a constant threshold. The SDK README uses 890615n-style integers as an example normalization.
Nationality / discrete string claims
String claims are hashed / packed for the circuit via the Prepare path’s normalization; at Show time you compare already normalized field elements with PredicateOp.EQ against a public constant encoding of the allowed value, or combine multiple EQ predicates with OR for set membership (composing predicates).
Range proofs
Express low ≤ x ≤ high as two predicates GE + LE with postfix P0 P1 AND — see the worked pattern in generalized-predicates/README.md.
Set membership / non-membership
- Membership: disjunction of equalities (
P0 OR P1 OR P2). - Non-membership: conjunction of negated equalities (
NOT+ANDin postfix).
Intra-credential comparisons (roadmap)
The design document at generalized-predicates/README.md describes predicates whose right-hand side is a reference to another claim index (the circuit signal predicateRhsIsRef[i] = 1, predicateRhsValues[i] = j). The Circom Show template already implements this: see predicateRhsIsRef / predicateRhsValues in show.circom and eval-predicates.circom.
The SDK builder does not yet emit these fields. PredicateSpec is currently { claimRef, op, compareValue } (show-input-builder.ts) and compareValue is always a public scalar. Putting another claim's normalized value into compareValue would publish that value in predicateCompareValues, defeating the privacy property. Until PredicateSpec gains an rhs: { kind: 'literal', value } | { kind: 'claimRef', index } variant and buildShowCircuitInputs emits predicateRhsIsRef / predicateRhsValues, treat intra-credential comparisons as circuit-level only and reach them by writing custom Show witnesses against the Rust CLI.
Track on the zkID 2026 roadmap.
Limits
ShowCircuitParams (maxPredicates, maxLogicTokens, nClaims, valueBits) constrain proofs — defaults in types.ts (DEFAULT_SHOW_PARAMS).