M2-L01: docs(protocol): clarify session-key authorization scope and metadata extensibility#711
Merged
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
…etadata extensibility Audit finding M2-L01 noted that channel session keys are authorized only by asset and expiration, with no per-action, recipient, amount or channel restriction. Finer-grained scope is intentionally not added at this time; update the protocol documentation so this is explicit instead of under-specified. Cryptography: - Replace the loose "scope, expiration and possible other data" phrasing with a reference to the canonically encoded authorization metadata structure. - Add an "Authorization Metadata" section that defines the protocol minimum (`version`, `expires_at`) and explains that `version` is a replay/revocation guard whose increment supersedes prior delegations. - Document that implementations MAY extend the metadata with additional restrictions (authorized assets, allowed transitions, channels, recipients, spending limits, ...), and that any dimension an implementation does not encode and enforce is not narrowed: a session key can sign any otherwise-valid state along that dimension up to the participant's full balance until expiry. - Document the rationale for binding only the `keccak256` of the metadata into the authorization signature: implementations can extend the structure off-chain without on-chain validator changes and without invalidating session keys issued under earlier metadata layouts. Terminology: - Drop the misleading "specific types of state updates" wording from the Session Key entry and link to the cryptography section, noting that a participant delegating a session key SHOULD assume it may exercise any authority not narrowed by the scope it issued. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
144a68e to
713772a
Compare
nksazonov
approved these changes
Apr 27, 2026
nksazonov
added a commit
that referenced
this pull request
Apr 28, 2026
M2-I02: fix(clearnode/api): normalize participant addresses consistently across endpoints (#712) M2-L01: docs(protocol): clarify session-key authorization scope and metadata extensibility (#711) M2-M01: fix(clearnode): alert on home channel challenge instead of auto-checkpoint (#710) M2-H01: fix(contracts/ChannelHub): add finalize escrow home chain intent check (#704)
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.
Summary
Audit finding M2-L01 (Low) flagged that channel session keys are authorized today only by asset and expiration, with no per-action, channel, recipient, or spending-limit enforcement. We are acknowledging the finding without changing runtime behaviour for now, and tightening the protocol documentation so the actual scope is explicit and the metadata extension model is unambiguous.
Changes
docs/protocol/cryptography.md"scope, expiration and possible other data"phrasing with a reference to the canonically encoded authorization metadata structure.versionandexpires_atas the protocol-mandated minimum.versionis a replay / revocation guard — issuing a higher-version session-key state supersedes (revokes) prior ones — not a metadata-layout version.keccak256of the metadata into the authorization signature: implementations can extend the structure off-chain without on-chain validator changes and without invalidating session keys issued under earlier layouts.docs/protocol/terminology.mdassetsis intentionally not promoted to the protocol minimum — it is an existing implementation-level extension and remains documented as such by omission from the minimum scope and inclusion in the example list of optional restrictions.Test plan