A copy of the bytes; mutating it does not touch this value.
StaticcodecTagged-CBOR codec; decode also accepts the untagged form.
StaticfromStaticfromStaticrandomGenerate a random XID (for testing purposes).
Note: In practice, XIDs should be created from the SHA-256 hash of a public signing key's CBOR encoding.
StaticfromDerived from the SHA-256 digest of the key's tagged CBOR.
StaticfromThe XID is derived from the bundle's signing public key.
StaticfromStatictryThe XID is derived from the corresponding public key.
Validate the XID against the given public key.
Returns true if the SHA-256 hash of the key's CBOR encoding matches
the XID data. This matches the reference implementation's XID::validate(&self, key: &SigningPublicKey).
Get hex string representation (lowercase, as the reference implementation does implementation).
Get base64 representation.
Get short description (first 4 bytes) as hex.
Get short reference (first 4 bytes) as hex (alias for shortDescription).
Get the first four bytes of the XID as upper-case ByteWords.
If true, prepends the XID prefix "🅧 "
Space-separated uppercase bytewords, e.g., "🅧 URGE DICE GURU IRIS"
Get the first four bytes of the XID as Bytemoji.
If true, prepends the XID prefix "🅧 "
Space-separated emojis, e.g., "🅧 🐻 😻 🍞 💐"
XIDProvider impl — returns this XID.
ReferenceProvider impl — produces a Reference whose 32 bytes are the raw XID data.
Reference { Reference::from_data(*self.bytes) } }` — note this is a direct wrap, not a SHA-256 hash of the XID.
Get string representation (short format, as the reference implementation does Display). Uses first 4 bytes of the XID as hex, e.g., "XID(71274df1)".
The CBOR tags this type decodes from; the first one is used to encode.
Returns the untagged CBOR encoding (as a byte string).
The tagged CBOR form.
As a UR, typed by the first tag's name.
Staticfrom
eXtensible Identifier (XID) - 32-byte identifier bound to a public key
A XID is a unique 32-byte identifier for a subject entity (person, organization, device, or any other entity). XIDs have the following characteristics:
A XID is created by taking the SHA-256 hash of the CBOR encoding of a public signing key. This ensures the XID is cryptographically tied to the key.
As defined in BCR-2024-010.
CBOR Serialization
XIDis serialized to CBOR with tag 40024 (standard XID tag).UR Serialization
When serialized as a Uniform Resource (UR), a
XIDis represented with the type "xid".