How the checks work
Everything this page checks can be repeated with any SHA-256 tool. This sets out exactly what is hashed at each step.
The basics
The record file is JSON. Every hash is SHA-256, written as 64 lower-case hexadecimal characters.
Canonical JSON means: object keys sorted by UTF-16 code unit, no spaces or line breaks, strings and numbers written as JavaScript's JSON.stringify writes them, and members with no value left out. This is the scheme in RFC 8785.
“‖” means the bytes are joined end to end. Text is UTF-8.
1. The record fingerprint
SHA-256 of the canonical JSON of manifest. It must equal manifestDigest, and the record fingerprint printed in the PDF.
2. Each conversation's bundle
SHA-256 of the canonical JSON of bundles[i].bundle. It must equal bundleDigest in the manifest selection with the same threadKey. Because the manifest holds it, step 1 covers every bundle.
3. Each message's fingerprint
Make this record from the message, leaving out anything absent: v, sourceRecordId, channel, timestamp, direction, sender, text; attachments, each as sha256, fileName, mimeType, sizeBytes, missing; flags, keeping only those that are true (edited, unsent, deletedForEveryone, recentlyDeleted, restricted, system, notSent); editHistory; reactions, each as sender and reaction (left out when there are none); links (left out when there are none); callDurationSeconds; call, as result, video (only when true) and service.
Bundle version 3: v is 2, and the fingerprint is SHA-256( “joliroTrace/message/v2|” ‖ the message's salt as 32 bytes ‖ canonical JSON of the record ). The salts are in the bundle's salts list, in the order of the context messages before, the messages in the chosen dates, then the context messages after.
Bundle versions 1 and 2: v is 1, and the fingerprint is SHA-256( canonical JSON of the record ).
Each message's fingerprint must equal c in the stub at its position, and its timestamp must equal t.
4. The Merkle root
The tree is laid out as in RFC 6962. The leaf for each stub is SHA-256( 0x00 ‖ canonical JSON of an object with the stub's p, t and c, and v as in step 3 ). A node is SHA-256( 0x01 ‖ left ‖ right ). A tree of n leaves splits at the largest power of two smaller than n. An empty tree's root is the SHA-256 of nothing.
The stubs cover the positions from proofRange.start up to proofRange.end. proof lists the hash of every largest subtree lying wholly outside those positions, left to right. To rebuild the root, walk the tree for n leaves: a subtree wholly outside the positions takes the next hash from proof, a single leaf inside them is its stub's leaf, and anything else is split and joined as a node. Every hash in proof must be used. The result must equal merkleRoot, and the manifest's merkleRoot for that conversation.
5. The thread commitment
SHA-256 of the canonical JSON of an object with threadKey, sourceKind, grade, n and merkleRoot, and v as in step 3. It must equal threadRoot in the bundle and in the manifest.
6. Nothing left out between the chosen dates
range.from and range.to are UTC times written as YYYY-MM-DDTHH:mm:ss.sssZ, and are compared with message timestamps as text. The messages at positions window.start up to window.end are inside the range. The stub just before window.start must be earlier than range.from, unless window.start is 0. The stub at window.end must be later than range.to, unless window.end is n. Stub positions must run on without a gap, and their times must never go backwards.
Versions 2 and 3 carry 10 messages either side for context: context.start is the larger of 0 and window.start minus 10, and context.end is the smaller of n and window.end plus 10. The proof covers one stub more on each side: proofRange.start is the larger of 0 and context.start minus 1, and proofRange.end is the smaller of n and context.end plus 1. Version 1 has no context, and its proof covers one stub either side of the window.
This relies on joliroKeep having put each conversation in time order when the record was saved. The order can be checked only for the stubs in the file.
7. The device commitment
The leaf is SHA-256( 0x00 ‖ canonical JSON of device.leaf ), where device.leaf has v, threadKey, sourceKind, grade, n, first, last, threadRoot and participants, and must describe the same conversation as the bundle. Rebuild the root of a tree of device.size leaves from that one leaf at position device.index and device.proof, as in step 4. It must equal manifest.deviceRoot, and device.size must equal manifest.deviceThreadCount. The tree holds every conversation read from the phone, chosen or not, sorted by threadKey.
8. Photos, videos and files
SHA-256 of a file's bytes must equal the sha256 of an attachment in a message, or of an entry in manifest.images. The MD5 values in files were worked out when each file reached joliroKeep. They are there for convenience, and the record fingerprint does not cover them.
Not covered by the record fingerprint
exportedAt, sealedAt, anchor, provenance, coverage, files, howToVerify and each bundle's digest field are there to help a reader. Nothing above relies on them.
This page runs in your browser, and what you open here stays on your device. Its security policy blocks it from making network connections or sending forms.
