Skip to content

feat(authority): the owner's device binds them with the owner key it enrolled - #10007

Open
olety wants to merge 9 commits into
opus-ownerkey-p1/hosted-revoke-actor-needs-owner-prooffrom
opus-ownerkey-p1/hosted-owner-bind-ceremony
Open

olety wants to merge 9 commits into
opus-ownerkey-p1/hosted-revoke-actor-needs-owner-prooffrom
opus-ownerkey-p1/hosted-owner-bind-ceremony

Conversation

@olety

@olety olety commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Row [HOSTED-RELAY-OWNER-HUMAN-BIND-CEREMONY] (P2; lead ruling B, Sat 21 Nov 04:3x: "build now"). Engine ANSWER BIND-CEREMONY-CLIENT-SCOPE = A (21 Nov 04:44). Stacks on the hosted RevokeActor owner-proof PR, which must land first so that the custodial root cannot end a binding this door makes.

Why

On a Hosted vault the enrolment's predecessor is the custodial host root, and the hosted fold counts no human BindActor that only a key in the host's custody signs. A Relay vault holds no root of its own. So there an owner key enrolment binds no one, for the first Owner and for every added one, and each owner verb that reads the binding (memory::verify_owner_actor_binding_in_txn, Memory::verify_owner) answers OWNER_BINDING_REQUIRED.

What

A two-step door, in which the owner's device signs its own binding with the key it enrolled:

  • Vault::prepare_owner_key_binding_as(authority, public_key) builds BindActor{K, owner, human, next epoch} with K as its one signer, at K's next sequence, at the main-log heads (a frontier wider than one entry names is joined first, carried by this install). It answers the unsigned entry (canonical MessagePack) and the authority transcript K signs.
  • Vault::land_owner_key_binding_as(authority, entry, signature) checks the entry against what prepare builds (op, owner, class, vault, signer, no cosign, one encoding). It rechecks the door's rules at its own heads, verifies K's strict Ed25519 signature over the transcript, and lands the row only once the fold counts it and the owner's binding stands.
  • Rules: K is a live Ed25519 owner device key that a counted enrolment names this owner for, while no live human binding names the owner and none rests on K. A confirmation is no enrolment: the rows the removal closure reads as confirmations (owner_authority_closure.rs confirmations, now shared) do not attribute K, so the door and the removal agree whose key K is. Sibling enrolments on parallel branches each stand. A passkey signs no binding (the fold bars every passkey from a BindActor). The recovery root's authority key stays off this door. A device key that only a passkey vouched for binds once confirmed (the hosted fold takes no owner proof from it before).
  • The epoch: one above both K's last binding and every counted RevokeActor of K, both of which the fold's floor for a new binding takes in (op_apply.rs apply_actor_binding); an epoch at the last value refuses. A floor that only a revoke the fold no longer counts holds (ONE-REVOKE-DURABILITY) is not read here: the fold then refuses the binding, and land answers that it did not count.
  • Routes: POST /v1/owner/owner-signing-keys/bind/prepare (public_key) and POST /v1/owner/owner-signing-keys/bind/land (entry, signature), hex like the other owner key routes, behind owner(). They need no root this host holds, so they serve Relay too. OpenAPI rows through RestShape::json. Refusals use the enrol routes' mapping: integrity is 400, authority is 409 refused.
  • The self-host enrolment binder is unchanged (OWNER-ENROL-BIND-SIGNER = A). A read leg found that dropping its posture guard would roll back every host-root enrolment on Hosted.
  • apps/web/src/runtime/owner-passkey-client.ts: one doc line, that a passkey binds no one, naming the device key routes.

New verb: none. The routes are owner routes, and the act is the owner's own: their own key signs, and the fold judges it. No grant is involved.

Files

  • crates/oneiron/src/authority/owner_key_enrollment_door/owner_key_binding.rs (new): the door.
  • crates/oneiron/src/authority/owner_key_enrollment_door.rs: the module, re-exports, one doc pointer.
  • crates/oneiron/src/authority/owner_key_enrollment_door/owner_authority_closure.rs: confirmations and EnrolmentRow shared with the door (pub(super)).
  • crates/oneiron/src/authority/mod.rs: re-exports.
  • crates/oneiron-server/src/api/owner_routes/owner_key_binding_routes.rs (new): the routes.
  • crates/oneiron-server/src/api/owner_routes.rs: registration.
  • crates/oneiron-server/tests/owner_key_binding_routes.rs (new): the red/green.
  • crates/oneiron/tests/owner_key_binding.rs (new): guards.
  • apps/web/src/runtime/owner-passkey-client.ts: the doc line.

Stored change: additive (BindActor is an existing op; no row shape or fold rule changes here).

Tests

  • Red/green through the routes, owner_key_binding_routes (one test). The red pin a1d8631 (branch opus-ownerkey-p1/bind-ceremony-red-r1) is the test commit on the base PR's head plus the test-helper commit, so its test file equals the head's. There the enrolment over HTTP binds no one and the owner verb answers OWNER_BINDING_REQUIRED (asserted, passes); then /bind/prepare answers 404, and the test fails at that status. On the head: another key's signature is refused (400) and binds no one, the key's own lands, and the owner verb passes. Command: RUSTFLAGS="--cfg oneiron_test_support" cargo test --locked -p oneiron-server --all-features --features oneiron/test-support --test owner_key_binding_routes.
  • Red/green in the door, owner_key_binding a_rebinding_takes_an_epoch_above_the_keys_revocation: red pin efdf053 (branch opus-ownerkey-p1/bind-ceremony-red-r2, the test commit before the fix), where the key's own RevokeActor at epoch 9 ends its first binding, the door prepares epoch 2, and land answers that the binding did not count. On the head the door prepares epoch 10, which counts, and the owner verb passes. Command as for the guards below.
  • Head-only guards, owner_key_binding: the Hosted first Owner, the Hosted added Owner, and the Relay added Owner (an owner-origin root, served as Relay) each bind and pass the owner verb. Refusals: another key's signature, a key enrolled for another owner or never enrolled, an entry landed for another owner, and a second key for a bound owner. Command: RUSTFLAGS="--cfg oneiron_test_support" cargo test --locked -p oneiron --all-features --test owner_key_binding.
    These run after the merge (READY-PROOF-VS-MERGE-BAR = A).

Own review (Sol xhigh, stack #10009)

Findings 2 and 3 (confirmation attribution; epoch below a revoke floor) are fixed in 22d6449; finding 1 is PR A's (#10006, 3a34c7c), merged up here.

Follow-ups

  • FIX row: the first client that ships device-key enrolment against a Hosted or Relay server calls /bind/prepare and /bind/land right after /enroll. No shipping client drives /enroll today.
  • Once bound, an owner falls under the bound-owner rule that self-host added Owners already have: when every human binding of theirs ends, owner_live_at reads them as removed. They bind again with another live device key of theirs through this door.

…routes

Row HOSTED-RELAY-OWNER-HUMAN-BIND-CEREMONY (lead ruling B): on a served
Hosted vault the owner enrols a device owner key over HTTP, which binds no
one, so Memory::verify_owner answers OWNER_BINDING_REQUIRED; then the device
prepares its binding (POST /v1/owner/owner-signing-keys/bind/prepare) and
lands it with the key's signature (POST .../bind/land): another key's
signature is refused, the key's own lands, and the owner verb passes. Red on
the base: the routes answer 404.
…enrolled

Row HOSTED-RELAY-OWNER-HUMAN-BIND-CEREMONY (lead ruling B, 21 Nov 04:3x). On
a Hosted vault the enrolment's predecessor is the custodial host root, whose
human bind the fold refuses, and a Relay vault holds no root, so there an
enrolment binds no one and every owner verb that reads the owner binding
answers OWNER_BINDING_REQUIRED. A two-step door binds them, signed by the key
itself: Vault::prepare_owner_key_binding_as builds BindActor{K, owner, human,
next epoch} with K as its one signer at the heads and answers the unsigned
entry and its transcript; Vault::land_owner_key_binding_as takes K's strict
Ed25519 signature, rechecks the door's rules at its own heads and lands the
row only once the fold counts it and the owner's binding stands. K must be a
live Ed25519 owner device key a counted enrolment names the owner for, while
no live human binding names them; a passkey signs no binding and the
recovery root's authority key stays off this door. The routes POST
/v1/owner/owner-signing-keys/bind/prepare and /bind/land need no host root,
so they serve Relay too. The self-host enrolment binder is unchanged
(OWNER-ENROL-BIND-SIGNER = A). Engine tests in tests/owner_key_binding.rs:
Hosted first and added Owner, Relay added Owner, four refusals.
Engine ANSWER BIND-CEREMONY-CLIENT-SCOPE = A: the owner passkey module's
header now says the vault bars every passkey from signing the owner's human
binding, and names the owner device key routes that bind a Hosted or Relay
owner.
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 9 billable files and costs up to $2.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 51 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 151 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 33054a8 and a52b948.

Files selected for processing: 9

  • apps/web/src/runtime/owner-passkey-client.ts
  • crates/oneiron-server/src/api/owner_routes.rs
  • crates/oneiron-server/src/api/owner_routes/owner_key_binding_routes.rs
  • crates/oneiron-server/tests/owner_key_binding_routes.rs
  • crates/oneiron/src/authority/mod.rs
  • crates/oneiron/src/authority/owner_key_enrollment_door.rs
  • crates/oneiron/src/authority/owner_key_enrollment_door/owner_authority_closure.rs
  • crates/oneiron/src/authority/owner_key_enrollment_door/owner_key_binding.rs
  • crates/oneiron/tests/owner_key_binding.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@olety
olety marked this pull request as ready for review November 20, 2026 20:04
@olety
olety added this pull request to stack #10009 November 20, 2026 20:04
@greptile-apps

greptile-apps Bot commented Nov 20, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository. Configure in Code Review Settings.

…ute test

Keeps the test function under the workspace's too_many_lines bar; the steps
and assertions are unchanged.
The workspace denies redundant_closure_for_method_calls.
… into opus-ownerkey-p1/hosted-owner-bind-ceremony
A key's own RevokeActor of its binding at an epoch above it raises the
fold's floor for the key's next binding. The door must prepare the next
binding above that floor, or the fold refuses it and retrying cannot
recover (review of stack #10009, finding 3). Red here: the door takes the
epoch from the last binding only.
…e its revoke floor

The binding door took any counted OwnerKeyEnroll naming the owner as the
key's enrolment for them, a confirmation among them: an owner key that
vouches again for a key only a passkey vouched for names its own owner,
whom the key was not enrolled for, so that owner could bind the key while
the removal door attributes it to the enrolling owner only (review of
stack #10009, finding 2). The door now leaves out the rows the removal
closure reads as confirmations, with the one ancestry reading, and keeps
sibling enrolments on parallel branches.

The next binding's epoch now lies above every counted RevokeActor of the
key as well as its last binding, as the fold's floor does; an epoch at the
last value refuses (finding 3).
… into opus-ownerkey-p1/hosted-owner-bind-ceremony

This branch has not been deployed

No deployments
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