Skip to Content
ResourcesVerification

Verification

A proof is only worth what its verification proves. Sarek verifies in layers, each answering one question, each trusting less than the previous one.

Five layers of verification

LayerQuestion it answersRequires
1Is the data unchanged? (sha3_256(data) matches the proof)The original data
2Does the proof itself hold together?Just the proof
3Was the batch anchored at the recorded time?Just the proof
4Can the record be confirmed independently on the public ledger?Just the proof
5Did a specific registered agent sign this?The signature

valid is true when layers 1 to 3 pass (layer 1 only runs if you attach the data). Layer 4 is reported separately as onChainLeaf: it queries public infrastructure that can briefly lag right after anchoring, so it is retried with backoff and never gates valid. Layer 5 is a separate signature check, see identity in Core Concepts.

Verifying with the SDK

const partial = await sarek.verify(proof.ldgp) const full = await sarek.verify(proof.ldgp, 'loan #4821 approved, rate 4.1%') const bad = await sarek.verify(proof.ldgp, 'loan #4821 approved, rate 9.9%')

Argument order does not matter: the SDKs recognize the proof by its TERHUA prefix.

Verifying with the CLI

The CLI suits the receiving side of a proof: an auditor or counterparty who got a .ldgp file and a document and has no code in place.

sarek verify proof.ldgp report.pdf
Verifying... Data unchanged... ok Proof is valid... ok Integrity proven... ok block 10789522 Independently verifiable... ok Status: Full match - all layers verified

Exit code 0 on success, 1 on failure, so verification drops into CI and scripts without parsing output.

Tampering is loud

Change one byte of the proof, or one character of the data, and verification fails at the corresponding layer:

sarek verify tampered.ldgp
Verifying... Data unchanged... skip - no raw data attached Proof is valid... FAILED Invalid Proof has been tampered with

There is no partial credit: a proof either verifies or it does not, and the output tells you exactly which question failed.

Last updated on