Skip to main content

Writing predicates

Circom level

  1. Locate predicate components under wallet-unit-poc/circom/circuits/components/ (e.g. eval-predicates.circom).
  2. Recompile the show circuit after changes: yarn compile:show from wallet-unit-poc/circom/.
  3. Regenerate witness C++ artifacts copied into build/cpp/ (handled by scripts/compile.sh) so ecdsa-spartan2 links the updated witness generator.

SDK level

  1. Extend normalization if new claim types need packing — today’s path centers on buildJwtCircuitInputs / claim extraction (wallet-unit-poc/openac-sdk/src/inputs/jwt-input-builder.ts).
  2. Map verifier policies to PredicateSpec[] + postfix tokens consumed by buildShowCircuitInputs.
  3. Update Vitest fixtures under wallet-unit-poc/openac-sdk/tests/ to lock behavior.

Parameter bumps

If you need more predicates or longer postfix programs, raise maxPredicates / maxLogicTokens in ShowCircuitParams and recompile Show with matching template parameters (circuits/show.circom / circomkit config).

Paper alignment

When you add a genuinely new relation (not just a policy instance), update the security story and section references (Paper).