Skip to main content

Predicates Reference

Signature Predicates

+signed_by(/path/to/identity.id)
// Commit must be signed by this ed25519 key

+threshold(/signers/list, n, m)
// n-of-m signatures from the list required

+signed_by_n(/signers/list, n)
// At least n signatures from the list

Oracle Predicates

+oracle_attests(/oracle.id, "condition")
// Oracle attests to a condition

+oracle_attests_fresh(/oracle.id, "condition", max_age_seconds)
// Oracle attestation within time limit

Time Predicates

+before(/deadlines/cutoff.datetime)
// Current time is before deadline

+after(/deadlines/start.datetime)
// Current time is after start time

Comparison Predicates

// Numeric comparisons
+num_eq(/path/a.num, /path/b.num) // a == b
+num_gt(/path/a.num, /path/b.num) // a > b
+num_gte(/path/a.num, /path/b.num) // a >= b
+num_lt(/path/a.num, /path/b.num) // a < b
+num_lte(/path/a.num, /path/b.num) // a <= b

// Text comparisons
+text_eq(/path/a.text, /path/b.text)
+text_contains(/path/a.text, "substring")

// Boolean
+bool_true(/path/flag.bool)
+bool_false(/path/flag.bool)

Hash Predicates

+hash_matches(/commitments/secret.hash, /revealed/value.text)
// SHA256 of revealed value matches stored hash

Custom WASM Predicates

+wasm(/predicates/my_predicate.wasm, arg1, arg2)
// Call custom WASM predicate with arguments