CharterAgreementProtocol.Algorithm (Charter Agreement Protocol v0.2.0)

Copy Markdown View Source

CAP never authorizes.

The closed algorithm registry — one row per accepted JWS alg name.

This table IS the algorithm registry spec/evolution.md describes as data-driven: a new algorithm lands by the same registry-and-revision act (a row here plus the key grammar its key_algorithm column requires), never by a parallel artifact family, media type, or header shape. Each row carries the accepted alg name, the minimum protocol_revision the name is legal at, and the key algorithm it verifies with.

For revisions 1–2 both rows verify with Ed25519 keys: RFC 9864's fully-specified Ed25519 names exactly the RFC 8032 EdDSA-with-Ed25519-key operation CAP already performs — the two names are one cryptographic operation with two spellings, which is why the registry adds a name here without touching the key grammar or the verification path.

The binding rule (per-artifact, not per-view)

Decoding accepts alg: "EdDSA" at any accepted protocol_revision; alg: "Ed25519" requires protocol_revision >= 2; unknown revisions fail closed. An artifact carrying Ed25519 at revision 1 is rejected — no honest producer could have minted it (revision 1 closed the header to EdDSA). Views mix revisions freely; the rule binds per artifact.

Emission

New minting is exactly ("Ed25519", protocol_revision 2): the signing-input producer emits the fully-specified name at the current revision. Old artifacts verify forever; nothing new mints a registry-deprecated identifier (RFC 9864 marks EdDSA Deprecated, not Prohibited — see docs/adr/algorithm-name-agility.md).

Summary

Functions

Whether the name is a registry row (any revision).

The accepted protocol_revision set (unknown revisions fail closed).

Whether the (alg, protocol_revision) pair is legal on ONE artifact.

The alg name every newly minted artifact carries.

The protocol_revision every newly minted artifact carries.

The closed registry (one row per accepted alg name).

Types

row()

@type row() :: %{
  name: binary(),
  min_protocol_revision: pos_integer(),
  key_algorithm: binary()
}

Functions

accepted_name?(name)

@spec accepted_name?(term()) :: boolean()

Whether the name is a registry row (any revision).

accepted_protocol_revisions()

@spec accepted_protocol_revisions() :: [pos_integer()]

The accepted protocol_revision set (unknown revisions fail closed).

binds?(name, protocol_revision)

@spec binds?(term(), term()) :: boolean()

Whether the (alg, protocol_revision) pair is legal on ONE artifact.

The binding rule: the name must be a registry row, the revision must be accepted, and the revision must meet the row's minimum. Revision range alone is separately enforced by the per-artifact schemas; this check binds the name to the revision.

emission_name()

@spec emission_name() :: binary()

The alg name every newly minted artifact carries.

emission_protocol_revision()

@spec emission_protocol_revision() :: pos_integer()

The protocol_revision every newly minted artifact carries.

registry()

@spec registry() :: [row()]

The closed registry (one row per accepted alg name).