itsgoin/crates/core/src
Scott Reimers c2f2203331 feat(fof-layer4): FoFKeyBurn primitive — in-place wrap_slot replacement
For leaked-V_me scenarios. The author re-seals a single slot under a
fresh V_me, invalidating the leaked key's access to this specific
post on the wire. Comments signed under the old pub_x at that slot
are NOT auto-deleted; pair with revoke_fof_commenter if comment
cleanup is desired.

Wire format (BlobHeaderDiffOp::FoFKeyBurn):
  post_id, slot_index, new_pub_x, new_wrap_slot, burned_at_ms,
  author_sig (64B ed25519 over canonical tuple).

fof.rs:
- sign_fof_key_burn / verify_fof_key_burn: canonical signing tuple
  includes post_id, slot_index_le, new_pub_x, prefilter+read+sign
  bytes from WrapSlot, burned_at_ms_le. Identical shape to access-
  grant but with slot_index instead of append.
- apply_fof_key_burn_locally: delegates to storage.replace_fof_slot.

storage.rs:
- replace_fof_slot(post_id, slot_index, new_pub_x, new_wrap_slot):
  mutates the stored post's fof_gating_json. Bounds-checks slot_index.
  Local-only; PostId unaffected.

connection.rs: receive arm. Verifies author_sig + applies.

node.rs:
- Node::key_burn_post_slot(post_id, slot_index, new_v_x): recovers
  CEK via find_unlock_for_post, generates fresh per-V_x keypair,
  seals new slot under new_v_x with the existing CEK +
  slot_binder_nonce. Signs + applies locally + propagates.

CEK is NOT rotated by this op — body remains encrypted under the
same CEK as before. Locally-cached plaintext on devices that
already-decrypted is unrecoverable by any wire mechanism (out of
scope per spec).

Test brings the total to 147:
- fof_key_burn_replaces_slot: Alice burns her slot from V_me_old to
  V_me_new; V_me_old no longer unlocks; V_me_new unlocks and yields
  the same CEK; pub_post_set updates to the new pub_x.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 16:20:26 -06:00
..
activity.rs ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
announcement.rs feat(fof-layer2): wire types — WrapSlot, FoFCommentGating, CommentPermission::FriendsOfFriends 2026-05-14 13:39:46 -04:00
blob.rs v0.3.6: Active CDN replication, device roles, budgets, tombstones, engagement fix, DOS hardening 2026-03-20 21:00:28 -04:00
connection.rs feat(fof-layer4): FoFKeyBurn primitive — in-place wrap_slot replacement 2026-05-14 16:20:26 -06:00
content.rs feat(fof-layer2): wire types — WrapSlot, FoFCommentGating, CommentPermission::FriendsOfFriends 2026-05-14 13:39:46 -04:00
control.rs feat(fof-layer2): wire types — WrapSlot, FoFCommentGating, CommentPermission::FriendsOfFriends 2026-05-14 13:39:46 -04:00
crypto.rs feat(fof-layer2): wrap-slot dual-derivation seal/open primitives 2026-05-13 07:16:42 -04:00
export.rs Phase 4 (0.6.3-beta): posting-key / network-key split (plumbing) 2026-04-21 22:38:12 -04:00
fof.rs feat(fof-layer4): FoFKeyBurn primitive — in-place wrap_slot replacement 2026-05-14 16:20:26 -06:00
group_key_distribution.rs feat(fof-layer2): wire types — WrapSlot, FoFCommentGating, CommentPermission::FriendsOfFriends 2026-05-14 13:39:46 -04:00
http.rs Phase 2d (0.6.1-beta): route manifest + blob ops through file_holders 2026-04-21 21:09:45 -04:00
identity.rs First-run chooser, node shutdown on switch, file picker, export path fix 2026-04-06 01:58:02 -04:00
import.rs feat(fof-layer3): PostVisibility::FoFClosed + body crypto + bucket padding 2026-05-14 16:22:46 -04:00
lib.rs feat(fof-layer2): author publish-side build_fof_comment_gating 2026-05-14 13:50:56 -04:00
network.rs feat(fof-layer3): PostVisibility::FoFClosed + body crypto + bucket padding 2026-05-14 16:22:46 -04:00
node.rs feat(fof-layer4): FoFKeyBurn primitive — in-place wrap_slot replacement 2026-05-14 16:20:26 -06:00
profile.rs feat(fof-layer2): author publish-side build_fof_comment_gating 2026-05-14 13:50:56 -04:00
protocol.rs Phase 2g: GroupKeyDistribute \u2192 encrypted post 2026-04-22 23:09:19 -04:00
storage.rs feat(fof-layer4): FoFKeyBurn primitive — in-place wrap_slot replacement 2026-05-14 16:20:26 -06:00
stun.rs Our Info panel, hole punch race fix, NAT profiles in relay introduction 2026-04-05 17:57:41 -04:00
types.rs feat(fof-layer4): FoFKeyBurn primitive — in-place wrap_slot replacement 2026-05-14 16:20:26 -06:00
upnp.rs ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
web.rs Phase 2d (0.6.1-beta): route manifest + blob ops through file_holders 2026-04-21 21:09:45 -04:00