CryptoKey class
Represents cryptographic key information.
The publication paradigm is "literal public keys, not derivation material": a published EPM carries the PUBLIC_KEY bytes that verify the record's SIGNATURE (signing) or encrypt to the entity (encryption), and NOTHING about how those keys were derived. XPUB, KEY_PATH and KEY_ADDRESS are PRIVATE / operational — they belong to the wallet that produced the keys, never to the record a peer resolves.
Requiredness is PROFILE-ENFORCED, never a flatc (required) attribute:
a (required) on PUBLIC_KEY would make the flatbuffers Verifier reject
every pre-flip secp256k1 record that legitimately omitted it (the
2026-07-27 dual-curve regime allowed xpub-derivation for secp at
non-hardened paths). A published record is self-describing instead —
PUBLIC_KEY present, XPUB/KEY_PATH/KEY_ADDRESS absent — and a conformance
checker asserts that profile (see scripts/check-epm-published-profile.mjs).
Rotation is by republish: a new signing or encryption key means a new PUBLIC_KEY, a re-signed SIGNATURE, and a re-published EPM at the same peer-addressed location. The PeerID (multihash of the libp2p identity pubkey) is the stable anchor across rotations.
Properties
- ADDRESS_TYPE → String?
-
Type of the address generated from the cryptographic key. An address
format tag only — NOT a curve or algorithm designator; the algorithm
lives in ALGORITHM
no setter
- addressType → String?
-
no setter
- ALGORITHM → String?
-
Key algorithm/curve (e.g., "ed25519", "secp256k1"). ABSENT means
ed25519: every record published before this field existed verifies
unchanged under that default. The verifier dispatches on ALGORITHM (not
on ADDRESS_TYPE, which is an address-format tag only).
no setter
- ENCODING → String?
-
Signature encoding format produced by this key (e.g., "raw-ed25519",
"der"). ABSENT means the canonical encoding of ALGORITHM: raw-ed25519
for ed25519 (64 bytes over the content itself); der for secp256k1, a
strict DER ECDSA signature over ONE SHA-256 of the canonical signing
content (CANONICAL_SERIALIZATION.md section 4). The signer passes the
content to a hashing signer, or its single SHA-256 to a digest signer,
never a digest to a hashing signer: ECDSA over SHA-256(SHA-256(content))
does not verify. "compact" (65-byte header||r||s) is a ChainProof
encoding only, never the EPM signature's
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- KEY_ADDRESS → String?
-
Address generated from the cryptographic key. PRIVATE / operational in a
published EPM: a chain address is bound through a ChainProof attestation,
not carried as a standalone KEY_ADDRESS on the CryptoKey. ABSENT from
published records.
no setter
- KEY_PATH → String?
-
BIP-32 / SLIP-10 derivation path of this key from the entity root
(e.g., "m/44'/0'/0'/0/0" secp256k1 non-hardened, "m/44'/0'/0'/0'/0'"
ed25519 hardened). PRIVATE / operational: how the key was derived belongs
to the wallet, not to a published record. ABSENT from published records.
no setter
- KEY_TYPE → KeyType
-
Type of the cryptographic key (signing or encryption)
no setter
- keyAddress → String?
-
no setter
- keyPath → String?
-
no setter
- keyType → KeyType
-
no setter
- PRIVATE_KEY → String?
-
Private part of the cryptographic key in hexidecimal format, should be kept secret
no setter
- privateKey → String?
-
no setter
- PUBLIC_KEY → String?
-
Public part of the cryptographic key, in hexadecimal format. AUTHORITATIVE
in a published record: this is the verifying/encrypting key, and no other
field yields it. Required-in-practice (profile-enforced, not flatc
(required)) so that pre-flip secp256k1 records without it still decode.no setter - publicKey → String?
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- XPRIV → String?
-
Extended private key, as specified by BIP-32 (hierarchical deterministic wallets), "Extended keys".
no setter
- XPUB → String?
-
Extended public key, as specified by BIP-32 (hierarchical deterministic
wallets), "Extended keys". PRIVATE / operational: present only in the
wallet that derived the keys, ABSENT from published records. A verifier
never derives a child key from XPUB — the PUBLIC_KEY is the verification
material.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited