anchor_document
Anchor a document's content hash to the Midnight blockchain, committing only sha256 and public metadata. Returns a job ID for async tracking and a document ID for later verification.
Instructions
Anchor a document content hash on the Midnight chain via the AttestationVault attest circuit. Commits only the sha256 + public metadata; you are responsible for storing the actual bytes at storageRef. Attestation is first-come-first-served per hash. Async: returns { jobId, status } immediately; poll get_job_status until succeeded or failed. Also returns documentId for verify_document.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Content size in bytes, informational | |
| sha256 | Yes | sha256 of the document content (64 hex), becomes the on-chain payload hash | |
| metadata | No | Public metadata object; its hash is anchored alongside | |
| sessionId | Yes | Wallet session id that signs and submits | |
| storageRef | Yes | Where the bytes live, e.g. file://, s3://, ipfs:// | |
| contentType | No | MIME type, informational | |
| idempotencyKey | No | Dedupes retries of the same anchor request | |
| contractAddress | Yes | AttestationVault deployment to anchor into | |
| sponsorSessionId | No | Optional second session that pays the dust fee | |
| compiledArtifactRef | No | Contract artifact ref, defaults to 'attestation-vault' |