askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
danq9
signup: the person chooses the password and name on the confirm page
83c7aa6
2 weeks, 5 days ago
History
anchors.json · 5.6 KB · 40 lines
| 1 | { |
| 2 | "name": "anchors", |
| 3 | "title": "Ledger Anchors", |
| 4 | "version": 1, |
| 5 | "storage": "append", |
| 6 | "description": "One line saying what a ledger looked like at a moment: how many rows it held and what those rows hash to. THE ROW COUNT IS NOT DECORATION -- it names the prefix the digest covers, and verification is 'recompute over the same prefix', so a digest without its count is unverifiable. covered_fields is stored for the same reason and is the subtler of the two: verification reads THOSE fields out of today's rows rather than today's schema, because without that a schema gaining a column would change every historical digest at once and present as tampering, turning an ordinary migration into an integrity alarm and teaching an operator to ignore the alarm. What is hashed is the FOLDED LOGICAL ROWS, never the file bytes -- compaction rewrites an append log as routine maintenance, and a byte-level digest would report a break every time it ran. THE HONEST LIMIT, and it is the whole point of the notary_count field: an anchor stored in the same data directory as the ledger it describes is defeated by anybody who can edit both, which is everybody who could have edited the ledger in the first place. A row with notary_count 0 is a bookkeeping entry, not evidence, and site_ledger_integrity says so in those words rather than showing a reassuring green tick. The value appears only when the digest has also been lodged somewhere the operator of this box does not control. notaries records where, so the claim an operator makes is checkable by whoever they make it to. Append storage and no update path: an anchor that can be rewritten after the fact is an anchor that says whatever the last person to touch it wanted it to say. Anchors accumulate into a LADDER -- a daily pass leaves one per collection per day at increasing row counts -- and object_ledger_head.locate walks that ladder to bracket a break between the newest anchor that still verifies and the oldest that does not, which with daily anchoring is a day-sized window on which rows were touched. One anchor can only say 'something in the first N rows changed'; naming the exact row needs a per-row hash, which is the in-storage chain this deliberately did not build.", |
| 7 | "fields": [ |
| 8 | {"name": "id"}, |
| 9 | {"name": "collection", "type": "text", "required": true, "label": "Ledger", |
| 10 | "help": "Which collection this anchor is over. Mixed into the digest's genesis value, so an anchor taken over wallet_entries cannot be checked against payments and come out clean."}, |
| 11 | {"name": "row_count", "type": "integer", "default": "0", "label": "Rows", |
| 12 | "help": "How many rows the digest covers, counted from the first. The prefix being named is what makes the digest checkable at all: verification recomputes over exactly this many rows of today's ledger."}, |
| 13 | {"name": "digest", "type": "text", "required": true, "label": "Digest", |
| 14 | "validation": {"max_length": 128}, |
| 15 | "help": "The head over that prefix. Computed as a chain fold -- each row's canonical form hashed onto the head before it -- so the value is identical to what an incremental in-storage chain would produce, and moving the computation into the append path later would not orphan a single anchor already published."}, |
| 16 | {"name": "algorithm", "type": "text", "default": "sha256", "label": "Algorithm"}, |
| 17 | {"name": "scheme", "type": "text", "default": "dbbasic-ledger-head-v1", |
| 18 | "label": "Scheme", |
| 19 | "help": "The canonical-form version. Versioned so that a future change to how a row is serialised produces a DIFFERENT digest rather than a silently incompatible one -- an anchor that verified under a scheme it was not computed with would be the worst bug this feature could have."}, |
| 20 | {"name": "covered_fields", "type": "text", "label": "Fields", |
| 21 | "help": "The field list, in order, that the digest was taken over. Verification uses THIS list and not today's schema, which is what lets a migration add a column without every historical anchor turning red."}, |
| 22 | {"name": "notaries", "type": "text", "label": "Lodged With", |
| 23 | "help": "The independent notaries that accepted this digest, comma separated. Empty means nobody outside this server holds it -- see notary_count."}, |
| 24 | {"name": "notary_count", "type": "integer", "default": "0", |
| 25 | "label": "Independent Copies", |
| 26 | "help": "How many parties OTHER than this server hold this digest. THE FIELD THAT DECIDES WHETHER THE ROW IS EVIDENCE. Zero means it is a bookkeeping entry: anybody who can rewrite the ledger can rewrite this row beside it. One means tampering requires two systems. Several, at unrelated operators, is the point at which the claim gets hard to argue with."}, |
| 27 | {"name": "status", "type": "enum", "default": "recorded", "label": "Status", |
| 28 | "enum": ["recorded", "published", "partial", "failed"], |
| 29 | "help": "recorded = computed and stored here only. published = every configured notary accepted it. partial = some did. failed = none did, though the anchor itself is still recorded, because a digest nobody else holds is worth more than no digest at all."}, |
| 30 | {"name": "note", "type": "text", "label": "Note", |
| 31 | "help": "What happened, in a sentence -- which notary refused, what it said. The thing an operator reads when the status is not what they expected."}, |
| 32 | {"name": "created_at", "type": "datetime", "read_only": true, "label": "Taken"} |
| 33 | ], |
| 34 | "search": {"fields": ["collection", "digest"]}, |
| 35 | "forms": {"default": {"fields": ["collection", "row_count", "digest"]}}, |
| 36 | "views": {"list_mode": "table", |
| 37 | "list_fields": ["created_at", "collection", "row_count", "digest", |
| 38 | "notary_count", "status"], |
| 39 | "filter_fields": ["collection", "status"]} |
| 40 | } |