Expand description
§QSSM Truth Engine — Layer 6 (Façade)
The single entry point for the entire truth engine. Developers only import this crate. Everything else is internal.
§Five functions, one byte array — that’s it.
| Function | Role |
|---|---|
compile | Resolves a built-in template ID or raw template JSON into an opaque byte-array blueprint. |
commit | Locks a secret without revealing it — returns 32 bytes. |
prove | Creates a ZK proof (byte array) that a secret satisfies the blueprint’s rules. |
verify | Checks a proof byte array against a blueprint — returns true / false. |
open | Returns the commitment bytes for a (secret, salt) pair; compare with commit output. |
§Quick start
use qssm_api::{compile, commit, prove, verify, open};
let blueprint = compile("age-gate-21").unwrap();
let commitment = commit(b"my-secret", &[1u8; 32]);
let claim = br#"{"claim":{"age_years":25}}"#;
let proof = prove(claim, &[1u8; 32], &blueprint).unwrap();
assert!(verify(&proof, &blueprint));
assert_eq!(open(b"my-secret", &[1u8; 32]), commitment);Functions§
- commit
- The Envelope. Locks a secret without revealing it.
- compile
- The Blueprint. Resolves a built-in template ID or raw template JSON and harvests entropy to produce an opaque byte-array blueprint.
- open
- The Simple Reveal. Reconstructs the commitment from
(secret, salt). - prove
- The Proof Generator. Creates a ZK proof (byte array) that the secret satisfies the blueprint’s rules.
- verify
- The Truth Checker. Validates a proof byte array against a blueprint.