Skip to content

Timestamp a file

This workflow hashes a file locally, submits the 64-character hexadecimal SHA-256 digest, and polls the resulting job. Witness does not upload the file through this command.

Submit the file

With a built witness binary or through Cargo:

cargo run -p witness-cli -- attest --file document.pdf --save attestation-job.json

The first response may be pending or retryable. The command prints the hash; save it for polling. A confirmed job contains the signed attestation.

Poll and verify

Set HASH to the printed digest. Repeat status until the job is confirmed, then save a new snapshot and verify it:

witness status "$HASH"
witness attest --hash "$HASH" --save confirmed-job.json
witness verify confirmed-job.json --network-config pinned-network.json --data document.pdf
# A standalone signed object is accepted too:
jq '.signed_attestation' confirmed-job.json > signed-attestation.json
witness verify signed-attestation.json --network-config pinned-network.json --data document.pdf

Obtain pinned-network.json independently of the gateway. --data checks that the receipt covers your file. Verification runs locally and rejects unconfirmed jobs. It reports the "existed no later than" bound on success and exits nonzero on failure. If you also need a log proof, see Verify a proof.

Caveats

  • A hash of public or predictable content can be guessed. Hash-only submission is not unconditional confidentiality.
  • Gateway, proxy, and network operators can still observe transport metadata.
  • A valid receipt does not prove authorship, ownership, or content truth. Its time bound assumes an honest signer with an accurate clock.
  • Witness is pre-1.0, unaudited, and not Byzantine-fault-tolerant.