0.6: owners keep their place in line#
Status: design for version 0.6, revised after an independent security review of the design and another of the code. Parts marked "0.7" are described so that the formats do not change later.
An owner should not depend on one registry to prove that they were first. In 0.6 the proof travels with the owner. A stamp can leave a registry with everything needed to show when it was logged. Another registry checks that proof by rule. Where the proof meets a conflict, a person decides with the proof in hand.
1. What "first" means#
Clocks can be wrong, and a registry could lie about its own clock. So "first" is defined by order in a log, and by clocks that the registry does not control.
Within one registry. An entry's place in line is its position in that registry's log. A lower position is first. The time written in the entry plays no part.
Across registries. A registry's own witnesses do not give an independent clock. A witness chooses the time it signs, and a registry may run its own witnesses, as Grantstamp does today. So across registries, an entry's time is bounded only by parties the other registry trusts:
- from above, by the first Bitcoin block that commits to an anchored checkpoint containing the entry
- from below, by the last Bitcoin block that commits to an anchored checkpoint without it.
Entry A is first over entry B when A's upper bound comes before B's lower bound. When the windows overlap, a case decides.
In 0.6 these bounds are recorded and carried with every stamp that moves, but registries do not yet order stamps by them. A conflict across registries goes to a case. Ordering by Bitcoin, checked by the registry itself, comes in 0.7.
When a stamp moves. Its record keeps where and when it was first logged. In 0.6 a stamp moves once: a stamp that was moved cannot move again with its first place in line.
2. An anchor every hour#
The project's cosign job runs every 30 minutes. Once an hour, if the log has grown since the last anchor, it saves the newest cosigned checkpoint as <size>.checkpoint, timestamps it with OpenTimestamps, and lists it in index.json. It also upgrades the timestamps still pending. The files live on the anchors branch and are copied to https://grantstamp.io/registry/anchors/.
- A checkpoint is kept even when the timestamp calendars cannot be reached. The next pass stamps it.
- A checkpoint with the same size as an anchor but a different root is a fork. The job refuses it and fails loudly.
- An anchor bounds an entry to about an hour, plus the time Bitcoin takes to confirm.
grantstamp audit --anchors checks every anchor against the current log and reports which ones Bitcoin has confirmed. ots verify checks a block.
3. Export#
grantstamp owner export writes one JSON file:
- the registry, its log policy and its keys
- the owner's identity attestation (section 5)
- for each stamp: its proof, and for each upload (the registration and each later batch of files) the log entry, its opening, the owner's signed claim, the earliest anchored checkpoint containing it with its inclusion proof and OpenTimestamps proof, and the upload exactly as it was sent, when the client kept it.
From 0.6 the owner's register and files claims also sign sent, the digest of each upload as sent. The client keeps every upload in ~/.grantstamp/bundles/. A stamp registered before 0.6, or with no owner claim, cannot move with its place in line.
4. Moving a stamp#
Two registries are involved: the origin and the destination. The destination lists the origin as a peer, with its address, log policy and signing keys pinned by its operator.
A move ticket from the origin. grantstamp owner move --to URL asks the origin for a ticket (typ: grantstamp-move+jws), signed with the origin's registry key. It names the owner's key, the destination, and each stamp with its policy and listing as they are now. The origin issues it only when the key is current, while no proven recovery of the owner's key waits to take effect, and not for 7 days after the current key cancels a proven recovery, since a thief holding the key could cancel it. Each stamp must be active, not part of a case an arbiter is acting on, and not itself moved in. A case nobody has reviewed yet, or a recovery merely requested, blocks nothing: anyone can open one. The ticket names such cases, and the destination keeps them with the stamp. A ticket lasts an hour. So once an owner's recovery is proven, a stolen key cannot carry their stamps away before the operator can look, and a stamp the origin suspends can leave only on a ticket issued in the hour before.
The import. POST /v1/stamps/import, signed with the same key, carries the ticket and one stamp from the export. The destination checks:
- the ticket: signed by a listed peer and naming it as the issuer, current and lasting at most an hour, naming this registry, this key and this stamp
- each upload: its entry, rebuilt from its opening, is in the anchored checkpoint, which carries the peer's log signature and its witness quorum. Each upload is a separate entry, in log order
- the claims: signed by the owner's own keys at the destination, never by keys the peer names, and naming the files and the digest of the upload as sent, which must match the upload in the request
- that this origin stamp was never imported here before, keyed by the peer's log and not its address
- the owner's later policy and listing claims: signed by the same keys, and ending where the ticket says the stamp is now.
Then the content is checked against the destination's stamps, as in a registration.
- With no conflict, the stamp is stored as it is now, with its origin: the registry, the entry's position and hash, when the witnesses cosigned it, and whether an anchor came with it. Each later upload keeps its own position and time. Its log entry names the origin. The destination does not check the OpenTimestamps proof in 0.6, so it records no block number.
The owner's own keys at the destination are the ones that count: the current ones, and ones the destination itself saw replaced. A peer's word is never enough, or a peer could give an owner's stamp to another account. So a stamp signed with a key the owner has since replaced moves only to a registry that knew that key as the owner's. - With a conflict, the import is refused with a signed refusal, and a case is opened against the conflicting stamp with the verified proof attached. The case names the uploads that hold the matching files, and when their witnesses vouched for them. An arbiter decides.
5. Identity that travels#
A registry signs what it checked about an owner (typ: grantstamp-identity+jws): the owner's key, the identity level, the name only where the name itself was checked, and an expiry 90 days later. It never includes a LinkedIn name, subject or profile. It does not attest identities that came from another registry.
Another registry accepts it when a listed peer signed it, for a key the owner holds there, before it expires. It is shown as "attested by" that peer, it stops counting when it expires, and it never counts as proof of being a publisher.
6. Case decisions signed by an arbiter, and appeals#
Arbiters keep their keys on their own machines. The registry holds their public keys, lists them in its descriptor, and logs the list whenever it changes.
- Every notice and decision is a statement signed by an arbiter (
typ: grantstamp-decision+jws). It names the registry, the case, the stamp, and the stage of the case it answers. It is refused if the case has moved on, if it is more than a day old, or if it was used before. - The registry stores each statement with the case and logs its digest. A stamp suspended or restored because of a case cites the statement in the log.
- When arbiters are listed, the operator's direct commands refuse to notice or decide a case. The operator keeps other powers, listed in GOVERNANCE.md. Each use is logged, so a suspension without a case is visible.
- The side that lost can appeal once within 30 days. The decision stays in effect meanwhile. While a case is not final, a stamp it suspended still blocks conflicting registrations, so that a won appeal does not meet a newcomer. Where more than one arbiter is listed, another arbiter decides the appeal. Its decision is final.
Today there is one arbiter, the maintainer. The case record says so.
7. What the reviews of the code changed#
Three independent reviews checked the code before release. The first made twenty findings, from security problems to missing tests. The second checked those fixes and found four more problems, one of them serious. The third found two more bugs and some smaller points. All of them are fixed and tested, except one change that older clients notice, which the changelog describes. The main ones:
- A moved stamp took the policy it was registered with, not the one its owner set later. The ticket now binds the policy as it is now, and the owner's later claims travel with the stamp.
- The block number of an anchor was taken from the request and quoted in the case. The destination now says only what it checked, and for which upload.
- A statement could be spelt in more than one way, and so used twice. A token now has one spelling, its use is keyed by what was signed, and it is used in the same step that applies it.
- The side that won a case could use up the loser's appeal. Now only the side that lost appeals.
- An identity attested by a peer read like one this registry checked. It now has a level and wording of its own.
- A stamp held by more than one case looked at only one of them. Every case now counts. A case restores only a stamp a case suspended, never one its owner withdrew or the operator suspended. Stamps suspended before 0.6 are marked as held by their case when the registry upgrades.
- The first fix for stamps signed before a key recovery let the destination take the peer's word for the owner's old keys. The second review showed that a peer could then give an owner's stamp to another account. Now only the owner's keys at the destination count.
- The first fix also stopped a move while any case was open or any recovery requested. Since anyone can open one, that let anyone hold an owner's stamps in place. Now only a case an arbiter is acting on, or a proven recovery, stops a move. A proven recovery that the current key cancels stops moves for 7 days, since that key may be a thief's.
- The jobs that hold a key, a token or a publishing credential installed tools unpinned. They now install only tools pinned by hash, and only the steps that push get the token. The release builds in a job with no credential.
Two smaller points wait for a later version: the registry's container image installs its dependencies unpinned, and the website's build job holds more permissions than it needs.
8. Outside 0.6#
- Moving a stamp signed with a key the owner has since replaced to a registry that never knew that key: it needs proof the destination can check itself (0.7).
- Ordering across registries by Bitcoin anchors, checked by the registry itself (0.7).
- Registries that read each other's logs and refuse conflicts with all of them (0.7).
- Moving a stamp more than once with its first place in line.
- Keeping the first cosignature of every checkpoint, for finer witness times.
Source of this page on GitHub. Documentation for Grantstamp 0.6, licensed CC BY 4.0.