Skip to content

docs(adr): operator key-rotation runbook - #360

Merged
thiras merged 3 commits into
mainfrom
docs/operator-key-rotation
Apr 30, 2026
Merged

thiras merged 3 commits into
mainfrom
docs/operator-key-rotation

Conversation

@thiras

@thiras thiras commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Closes #308.

Why

Key rotation is a routine operational task — annual hygiene, hardware migration, and compromise response — but no operator-facing document covers the safe sequence for replacing both the iroh Ed25519 node identity and the Ethereum signing key while preserving stake, channels, and watchtower escrows. The relevant APIs are already specified across ADRs 001 / 003 / 019 / 024; this PR sequences operator actions over them, it does not redefine any protocol mechanism.

What

A new appendix, adr/appendix-operator-key-rotation.md, plus the standard appendix-index updates.

The runbook covers four cases:

  • §1 — iroh node-key only. StakingRegistry.bindNodeId() rebinds; Ethereum address, stake, channels, watchtower escrows, and firstRegisteredAt all carry over. Reputation observations and DHT routing-table position reset.
  • §2.1 — EOA Ethereum-key rotation. Full deregister → unbond → withdraw → re-stake. Loses firstRegisteredAt. Flagged as a last resort.
  • §2.2 — One-time EOA → Safe migration. Recommended migration path; after this, all subsequent rotations are §2.3.
  • §2.3 — Safe owner / erc7579/smartsessions session-key rotation. On-chain identity unchanged. The cheap path.
  • §4 — Both at once. Rotate iroh first, then Ethereum, with explicit ordering rationale.

§5 lists failure modes and rollback procedures. §6 enumerates what the runbook deliberately does not cover (HW-wallet hot signing, delegated voucher signers, post-incident response).

Files touched

File Change
adr/appendix-operator-key-rotation.md (new) The runbook. ~200 lines.
adr/README.md Appendix-list prose updated in both the Reading Order and Decision-Record Context sections.
adr/architecture.md New entry 6 in §Appendices — Reference Patterns.

Test plan

  • All cross-refs resolve to real ADR file paths and (where used) real anchor IDs (verified with grep against ^## | ^### | ^#### headings).
  • No restatement of ADR 012 §Key rotation prose — the client analogue is referenced, not duplicated.
  • Drain-before-stop in §1 step 2 explicitly avoids the probe-hold phantom-slash window per ADR 005.
  • §2.1 calls out firstRegisteredAt reset as a real cost (cold-start bootstrap reset per ADR 008 §10).
  • markdownlint passes.

Out of scope

  • The decdn node drain subcommand itself (#244). The runbook references the admin_v1_drain admin RPC method that's already listed in appendix-local-admin-http.md and treats the CLI subcommand as forthcoming.
  • Delegated voucher-signer flows (the unresolved item in #190).

🤖 Generated with Claude Code

Closes #308.

Adds adr/appendix-operator-key-rotation.md — a sequenced operator
runbook for rotating the iroh node-key, the Ethereum signing key,
and (production) Safe owner / smartsessions session keys without
losing stake or triggering watchtower disputes.

The runbook does not redefine any protocol mechanism. It is a
sequencing layer over APIs already specified elsewhere:
- StakingRegistry.bindNodeId for iroh-key rebinding (ADR 003)
- deregister/unbond/withdraw/re-stake for EOA Ethereum-key
  rotation (ADR 019)
- erc7579/smartsessions revoke+install for production session
  keys (ADR 024)

Cross-references for client-side analogues (ADR 012 §Key rotation),
watchtower carry-over rationale (ADR 007), reputation impact
(ADR 008), and probe-hold drain prerequisite (ADR 005) are inlined
where they affect the procedure.

The §2.1 EOA→EOA path is explicitly flagged as a last resort; the
recommended path is one-time migration to a Safe (§2.2), after which
all subsequent rotations are owner/session-key swaps with no
on-chain identity change.

Index updates:
- adr/README.md: appendix-list prose updated in both the Reading
  Order and Decision-Record-Context sections
- adr/architecture.md: new entry 6 in §Appendices — Reference Patterns

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings April 30, 2026 18:53

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new appendix documenting the 'Operator Key Rotation Runbook,' which provides sequenced procedures for rotating various keys used by node operators, including the iroh node-key, Ethereum signing key, and session keys. The documentation covers decision trees, procedures for EOA and Safe accounts, and failure mode analysis. Review feedback identifies several technical inaccuracies and opportunities for improvement: the description of the iroh node-key's role in signing slash_sig needs refinement, the retention period for old keystores should align with the maximum evidence age rather than the unbonding window, and the prerequisites for reusing a nodeId during Ethereum key rotation should be explicitly noted. Additionally, the reviewer suggested optimizing the rotation sequence to reduce unnecessary downtime and using standard terminology for security windows.

Comment thread adr/appendix-operator-key-rotation.md Resolved
Comment thread adr/appendix-operator-key-rotation.md Resolved
Comment thread adr/appendix-operator-key-rotation.md Resolved
Comment thread adr/appendix-operator-key-rotation.md Resolved
@thiras thiras mentioned this pull request Apr 30, 2026
5 tasks done

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new operator-facing runbook appendix describing safe key-rotation procedures for node identity (iroh Ed25519) and on-chain identity (Ethereum EOA/Safe + production session keys), and wires it into the ADR appendix indices.

Changes:

  • Introduces appendix-operator-key-rotation.md documenting rotation decision tree, step-by-step procedures, and rollback guidance.
  • Updates ADR appendix indices to include the new runbook in architecture.md and README.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
adr/appendix-operator-key-rotation.md New key-rotation runbook appendix (procedures, failure modes, ordering guidance).
adr/README.md Mentions the new appendix in the appendix descriptions/examples.
adr/architecture.md Adds the new appendix to the “Appendices — Reference Patterns” index.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread adr/appendix-operator-key-rotation.md Resolved
Comment thread adr/appendix-operator-key-rotation.md Resolved
Comment thread adr/appendix-operator-key-rotation.md Resolved
Comment thread adr/appendix-operator-key-rotation.md Resolved
Comment thread adr/appendix-operator-key-rotation.md Resolved
Comment thread adr/appendix-operator-key-rotation.md Resolved
Comment thread adr/appendix-operator-key-rotation.md Resolved
thiras and others added 2 commits April 30, 2026 22:14
The §1 Failure modes table cited custom-error symbols
(`NodeIdAlreadyBound`, `InvalidSignature`) that don't exist in the
codebase. ADR 003's `bindNodeId` reference Solidity uses string
require() messages: `"NodeId bound to another address"` and
`"invalid signature"` (adr/003-payments.md:731, :735). Replace the
fictional symbols so an operator grep'ing logs finds the actual
revert reason.

Caught by reviewer follow-up on PR #360.
Eight inline comments from gemini-code-assist and Copilot, all
verified as technically correct.

A. Line 11 (gemini): iroh node-key purpose listed slash_sig as one of
   the things the Ed25519 wire key signs. Per ADR 005:55 and
   ADR 014:30-46, slash_sig is an EIP-712 secp256k1 signature using
   the Ethereum signing key — not the iroh key. Moved slash_sig from
   the Ed25519 row into the Ethereum signing-key row's purpose, with
   a note that this hot-signing burden motivates the production
   session-key path.

F. Line 13 (Copilot): "Voucher session key" name is misleading —
   ADR 024 §3 says nodes use session keys for slash_sig, not
   vouchers (vouchers are a client concern). Renamed to
   "Slash-sig session key" with a note distinguishing it from
   the client-side voucher session key.

E. Line 43 (Copilot): Decision tree routed Safe → §2.2, but §2.2
   is the EOA→Safe migration. Re-rooted the tree so the second
   question is "Account / goal?" with three leaves: EOA staying
   EOA → §2.1, EOA → Safe (one-time) → §2.2, Already on Safe → §2.3.

B. Line 89 (gemini + Copilot): §1 step 9 tied iroh keystore retention
   to the unbonding window (7d). bindNodeId does not initiate
   unbonding (only deregisterNode does — ADR 001:342). Per ADR 014,
   the relevant ceiling is MAX_EVIDENCE_AGE_US (5d PoC, governable
   [1d, 30d]) — beyond that, slash evidence containing the old
   key's signatures cannot be submitted on-chain. Also reframed
   purpose: retention is forensic, not for counter-evidence (which
   on this protocol is fresh BLAKE3 reads or immediate slashing,
   never operator-signed with the old iroh key).

G. Line 124 (Copilot): §2.1 step 7 said "if any voucher you signed
   under the old address has not been redeemed, the counterparty
   has 1 epoch (default 7d) to call closeChannel." Both wrong:
   (1) vouchers are client-signed (ADR 003), so the operator
   only signs vouchers when acting as a client (cache-miss pulls
   upstream); inbound channels carry no key-side liability.
   (2) Channels live up to maxChannelDuration (90d default, ADR 010),
   not 1 epoch. Rewrote to specifically address outbound channels
   and the 90d practical window.

C. Line 125 (gemini): §2.1 step 8 said "the nodeId may be the same
   one rotated in §1 or a fresh one." Wrong if §1 was not
   performed first: deregisterNode does not clear the
   nodeIdToAddress mapping (ADR 001:340-342), so a fresh address
   calling registerNode(originalNodeId, …) would revert with
   "NodeId bound to another address". Updated to require a fresh
   NodeId in §2.1 by default, with explicit chain §1 → §2.1 path
   if reusing the original NodeId is important.

D. Line 169 (gemini + Copilot): §4 step 2 told the operator to
   "wait for the unbonding window to elapse from the §1 rebinding."
   bindNodeId does not initiate unbonding; replay protection
   between §1 and §2 is handled by the per-address bindingNonce
   (ADR 003), which incremented atomically when §1 ran. Removed
   the wait. Also dropped the made-up term
   "iroh-rebinding-replay window."

H. Line 187 (Copilot): "ADR 012 §Key rotation (line 124)" used a
   line number that drifts. ADR 012 has no real heading anchor for
   "Key rotation" (it's a bold inline paragraph). Dropped the line
   number; the §-shorthand text and the file link are stable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
thiras added a commit that referenced this pull request Apr 30, 2026
Five inline comments from gemini-code-assist and Copilot, all
verified as technically correct.

K. Line 77 (Copilot): admin_v1_drain is referenced in §3.2 step 1
   but is not yet implemented (only admin_v1_peersList exists today;
   admin_v1_drain is tracked as #244). Added a one-line caveat
   directing operators to drain via external load balancer or
   firewall block until the admin RPC method ships.

I. Line 100-102 (gemini): The runbook said operators MAY remove v1
   support earlier than T+12 weeks (under the negligible-traffic
   condition) and MAY NOT remove v1 before T+4 weeks. Both wrong:
   ADR 013 §Multi-version support says nodes MUST support both
   versions during the transition period, which the §Deprecation
   Timeline ends at T+12 weeks. Replaced with a strict "MUST keep
   v1 until T+12; MAY remove at T+12+" and explained the
   no_application_protocol TLS-alert failure mode that early
   removal causes.

J. Line 134 (gemini): §5 failure-mode row "Restarted node reports
   not_ready for rate_bounds_loaded" advised "Hold the rollout;
   wait for the governance flag to flip; restart. Do not roll
   back the binary." Risky for availability — the governance
   timelock can be up to 48h (ADR 009). Changed to recommend
   rolling back to the previous stable or dual-version binary
   to restore service, then redoing §3.2 after the flag flips.

L. Line 157 (Copilot): §"Cross-references" included a link to
   appendix-operator-key-rotation.md, which is a forward-reference
   to PR #360 — the link breaks until that PR also lands. Removed
   the reference; can be added back in a follow-up after both
   appendices are on main.

M. README:29 (Copilot): adr/README.md said "operator protocol-upgrade
   path" but the appendix title (and architecture.md) use
   "Operator Protocol-Upgrade Runbook". Aligned README wording.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@thiras
thiras merged commit 7236c45 into main Apr 30, 2026
9 checks passed
@thiras
thiras deleted the docs/operator-key-rotation branch April 30, 2026 19:38
thiras added a commit that referenced this pull request Apr 30, 2026
Five inline comments from gemini-code-assist and Copilot, all
verified as technically correct.

K. Line 77 (Copilot): admin_v1_drain is referenced in §3.2 step 1
   but is not yet implemented (only admin_v1_peersList exists today;
   admin_v1_drain is tracked as #244). Added a one-line caveat
   directing operators to drain via external load balancer or
   firewall block until the admin RPC method ships.

I. Line 100-102 (gemini): The runbook said operators MAY remove v1
   support earlier than T+12 weeks (under the negligible-traffic
   condition) and MAY NOT remove v1 before T+4 weeks. Both wrong:
   ADR 013 §Multi-version support says nodes MUST support both
   versions during the transition period, which the §Deprecation
   Timeline ends at T+12 weeks. Replaced with a strict "MUST keep
   v1 until T+12; MAY remove at T+12+" and explained the
   no_application_protocol TLS-alert failure mode that early
   removal causes.

J. Line 134 (gemini): §5 failure-mode row "Restarted node reports
   not_ready for rate_bounds_loaded" advised "Hold the rollout;
   wait for the governance flag to flip; restart. Do not roll
   back the binary." Risky for availability — the governance
   timelock can be up to 48h (ADR 009). Changed to recommend
   rolling back to the previous stable or dual-version binary
   to restore service, then redoing §3.2 after the flag flips.

L. Line 157 (Copilot): §"Cross-references" included a link to
   appendix-operator-key-rotation.md, which is a forward-reference
   to PR #360 — the link breaks until that PR also lands. Removed
   the reference; can be added back in a follow-up after both
   appendices are on main.

M. README:29 (Copilot): adr/README.md said "operator protocol-upgrade
   path" but the appendix title (and architecture.md) use
   "Operator Protocol-Upgrade Runbook". Aligned README wording.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
thiras added a commit that referenced this pull request Apr 30, 2026
* docs(adr): operator protocol-upgrade runbook

Closes #282.

ADR 013 specifies the three-tier schema-evolution scheme,
ALPN negotiation, signed-field freezing, and the production
deprecation timeline (T+0 / T+4 / T+12), but no document
sequences the operator-facing actions implied by each tier:
which kinds of releases need config edits, when payment
channels are at risk, when watchtower escrows must be
re-coordinated, and how to roll a Tier-3 upgrade across a
fleet without dropping traffic.

Adds adr/appendix-operator-upgrade-path.md covering:

- §1 Tier overview (recap; not a redefinition of ADR 013)
- §2.1 Tier 1 minor — pull-and-restart, no drain
- §2.2 Tier 2 medium — opt-in flag config, smoke-test on
  protocol_error rate
- §3 Tier 3 major:
  - §3.1 Pre-cutover (T+0..T+4 weeks): config-field deltas,
    payment-channel validity, voucher-signer compatibility,
    watchtower re-coordination, receipt continuity
  - §3.2 Per-node rolling upgrade procedure exploiting the
    dual-ALPN-on-one-Endpoint property from ADR 013
  - §3.3 Post-cutover (T+4..T+12 weeks): traffic-mix monitoring
    and v1-removal timing
- §4 Coordination touchpoints (watchtowers, clients,
  governance)
- §5 Failure modes and rollback table
- §6 Out-of-scope: in-place downgrades, cross-chain coordination,
  client-side migration

References ADR 010 §"Migration from ADR 003" as the existing
contract-level worked example.

Index updates:
- adr/013-schema-evolution.md: appended a one-line "See also"
  pointer at the end of §Deprecation Timeline. No semantic change.
- adr/README.md: appendix-list prose updated in both the
  Reading Order and Decision-Record-Context sections.
- adr/architecture.md: new entry 6 in §Appendices —
  Reference Patterns.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(adr): apply review feedback on PR #361

Five inline comments from gemini-code-assist and Copilot, all
verified as technically correct.

K. Line 77 (Copilot): admin_v1_drain is referenced in §3.2 step 1
   but is not yet implemented (only admin_v1_peersList exists today;
   admin_v1_drain is tracked as #244). Added a one-line caveat
   directing operators to drain via external load balancer or
   firewall block until the admin RPC method ships.

I. Line 100-102 (gemini): The runbook said operators MAY remove v1
   support earlier than T+12 weeks (under the negligible-traffic
   condition) and MAY NOT remove v1 before T+4 weeks. Both wrong:
   ADR 013 §Multi-version support says nodes MUST support both
   versions during the transition period, which the §Deprecation
   Timeline ends at T+12 weeks. Replaced with a strict "MUST keep
   v1 until T+12; MAY remove at T+12+" and explained the
   no_application_protocol TLS-alert failure mode that early
   removal causes.

J. Line 134 (gemini): §5 failure-mode row "Restarted node reports
   not_ready for rate_bounds_loaded" advised "Hold the rollout;
   wait for the governance flag to flip; restart. Do not roll
   back the binary." Risky for availability — the governance
   timelock can be up to 48h (ADR 009). Changed to recommend
   rolling back to the previous stable or dual-version binary
   to restore service, then redoing §3.2 after the flag flips.

L. Line 157 (Copilot): §"Cross-references" included a link to
   appendix-operator-key-rotation.md, which is a forward-reference
   to PR #360 — the link breaks until that PR also lands. Removed
   the reference; can be added back in a follow-up after both
   appendices are on main.

M. README:29 (Copilot): adr/README.md said "operator protocol-upgrade
   path" but the appendix title (and architecture.md) use
   "Operator Protocol-Upgrade Runbook". Aligned README wording.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants