smart-byte: envelope wire format, v1 key-event logs, and their conformance vectors #125
Loading…
Reference in a new issue
No description provided.
Delete branch "smart-byte-wire-format"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Builds on #99, which this branch includes. Review #99 first.
Before this PR, the conformance pack's envelope-shaped vectors described a draft shape that no longer existed. Nothing pinned key-event logs at all. This PR puts both on the v1 wire format, and fixes everything that building them turned up.
Spec
spec/envelope_wire_format.md(new):iwithd.n.Code
smart-byte-core:wire: canonical CBOR for any serde type.from_slicerefuses bytes that are not the decoded object's own encoding. Serde otherwise accepts an array of integers for a byte string, a byte string for text, and an array for a struct, each a second encoding the SAID does not cover.smart-byte-keri-witness:dip, which had skipped the pre-rotation check entirely, along with zero thresholds, duplicate keys, rotations after an emptyn, and extension members.Conformance pack (v1, DRAFT, regenerated in place)
kel_vectors.json(25 vectors): four accepted logs, and 21 refused for one defect each. The refusals cover takeovers, thresholds, log structure and decoding.envelope_vectors.json(18 vectors): three accepted bytes, including a chain of transfers spanning a rotation, and 15 refusals. They are checked against the key states the logs establish.verify_v1.pyreplays logs and verifies envelopes independently, written from the spec text, standard library only.Falsified
-O.cargo test --workspacepasses, as doesverify_v1.py(94 vectors, pack complete).Still open
How a node serializes its post-frame state hash is unpinned; the lockstep vectors treat state hashes as opaque.
🤖 Generated with Claude Code
smart-byte-core - `wire`: canonical CBOR for any serde type. `from_slice` refuses bytes that are not the decoded object's own encoding. Serde otherwise accepts an array of integers for a byte string, a byte string for text, and an array for a struct, each a second encoding the SAID does not cover. - Controller AIDs. Controller signatures are checked against the key states replayed logs establish. One strict Ed25519 rule. - The envelope: attested provenance, ownership chain and joule cost. Cargo carries a registered type tag. smart-byte-keri-witness - Events are §2 SAIDs over canonical CBOR. - The default verifier is spec v1. It replays one event at a time and says which event it refused. It refuses `dip`, which skipped the pre-rotation check entirely, plus zero thresholds, duplicate keys, rotations after an empty `n`, and extension members. - Extension mode, fixed: - Witness receipts carried their own key, so anyone could receipt in any witness's name. Witnesses are now named by their keys, and receipts sign everything they claim. - Duplicity evidence was gathered from unverified receipts. - Recovery accepted any keys; it now needs its witnesses' receipts. - OOBIs were signed by an embedded key; they are now controller signatures. - Configuration traits were never enforced, so they are gone. VC, BBS+, CRDT, mDL, lockstep, libp2p and the CLI move to the new envelope. smart-byte-conformance - kel_vectors.json: 25 vectors. - envelope_vectors.json: 18 vectors, checked against the logs' key states. - The SAID and signature vectors are rebuilt on the real objects, so all the files describe one set of parties. - Planted defects in every file are caught on their own vectors. Co-Authored-By: Claude Opus 5.5 <[email protected]>