Skip to content

refactor: remove DBRW/C-DBRW entirely — Rust-owned device-birth binding#505

Open
cryptskii wants to merge 6 commits into
feat/secure-element-offline-bearer-attestationfrom
refactor/remove-dbrw-device-birth-binding
Open

refactor: remove DBRW/C-DBRW entirely — Rust-owned device-birth binding#505
cryptskii wants to merge 6 commits into
feat/secure-element-offline-bearer-attestationfrom
refactor/remove-dbrw-device-birth-binding

Conversation

@cryptskii

Copy link
Copy Markdown
Collaborator

Removes DBRW/C-DBRW from the protocol; the device binding is now the deterministic, Rust-owned device-birth attestation (AttA). Stacked on #493 (offline-bearer anchor) — merge that first; this PR's diff is the 6 device-birth commits only.

What

  • Phase 1 (b8f97f6, 1937c1d, d1f861f): delete C-DBRW/K_DBRW from core+SDK; install the deterministic device-birth binding AttA; unify AttA across both genesis sub-paths; reconcile Lean/TLA proof comments.
  • Rust owns device-birth (afb8dc8): rules.instructions.md makes Rust the sole crypto authority, so the SDK draws a 32B CSPRNG nonce, computes the commitment, folds it into AttA, persists only the commitment in the GenesisRecord, and re-derives AttA on finalize/restore (fail-closed on identity mismatch). No binding material crosses the wire. AntiCloneGate / SiliconFingerprint / the silicon NDK build path removed.
  • Runtime-protocol removal (3efa5f9): delete the orphaned Cdbrw* proto messages + Envelope payload fields (reserved), the dead clear_binding_key(), and the frontend SILICON/DBRW securing copy.
  • Total DBRW purge (f5ac40a): K_DBRW → AttA / k_dbrw → device_birth_att everywhere; remove the dead TAG_DBRW; align the TLA/Lean formal models. dbrw_summary_hash is renamed (not deleted) to ext_summary_hash because it's folded into compute_chain_tip() as a flag byte — chain-tip KATs prove byte-identity. The only remaining cdbrw strings are proto reserved-name reservations.

Verified green

dsm 1665, dsm_sdk 1423 + integration, chain-tip byte-stability KATs, android aarch64 cross-compile, TS proto regen, frontend Jest 26/26, gradle compile (main+unit+androidTest), assembleDebug.

Not in scope

Whitepaper §11.1/§12 prose still says K_DBRW/DBRW (code is authoritative — now AttA/device-birth); device-birth Phases 3-6 (frontend setup buttons, storage-node admission, spec reconciliation, on-device A16).

…rth binding (Phase 1: core+SDK)

Deletes the phone C-DBRW silicon self-attestation entirely and replaces the
device-binding material folded into per-device key derivation (S_master IKM,
per-step EK, Kyber coins, SDK entropy) with a deterministic, software-canonical
device-birth binding AttA. Genesis no longer gatekeeps on any silicon
measurement or trust level: online safety remains tripwire + parent-consumption
uniqueness, and offline-bearer anti-clone remains the separate secure-element
anchor.

AttA = BLAKE3("DSM/device-birth-att/v1\0" || LP(nonce_commitment) ||
LP(creation_mode) || LP(schema_version) || LP(protocol_version)). It is an
install/device-lineage binding, NOT an anti-clone proof. genesis_hash and the
device public key are excluded from the preimage (they are derived during/after
the MPC the binding feeds) and bind via G/DevID in the IKM instead.

Removed:
- core: crypto/cdbrw_binding.rs, crypto/cdbrw_moments.rs; K_DBRW out of
  genesis_session/genesis/ephemeral_key; cdbrw domain-tag module renamed to device_birth
- sdk: six security/cdbrw_* modules, jni/cdbrw.rs, cdbrw_native_exports.rs, the
  dbrw.status/cdbrw.* route family, the C-DBRW access gate, the bootstrap trust gate

Added: crypto/device_birth.rs (DeviceBirthInputs / CreationMode /
derive_device_birth_att / from_entropy); proto DeviceBirthRecordV1 + CreationMode;
ingress + genesis callers compute and install AttA.

Tests: deleted obsolete silicon tests, added device-birth equivalents (determinism
PBT, pinned KAT, keypair determinism/divergence/non-leak, restore-context). dsm
1580 pass; dsm_sdk 1423 lib pass; android aarch64 (jni,bluetooth,mock-anchor)
compiles clean.

Deferred to Phase 7: cosmetic dbrw-identifier renames (fetch_dbrw_binding_key,
set_cdbrw_binding_key_for_testing, DbrwBindingKeyProvider, GenesisRecord.dbrw_binding)
plus the CI banned-string guard. Phases 2-7 (Kotlin, frontend, storage-node, specs,
on-device) remain.
Reason:
- comment/spec wording only
- no theorem bodies changed
- Lean files rechecked green
- documents the new proof boundary cleanly:
  core online safety = Tripwire
  storage nodes = dumb mirrors
  offline anti-clone = separate Safe7 stateful-root anchor
Phase 1 left two different AttA derivations: the MPC-genesis path
(core_sdk/identity_sdk/counterparty) used from_entropy = BLAKE3(att-tag ||
BLAKE3(nonce-tag || hw||env) || ...), while bootstrap-finalize and restore used
device_birth_att_from_record(record.nonce_commitment). The two diverge, so the
device re-derived a signing key (from the record AttA that FINALIZE installs)
that did NOT match its published genesis AK (derived from the from_entropy AttA
during MPC genesis) — every signature would fail verification.

Fix: replace from_entropy with from_platform_nonce, which uses the platform-
supplied 32-byte nonce commitment VERBATIM (no second hash). When the host
sends the same persisted nonce to both SystemGenesisRequest and
DeviceBirthRecordV1.device_birth_nonce_commitment (Phase 2), both paths derive
an identical AttA. Removes the now-unused TAG_DSM_DEVICE_BIRTH_NONCE tag.

dsm_sdk lib: 1425 pass; device-birth KAT + slot-consistency test green.
Rust owns the device-birth binding end-to-end; no binding material
crosses the wire. The SDK draws a 32-byte CSPRNG birth nonce, computes
commitment = BLAKE3("DSM/device-birth-nonce/v1\0" || nonce), folds it
verbatim into AttA at genesis, and persists ONLY the commitment in the
GenesisRecord. finalize/restore re-derive AttA from persisted storage
(keyed by device_id + genesis_hash) and fail closed on identity
mismatch, preserving genesis-AK == re-derived signing key.

Proto: removed SystemGenesisRequest.device_birth_nonce_commitment,
RestoreIdentityContextOp.device_birth, BootstrapMeasurementReport.device_birth,
and the orphaned DeviceBirthRecordV1 message (all reserved by number and
name). The wire now carries only identity handles.

Android: removed AntiCloneGate, SiliconFingerprintNative, AccessLevel,
the silicon NDK build path (siliconfp.cpp + CMakeLists + externalNativeBuild),
the SiliconFp* instrumented tests, and the bootstrap C-DBRW client flow
(keyDbrwSalt threading + captureCdbrwOrbitTimings). Kotlin is transport-only.

Renames: fetch_device_birth_binding_key, set_device_birth_binding_key_for_testing,
DeviceBirthBindingKeyProvider, GenesisRecord.device_birth_binding,
PlatformEntropyInputs -> PlatformDeviceBirthInput. env_fingerprint
(consumed nowhere) dropped, not renamed.

Verified green: dsm 1582/1582, dsm_sdk 1424/1424, android aarch64
cross-compile, TS proto + frontend Jest 25/25, gradle compile
(main+unit+androidTest), and assembleDebug.

The C-DBRW runtime trust protocol (responder/verifier, Cdbrw* proto,
DevCdbrwScreen) is intentionally untouched here and is the next slice.
The C-DBRW runtime trust protocol's Rust modules were deleted in an
earlier phase; this removes the remaining orphans now that the
device-birth binding has fully replaced it.

Proto: delete the Cdbrw*/Dbrw* runtime-trust messages and enums
(DbrwStatusResponse, CdbrwTrustSnapshot, Cdbrw{AccessLevel,ResonantStatus,
OrbitTrial,MeasureTrustRequest,RespondRequest,VerifyRequest,EnrollRequest,
RespondResponse,VerifyResponse,EnrollResponse}); remove the five Envelope
payload fields (90, 103-106) and reserve the numbers + names; rename
InitFailed.Reason CDBRW_NOT_READY -> BINDING_NOT_READY (number kept, old
name reserved).

Rust: remove the two core/bridge.rs payload-case reject arms (the only
non-test consumers of the deleted types), the now-dead clear_binding_key()
(its caller cdbrw.reprove was already gone), and rewrite the comments/log
strings that described the deleted cdbrw.* routes / Cdbrw types / silicon
enrollment as live.

Frontend: replace the SILICON FINGERPRINT ENROLLMENT / DBRW SALT
INITIALIZATION securing-screen labels and the stale DBRW/silicon copy. The
genesis securing lifecycle listener itself is kept and still drives the
now-sub-second securing UX.

Online safety remains the Tripwire; offline-bearer anti-clone remains the
separate Safe7 anchor (untouched); storage-node admission untouched. The
K_DBRW whitepaper KDF-parameter name (the binding-key slot, now holding
device-birth AttA) is deliberately left for a separate slice — it crosses
the Lean/TLA formal-model boundary.

Verified green: dsm 1665, dsm_sdk 1424 + all integration tests, android
aarch64 cross-compile, TS proto regen, frontend Jest 26/26, gradle compile
(main+unit+androidTest), and assembleDebug.
The device-birth binding (AttA) fully replaced the old DBRW/K_DBRW binding;
this removes every remaining reference to the dead concept across code,
comments, proto, Kotlin, frontend, and the TLA/Lean formal models.

Rename: k_dbrw -> device_birth_att and the K_DBRW whitepaper KDF notation
-> AttA (the IKM = G || DevID || AttA || s_0 formula and friends). The core
KDF (ephemeral_key.rs) already used device_binding/AttA; the residue was
SDK-side identifiers, comments, and KAT constants — pure cosmetic.

Byte-stability: DeviceState.dbrw_summary_hash is always None in production
but is folded into compute_chain_tip() as a presence-flag byte, so deleting
it would change every bilateral chain-tip hash. It is therefore RENAMED
(-> ext_summary_hash / ext_flag, proto field 7 kept) preserving the exact
canonical bytes — the chain-tip KATs prove byte-identity — not deleted.

Also: removed the dead TAG_DBRW domain tag (never hashed); fixed the false
device_admission doc claim that the binding 'is silicon-bound and cannot be
cloned' (it is an install/lineage value, not an anti-clone proof); aligned
the CDBRW_NOT_READY -> BINDING_NOT_READY doc strings; and updated the
formal-model comments (DSM_Tripwire.tla, DSMOfflineFinality/DSMCertChain.lean)
to drop the DBRW token.

The only remaining dbrw/cdbrw strings are the proto 'reserved "..."'
field-name reservations, which must keep the historical names to reserve them.

Verified green: dsm 1665, dsm_sdk 1423 + integration, chain-tip byte-stability
KATs, android aarch64 cross-compile, TS proto regen, frontend Jest 26/26,
gradle compile (main+unit+androidTest), and assembleDebug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant