Last updated: 2026-03-07
TrustSignal already contains a Halo2 Rust crate under circuits/non_mem_gadget. The repo now has a real external Halo2 proof round-trip for a bootstrap attestation circuit, the public zkpAttestation path is explicitly dev-only by default, production fails closed unless an external prover is configured, and anchor provenance is bound to a deterministic subject digest. The immediate remaining priority is replacing the bootstrap attestation flow with a real, auditable document-hash proof pipeline before expanding Vanta or EVM anchoring claims.
- Halo2 circuit crate:
circuits/non_mem_gadget - TypeScript bridge to Rust verifier binary:
src/verifiers/halo2Bridge.ts - Combined verification flow for non-membership, revocation, and ZKML:
src/core/verifyBundle.ts - Vanta evidence endpoint:
GET /api/v1/integrations/vanta/verification/:receiptId
- The live attestation path defaults to
dev-only, but a real external prover backend now exists forbootstrap-attestation-v0. apps/api/src/server.tspersists dev-only attestations in non-production and only returnsproofVerified=truewhen a verifiable external backend is configured.apps/api/src/anchor.tsand the API response surface now bind anchoring to ananchorSubjectDigest; the remaining contract-side caveat is that Hardhat 3 validation requires Node 22+ even though the broader repo still runs under Node 18+.- The Halo2 crate now emits verifiable proof artifacts for
bootstrap-attestation-v0, but the original non-membership and revocation circuits still useMockProver. - The Halo2 crate uses a toy Merkle hash and synthetic witness derivation, so it is not yet suitable for adversarial or compliance-sensitive production use.
- A zero-trust external prover/verifier seam exists in
packages/core/src/zkp/index.tsand is now backed bycircuits/non_mem_gadget/src/bin/zkp_service.rs, but that binary currently proves only bootstrap public-input attestations.
- Document bytes and extracted document features
- Receipt IDs, bundle hashes, inputs commitments, revocation nullifiers
- API keys, JWT secrets, Polygon private keys, DB credentials
Authorization: Bearerfor TrustSignal/v1/*x-api-keyand scoped API access for/api/v1/*- Revocation signature headers for issuer-authorized revocation operations
zkpAttestationpersisted in receipts- Vanta verification payloads under
/api/v1/integrations/vanta/verification/:receiptId - Evidence artifacts and structured logs consumed by audit and SOC 2 workflows
Do not market the current bootstrap proof path as full document verification. First replace it with:
- Explicit proof status metadata that distinguishes
dev-only,verifiable-bootstrap, and the final document-hash proof. - A real proving/verifying pipeline for the document-hash statement, not only the bootstrap attestation circuit.
- Evidence payloads that only claim verifiable proof properties actually enforced by code.
- Mark the default attestation path as non-production in code and docs.
- Stop emitting proof scheme names that imply deployable cryptographic validity.
- Fix Vanta serialization so nested public inputs are mapped correctly and evidence can distinguish
mockfromverified. - Add regression tests that fail if mock proof code is used in production mode.
Goal: bootstrap an initial Halo2 circuit for document hashing without exposing PII.
Statement:
- Private witness: canonicalized document bytes or chunked field representation, plus a per-document blinding salt.
- Public inputs:
sha256_digestdocument_commitmentschema_version
- Constraints:
- recompute SHA-256 over the canonicalized document witness
- constrain
sha256_digestto the computed digest - constrain
document_commitment = Poseidon(sha256_digest, blinding_salt, schema_version_tag)
Security objective:
- External systems can verify that TrustSignal processed a specific canonical document and committed to it without learning the document contents or the blinding salt.
Non-goals for the first circuit:
- Full notary or registry validation inside the circuit
- OCR inside the circuit
- On-chain verification in the first milestone
- Any claim of HIPAA-grade handling beyond existing infrastructure controls
- Add a new Rust crate or module for the document-hash circuit instead of extending the bootstrap attestation or toy hash paths in place.
- Use standard primitives only:
- SHA-256 for canonical document digest
- Poseidon only where field-native commitments are needed
- Remove
DefaultHasher-based witness derivation from production proof paths. - Define stable witness serialization and canonical input encoding.
- Add setup/keygen commands for proving and verifying keys for the document-hash circuit.
- Emit proof artifacts plus explicit public input payloads.
- Add verification commands that validate those artifacts outside
MockProver. - Version proof formats and verification keys for auditability.
- Replace
generateComplianceProof()bootstrap logic with a prover client that invokes the real document-hash Rust proof pipeline. - Persist:
- proof scheme
- verification key ID
- public inputs
- proof artifact digest
- proof status
- Fail closed when proof generation or verification fails.
- Ensure logs contain request ID, action, target resource, and outcome without raw document data or PII.
- Define a Vanta-facing proof object that distinguishes:
schemestatuspublicInputsverificationKeyIdverifiedAt
- Export only commitments and proof metadata, never raw witness material.
- Add schema and integration tests for
/api/v1/integrations/vanta/verification/:receiptId.
- Anchor a versioned subject derived from
receiptHash + proofArtifact.digest + verificationKeyId, not raw document data. - Version the anchoring payload so verifiers can reconstruct exactly what was attested.
- Add chain-specific replay and nullifier handling tests before enabling production anchoring.
Status:
- Items 1 and 2 are partially implemented in the API and Solidity contract path via
anchorSubjectDigestandanchorSubjectVersion. - Item 3 remains open until the production prover backend exists and chain replay/nullifier tests are added.
- Replace mock attestation terminology and add
proofStatus. - Fix Vanta
conformanceextraction frompublicInputs. - Add tests proving production mode rejects mock proof generation.
- Scaffold a new document-hash circuit crate with:
- witness schema
- canonicalization interface
- SHA-256 gadget selection
- proof I/O format
cargo testin the Rust prover crate(s)- Proof round-trip test: prove then verify using serialized artifacts
- API tests covering successful and failed proof generation
- Vanta payload tests asserting proof metadata is complete and non-misleading
- No mock proof logic is used in production paths.
- A document-hash proof can be generated and verified from stable serialized artifacts.
- API receipts expose only commitments and proof metadata, not PII.
- Vanta payloads are accurate, machine-verifiable, and audit-friendly.
- Proof and verification failures are fail-closed and fully traceable in structured logs.