Skip to main content

Module identity_assertion

Module identity_assertion 

Source
Expand description

The identity assertion: the one byte layout by which a peer proves, over a link the platform established, that it holds the key its address derives from.

A Bluetooth LE peripheral serves it from the Identity characteristic (BLE framing), and a stream transport sends it as the first frame in each direction. The layout is fixed:

FieldSizeValue
public_key32The peer’s Ed25519 identity public key
signature64Ed25519 signature by that key over signed_data
signed_dataremainderThe bytes that signature covers, possibly empty

A reader refuses anything shorter than 96 bytes before any cryptography runs. signed_data carries no meaning at this layer: it is a message to sign, and nothing domain-separates it, so giving it meaning is a wire break. The chapter states both rules and the reasons.

§Why the codec is here and the verifier is not

This module splits and joins bytes. It does not check a signature or derive an address, because the sealed layer links no signature library (ADR 0022: SHA-256 is the only cryptography here). Verification, which is parse, verify the signature under the key, then derive the address from the key, lives where Ed25519 does, in offline-protocol-mls, and reaches bridges and applications as the verify_identity_assertion FFI function.

What the codec being here buys is one layout for every implementation. Before it existed the split was written three times, in Swift, in Kotlin and in Python, and the Python copy was not a split at all but a JSON document, which no phone could verify. A leaf node that answers a peer-stream preamble needs the same layout, and it cannot link the engine.

Structs§

IdentityAssertion
The three fields of a parsed assertion, borrowed from the bytes they were parsed out of.

Constants§

ED25519_SIGNATURE_LEN
Length of an Ed25519 signature, in bytes.
IDENTITY_ASSERTION_MIN_LEN
The shortest assertion a reader accepts: a key and a signature with an empty signed_data.

Functions§

encode_identity_assertion
Joins the three fields into the wire layout.
parse_identity_assertion
Splits the wire layout into its three fields.