Repository navigation
feat(identity): add authentication keys bound to a contract - #1123
Draft
Claudius-Maginificent wants to merge 10 commits into
Draft
Claudius-Maginificent wants to merge 10 commits into
Claudius-Maginificent wants to merge 10 commits into
Conversation
Where contract bounds validation is at version 2 or later (ContractBoundAuthenticationKeys capability), an AUTHENTICATION key below MASTER may be bound to one contract or document type. The rule lives in contract_bounds_allowed; adding a key enforces it before prompting or broadcasting and refuses a bound authentication key on a network that does not admit one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
With contract bounds enabled, Add Key offers AUTHENTICATION where the network admits bound authentication keys, and a bound key may carry a spending limit and an expiry too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Collaborator
|
🕓 Review not started yet because this PR is a draft.
Commit 048dba0. Normal review starts when eligible; priority review starts as soon as a slot is available. |
This was referenced Oct 25, 2026
Merged
… branch Resolves the imports and the identity_key_limits doc conflict, and moves the contract-bound refusal test to the shared test identity, since the key limits test helper it used is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
The backend answered every refused contract-bound key with advice to wait for a network upgrade, which is wrong for a MASTER or transfer key that no network lets carry contract bounds. Such a key now gets its own message, and the upgrade advice stays for a bound authentication key on a network that does not accept one yet. The identity_key_limits module doc names the contract bounds rule it holds, and a test pins that a bound key keeps its bounds, with or without limits, in the version its limits call for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…ys branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…ntract-bound keys branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…version The Platform bump removed DET's own protocol version copy; the capability and its test now read the version the network has proven. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
…-keys Brings in the v1.0-dev squash of #1114; the tree is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WunYYhY7P2FJqHVgkHiXtT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR: On networks that accept them, you can add an authentication key below MASTER that signs only for one contract or one document type. Combined with #1120's spending limit and expiry, this lets you hand an app a key that cannot act anywhere else.
Stacked atop #1120.
User story
As a user handing a key to an app or a helper, I want to limit that key to one contract or document type, so that a leaked key cannot act on anything else (IDN-022, contract-bounds criterion).
Scenario
noteof contract X").On a network that does not accept bound authentication keys, AUTHENTICATION is not offered for a contract-bound key, and the backend refuses one before anything is sent.
Detailed discussion
ContractBoundAuthenticationKeyscapability opens where upstream'svalidate_identity_public_key_contract_boundsvalidation version is at least 2. Upstream names no feature constant for this, so the validation version is the source of truth. As with every protocol capability, it stays closed until the network's protocol version is proven, and on a version this build does not define.model::identity_key_limits::contract_bounds_allowedholds the rule:add_key_to_identityenforces it again before prompting or broadcasting. A key that may never be bound (a MASTER or transfer key) getsTaskError::KeyCannotBeBound. A bound authentication key on a network that does not accept one yet getsTaskError::ContractBoundAuthenticationKeysNotSupported. Each message says what to do.key_with_limits, so it keeps its bounds either way. Without limits it is a version 0 key; with limits it is a version 1 key.Testing
cargo clippy --all-features --all-targets -- -D warningsandcargo fmt --all -- --checkpass.🤖 Co-authored by Claudius the Magnificent AI Agent
🤖 Generated with Claude Code
https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q