Merging two roots broke every proof
Documents that close on the same day get hashed and folded into a Merkle tree: one root that changes completely if a single byte in a single document changes. That's the root a client's own verification page checks a dragged-in file against.
The day also needs a root: a hash of the date, the previous day's seal and a public Bitcoin block hash. Editing a past day breaks every day after it. Although both roots are hashes, they serve different checks. The document root verifies files; the day root verifies history. Combining them in one field makes document and history proofs indistinguishable, leaving neither properly checked.
We gave the document root and day root separate names, columns and functions. The verification page uses only the first. Two values can share a structure while serving different purposes. Name them distinctly before writing the first code that uses them. This bug does not crash the system; it silently checks documents against the wrong root.
Keeping witness keys non-extractable
A client asked: "if you run the server, why would anyone believe you didn't edit the sealed history yourself?" Our own signature could not resolve that concern. The party able to alter the data could also sign the altered version.
Each witness’s browser generates an ECDSA P-256 keypair with the private half marked non-extractable in WebCrypto. The browser can sign with it, but even the page that created it cannot export, copy or read it. The witness sees the date, document count and seal, never the documents. Their signature confirms the seal. Neither ra.studio’s server nor the witness can reproduce it later without the original browser session.
We chose P-256 over Ed25519 for browser coverage. P-256 is available in every browser’s WebCrypto implementation today. A cryptographically stronger curve is unusable if half the witnesses’ browsers cannot run it.
We first ruled out TOTP, the six-digit code used in two-factor login. It authenticates possession of a shared secret. The server holds that same secret and can produce a valid code itself, so it cannot serve as a witness. Witnessing requires proof that only the witness could have produced the signature. A shared secret cannot provide that non-repudiation.
Adding a public Bitcoin anchor
Initially, the day-chain was internally consistent but had no public anchor. ra.studio’s infrastructure could theoretically have rewritten it if nobody checked the history against an old export.
OpenTimestamps now periodically timestamps the chain’s current state into Bitcoin, without requiring a second blockchain. A Bitcoin block hash covers every preceding block, so one confirmed anchor fixes the network’s history to that point. Editing a past day would then require rewriting Bitcoin as well.
Security claims can fall out of step with a system, especially when its description has not been reviewed since the build. Checking the current implementation against the published copy is now a standing rule for this project.
The client’s requirement was met by a permissioned ledger with witnessed history. Its Merkle root stays separate from the chain root. Witness signatures cannot be produced by the server, and the public anchor works without continued trust in any party. It needed no public blockchain of its own, token or consensus algorithm.