Skip to content

Introduce identity type map - #8263

Merged
Max (maxtropets) merged 11 commits into
mainfrom
f/multisign-part-1
Sep 3, 2026
Merged

Introduce identity type map#8263
Max (maxtropets) merged 11 commits into
mainfrom
f/multisign-part-1

Conversation

@maxtropets

Copy link
Copy Markdown
Collaborator

Opening #7848. This PR is part 1 of unknown.

Disclaimer. The new headers aren't exposed under public interface for now on purpose. It will be a job for the closing PR(s) to advertise this to the users, add the necessary changelog entries and documentation.

Adds (currently unused) IdentityType, IdentityKind, and Identity=IdentityKind+bytes.

@maxtropets Max (maxtropets) self-assigned this Sep 2, 2026
@maxtropets
Max (maxtropets) requested a balanced review from Copilot September 2, 2026 12:08
@maxtropets
Max (maxtropets) marked this pull request as ready for review September 2, 2026 12:12
@maxtropets
Max (maxtropets) requested a review from a team as a code owner September 2, 2026 12:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The persisted Identity field name differs from the linked target schema.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Introduces foundational identity types for the planned post-quantum identity migration.

Changes:

  • Adds identity enums, values, and JSON serialization.
  • Preserves the legacy EC384 KV key encoding.
  • Adds serialization and compatibility tests.

Custom instructions used:

  • .github/copilot-instructions.md
  • .github/instructions/reviewing.instructions.md
File summaries
File Description
src/service/tables/identity_types.h Defines identity types and serialization.
src/node/test/identity_types.cpp Tests JSON and KV serialization.
CMakeLists.txt Registers the new unit test.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/service/tables/identity_types.h
Comment thread src/node/test/identity_types.cpp
@maxtropets Max (maxtropets) added the run-long-test Run Long Test job label Sep 2, 2026
Comment thread src/service/tables/identity_types.h Outdated
Comment thread src/service/tables/identity_types.h Outdated
ES384 is the COSE algorithm the identity signs with, matching MLDSA65,
which is likewise named after its signature scheme rather than its key.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Max (maxtropets) and others added 3 commits September 2, 2026 14:52
IdentityType drops the parameter from its names: ES384 becomes ES, and
MLDSA65 becomes MLDSA.

The size cannot be part of the name because it is not a property of the
slot. The curve of the service identity comes from node_certificate.curve_id
(default Secp384R1, also accepts Secp256R1), which is passed straight to
NetworkIdentity when a service is started or recovered. A service configured
with Secp256R1 therefore signs with ES256 over SHA-256, and, since the
identity is recreated during recovery from the recovering node's
configuration, a service can change curve between epochs. An enum value
asserting 384 would be wrong in both cases. ES and MLDSA name the signature
scheme family, which is fixed for the slot; the parameters follow the key
and are already recoverable from it.

IdentityKind now names the encoding precisely: RawX509Cert becomes
X509_CERT_DER, and RawX509Key becomes X509_SPKI_DER. The latter is not an
X.509 certificate but a SubjectPublicKeyInfo, the structure produced by
i2d_PUBKEY and carried in a PEM public key, so the old name suggested more
than it held. Spelling out DER also makes it explicit that these are the
binary encodings, not PEM.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The comment named encodings which may never be added, and says nothing
about the two values which exist.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ES is the JOSE and COSE prefix for ECDSA with SHA-2, and is only meaningful
with a digest size attached: ES256, ES384, ES512 are registered, ES alone is
not. This enum names an identity rather than a signature, so it takes the
name of the scheme the identity belongs to. ECDSA pairs symmetrically with
MLDSA, and neither implies a curve or parameter set.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@maxtropets Max (maxtropets) removed the run-long-test Run Long Test job label Sep 2, 2026
Max (maxtropets) and others added 4 commits September 3, 2026 10:31
The identity in slot 0 is whatever the service was already signing with
before multiple identities existed, and that is not a fixed algorithm. Its
curve comes from node_certificate.curve_id, which accepts Secp384R1 and
Secp256R1, and the identity is recreated from the recovering node's
configuration during recovery, so it can differ between epochs. Naming the
slot after an algorithm makes a claim about existing ledgers which cannot be
checked and need not hold.

CLASSICAL and PQ name the property the slot exists to express: whether the
identity is vulnerable to a cryptographically relevant quantum computer. The
concrete algorithm, curve and parameter set stay where they are already
recorded, in the key itself.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@maxtropets
Max (maxtropets) enabled auto-merge (squash) September 3, 2026 10:42
@maxtropets
Max (maxtropets) merged commit 8d7d7d7 into main Sep 3, 2026
13 checks passed
@maxtropets
Max (maxtropets) deleted the f/multisign-part-1 branch September 3, 2026 11:03
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.

3 participants