Signed Bytes All chapters

Chapter 04 · the stopwatch

They committed the price instead of revealing it. It took 0.66 seconds to read.

Primus attestations let you choose, field by field, what leaves the session. Reveal it, or commit to it with a hash. The attestation below is real, produced by the official zkTLS Playground, and one of its fields is committed rather than revealed. This page recovers it in front of you. The lesson is not that the hash is broken. It is that a hash hides exactly as much as the value had to begin with.

The committed field

OKX BTC-USDT ticker · production attestor

Three fields were resolved out of that response. Two were revealed as strings. The third was put through SHA256, which is how the attestation conditions describe it.

bidPx REVEAL_STRING 77530.4
askPx REVEAL_STRING 77530.5
last SHA256 66b5c5bf9da53fe8af459bbcac6bf05f7f8bafa749201d26bec7e8c17944556c
idle pick a search below
guesses0
elapsed0.00 s
rate—
value

Two ways to search. Blindly, as if you knew nothing but the shape of the number. Or using the two prices that were published beside it in the clear.

What else would fall

at 389,000 hashes per second

A commitment is only as private as the number of things the value could have been. The times below use the rate your own browser just measured, single threaded, in a tab.

the committed valuecandidatestime to recover

A price is public anyway, so committing it costs nothing. A balance, a score, a date of birth or a salary are the same shape of number and the same afternoon of work. The operation does not know the difference, and neither does the field name.

What a commitment needs

sixteen bytes

Hash the value together with a random salt, keep the salt, and publish it only when you reveal. The verifier can still check the commitment afterwards. The search space stops being the price and starts being the salt.

salt: —

One boundary worth stating plainly. I have not checked whether any Primus documentation promises confidentiality for this operation, and this page does not claim it does. What is shown here is mechanical: a hash from a real attestation, its preimage, and the time it took on an ordinary machine. Draw your own conclusion about which fields you would put through it.

The pattern is old and it is not specific to zkTLS. It is worth restating here because selective disclosure is exactly the feature that invites you to hide a number, and a number with a narrow range does not become secret by being hashed. If the value matters, salt it. If you cannot salt it, reveal it and accept that you did.