# resettable-memo-nonce-review

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

Canonical: https://nightshade.dicksonwu.xyz/rules/resettable-memo-nonce-review.html
Release: Nightshade 0.1.1 (v0.1.1)

| Field | Value |
| --- | --- |
| Rule ID | `resettable-memo-nonce-review` |
| Severity | info |
| Confidence | high |
| Maturity | experimental |
| Selection | Opt-in |
| Policy intent | not required |
| Default enabled | no |
| Category | Other active opt-ins / State and collections |
| Engine facts used | canonical-mint-observations, memo-append-observations, completed-entries, cross-entry-state-writes |
| Release | v0.1.1 |

## 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.

```sh
./.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 detected | Corrected quiet | Lookalike quiet | Other negative quiet | Incomplete |
| ---: | ---: | ---: | ---: | ---: |
| 2/2 | 2/2 | 7/7 | 0/0 | 0 |

No deviations were recorded for this rule.

These are behavior checks on synthetic fixtures, not a precision or recall estimate. See [evaluation](https://nightshade.dicksonwu.xyz/evaluation.md#synthetic-corpus).

## Rule documentation

From https://github.com/DicksonWu654/nightshade/blob/v0.1.1/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](https://nightshade.dicksonwu.xyz/configuration.md#suppress-an-intentional-match) for fingerprint suppressions and baselines.

## References

- [Rule source document at v0.1.1](https://github.com/DicksonWu654/nightshade/blob/v0.1.1/docs/detectors/resettable-memo-nonce-review.md)
- [Catalog entry in rules.json](https://nightshade.dicksonwu.xyz/rules.json)
- [All rules](https://nightshade.dicksonwu.xyz/rules.md#state-and-collections)
- [Limitations](https://nightshade.dicksonwu.xyz/limitations.md)
