Rule

resettable-memo-nonce-review

Stored recipient List payload and canonical coin nonce both evolve from the same resettable selected List extent.

Release v0.1.1View Markdown

Specimen 86 of 96 · Other active opt-ins / State and collections

Severity
info
Confidence
high
Maturity
experimental
Selection
Opt-in
Policy intent
not required
Release
v0.1.1
Engine facts used
canonical-mint-observations memo-append-observations completed-entries cross-entry-state-writes

Selection and scope#

Not selected by default. Select it with --detectors or the detectors list in nightshade.json. Either one replaces profile selection, so list every rule you want.

Shell
./.nightshade/node_modules/.bin/nightshade ./contracts --detectors resettable-memo-nonce-review
./.nightshade/node_modules/.bin/nightshade detector show resettable-memo-nonce-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
2/22/27/70/00

No deviations were recorded for this rule.

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

Rule documentation#

From docs/detectors/resettable-memo-nonce-review.md at v0.1.1.

Availability: opt-in. Severity: info. Confidence: high.

The initial scope is Map<Bytes<32>, List<Bytes<32>>>. The selected immutable key must equal the active account recipient's represented ZswapCoinPublicKey.bytes, through source operands or required successful equalities. Exact immutable lookup operands identify the source and destination within a history. A shared wildcard storage path never establishes their equality. Dynamic keys in separate entry histories establish only reset may-overlap; distinct literal reset selectors do not qualify. Replacements proven to target an absent slot or already-empty current List do not establish a restart; unknown initial storage is not assumed empty. An acknowledged nonzero count can still reset the extent and remains in scope.

Select the rule explicitly:

JSON
{"version":1,"detectors":["resettable-memo-nonce-review"]}

No memo or encryption purpose is inferred from a List name or stored bytes. The finding states that the same resettable extent supplies both a canonical coin nonce and a directly stored evolved payload. Its protocol role requires review. An opaque payload does not represent memo construction or encryption use. An arbitrary stored hash, encoded index, nonce identifier or marker does not establish the paired relation. Fresh seeds, mixed/arithmetic indices, transformed payloads, noncanonical namesakes, another append receiver, different source revisions, exclusive histories and aborted resets do not qualify. Root Lists, nested Maps, contract recipients and unconstrained recipient relations are outside this narrow review.

Quiet output concerns this paired relation only. In particular, a fresh coin nonce alongside a resettable length-derived stored payload is quiet because one consumer is independent; it does not establish memo uniqueness. An independent Counter used for both consumers avoids this paired resettable-length relationship.

The rule does not establish actual recurrence, successful transactions, one-time pad use, encryption/decryption, confidentiality impact, authorization intent or production implementation correspondence. Use of a resettable extent is not by itself proof that a stored value requires security randomness. Severity remains informational and default activation is unchanged.

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 resettable-memo-nonce-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#