prepare_document_proof
Generate canonical hash, Merkle content root, and per-field inclusion paths for a document, enabling field-level zero-knowledge proofs on the Midnight attestation layer.
Instructions
Turn a structured document into everything the proof tools need: canonical JSON and its payloadHash (what anchor_document anchors), a Merkle contentRoot over an ORDERED list of up to 16 proof fields, and per-field inclusion paths ready for prove_field_predicate. Keep the field order stable across anchor and proof: it is part of the tree identity. Compute-only and synchronous, nothing is stored server-side. The returned fields carry witness material (scaled values): treat as sensitive. Store canonicalDocument at your storageRef; re-serializing with different key order will not re-hash equal.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document | Yes | The full document as a JSON object; all of it goes into payloadHash | |
| proofFields | Yes | ORDERED list of fields to make provable (leaf index = position) | |
| compiledArtifactRef | No | Contract artifact ref, defaults to 'attestation-vault' |