Skip to content

Slice 144: N6 v0.1 verdicts (exit 7, the Ed25519 rule, the crossing) - #141

Merged
HackTuah merged 3 commits into
mainfrom
slice/144-n6-v01-verdicts
Oct 22, 2026
Merged

HackTuah merged 3 commits into
mainfrom
slice/144-n6-v01-verdicts

Conversation

@HackTuah

Copy link
Copy Markdown
Member

Slice 144: N6 v0.1 verdicts. A defect in bytes a verified signature covers is the signer's act (exit 7). Ed25519 is held to the publisher's rule. A receipt chain's crossing from v3 to v4 is reported.

What changes

  • Exit 7 (draft v0.1-r7 sections 9.2 and 9.3). Trinity.N6.Carrier.verify/2 reads the body only after the signature verifies. The first defect met there answers {:error, 7, {verdict, [nonconforming: code]}}:

    • accuse_single_signed_noncanonical for a codec defect (D0 to D18);
    • accuse_single_signed_nonconforming otherwise.

    Judging stops at the first defect, so there is at most one finding. With schemas: the whole body is checked (B1 to B8).

  • Receipts. Trinity.Receipts.V4 verifies a row's or checkpoint's carrier before decoding its body. A defect in a signed body was always exit 1 before; it is now exit 7.

    • The in-app verifier, mix trinity.receipts.verify and bin/verify_receipt.exs gain exit 7.
    • The task and the script print finding: nonconforming <code>, then verdict_code: <code> last.
  • Ed25519 (r7 section 5.3, decided 2026-10-21).

    • A key must decode strictly, must not be the identity, and [L]A must be the identity (key_invalid).
    • A signature's R must decode strictly and not be of small order, and S must be below L (signature_invalid).
    • These checks run before OpenSSL's equation. OpenSSL 3.0.13 and 3.5.9 accept the identity key with R the identity and S = 0 for every message.
  • The crossing (r7 section 3.9). The first v4 row after a v2 or v3 row adds the finding {:crossing, seq}. A v2 or v3 row after a v4 row is refused, {:legacy_after_n6, seq}. Both names are Trinity's until the profile names them.

Evidence

  • test/trinity/n6/verdicts_test.exs and test/trinity/receipts/verdicts_test.exs: 8 tests. Copied onto main (54498d5), 0 of 8 pass, each for the reason named in the slice. On this branch, 8 of 8.
  • The Ed25519 cases are built by test/support/ed25519_points.ex, an oracle independent of the module under test. It reproduces RFC 8032 test 1's public key from its seed.
  • Three new carrier samples in test/fixtures/n6: a format control in a signed body, R the identity, and the identity key. ed25519_no_issuer and ed25519_typ_schema_mismatch now expect exit 7 with one finding.
  • test/trinity/n6, test/trinity/receipts, test/trinity/crypto and test/mix: 279 passed.

…ding for a defect in verified bytes, the Ed25519 rule of r7 section 5.3, the v3-to-v4 crossing reported, no legacy row after an N6 row)

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…untime, and the tests no longer assume the runtime does Ed25519

Signed-off-by: Ayla Croft <aylacroft@proton.me>
…vers is exit 7, noncanonical

Signed-off-by: Ayla Croft <aylacroft@proton.me>
@HackTuah
HackTuah merged commit 1f9b9c1 into main Oct 22, 2026
15 of 16 checks passed
@HackTuah
HackTuah deleted the slice/144-n6-v01-verdicts branch October 22, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant