Rule

source-claim-shielded-issuance-review

Review an explicit adjacent source claim paired with shielded issuance to a user key.

Release v0.1.1View Markdown

Specimen 40 of 96 · Policy-dependent rules

Severity
info
Confidence
varies
Maturity
experimental
Selection
Opt-in + policy
Policy intent
required
Release
v0.1.1
Engine facts used
explicit-source-claim-policy parser-owned-exact-adjacent-comment canonical-mint-invocation complete-original-successful-histories

Selection and scope#

Not selected by default. Select it with --detectors or the detectors list in nightshade.json, and declare the matching application intent in policies. Selecting it alone does not supply that intent.

Shell
./.nightshade/node_modules/.bin/nightshade ./contracts --detectors source-claim-shielded-issuance-review
./.nightshade/node_modules/.bin/nightshade detector show source-claim-shielded-issuance-review

The first command runs only this rule; --detectors takes a comma-separated list. The second prints the rule's metadata from your installed version.

Severity is review priority. It does not express exploitability or impact. Confidence is detector metadata, not a probability. All built-in rules are experimental.

Compiler scope: the engine supports the pinned profiles 0.28.0, 0.29.0, 0.30.0, 0.31.1, 0.33.0-rc.2, 0.34.0, 0.35.0-rc.1 and 0.35.0, with ZKIR2 by default. Support for this rule can be narrower; the rule documentation below states any narrower scope.

Corpus checks#

Synthetic corpus checks for this rule in the 0.1.1 proof run. A check counts only with compiler acceptance and complete analysis.

Positive detectedCorrected quietLookalike quietOther negative quietIncomplete
6/62/215/160/11

Deviations recorded for this rule:

CaseKindExpected to observed linesIssue
manifest.json / sourceClaims52/drafts/source-claims52/incomplete-unknown-tag.compactnegative[] to []incomplete or unvalidated
manifest.json / sourceClaims52/drafts/source-claims52/must-match-intentional-claim.compactlookalike[6] to [6]control hit

These are behavior checks on synthetic fixtures, not a precision or recall estimate. See evaluation.

Rule documentation#

From docs/detectors/source-claim-shielded-issuance-review.md at v0.1.1.

Availability: opt-in, policy-required; severity info. Select --detectors source-claim-shielded-issuance-review and configure an explicit policy:

JSON
{
  "sourceClaims": [{
    "kind": "non-transferable-shielded-issuance",
    "circuit": "issue",
    "quote": "// Contract claim: recipients cannot transfer issued coins to other parties."
  }]
}

A known benign mismatch is a policy quote that overstates transfer restrictions. It can yield an expected mismatch review. Confirm the claim's intended meaning and source location; the detector checks the supplied policy against represented code and does not infer broader transfer or deployment semantics.

The policy supplies claim meaning. The analyzer does not interpret prose or infer intent from names, paths, omitted transfer circuits, or other source conventions. The selector must resolve uniquely to a canonical exported circuit. The quote must equal one complete parser-owned comment, including delimiters, in that circuit's declaration file immediately before the declaration, with only whitespace between the comment and declaration. Arbitrary exact quotes are supported when the policy explicitly supplies this claim kind.

A finding pairs that comment with a canonical mintShieldedToken invocation on a complete modeled successful entry history whose fourth argument has exact native type Either<ZswapCoinPublicKey, ContractAddress> and an active left (user-key) tag. Literal tags and mandatory final successful-history Boolean constraints supply evidence, including checks after the mint. Helpers, aliases and nonempty callbacks use ordinary call transfers. Aborted histories and zero-iteration callbacks do not contribute successful invocations.

Compact 0.34.0/ZKIR2 or ZKIR3 is supported. Missing history evidence, opaque tags or layouts, unresolved calls, applicable unsupported profiles, checkpoints, unfinished baseline semantics and exhausted allowances produce incomplete rule-scoped diagnostics. Experimental Counter-query histories lack this rule's selected evidence and cannot certify a configured observation. Preparation, original-string UTF-8 adjacency inspection, capture, constraint matching and emission share 40,000 steps per entry, 256 paths per entry, and 50,000 cumulative values per rule, with no retry. Default and unselected scans do not run this rule.

Suppress a match#

If a match is intentional, suppress it on the line before with the exact rule ID and a reason of at least eight characters:

Compact
// nightshade-disable-next-line source-claim-shielded-issuance-review -- Reason this match is intentional

Diagnostics cannot be suppressed, and an unmatched directive for a selected rule makes analysis incomplete. See configuration for fingerprint suppressions and baselines.

References#