Skip to main content

Transcript

Struct Transcript 

Source
pub struct Transcript<'material> { /* private fields */ }
Expand description

The COMPLETE preimage one Identity is derived from.

A transcript is the exact byte string handed to the digest, and the specification is complete: an independent implementation needs what follows and nothing else.

Two primitives. u32be(n) and u64be(n) are the integer in four or eight big-endian bytes; bytes(x) is u64be(x.len()) followed by the bytes of x, and every variable-length member is written that way, so no two member sequences can be cut at a different boundary and produce one byte string.

The members, in exactly this order, with no separators and no padding:

#memberencoding
1profile stembytes(utf8) of Profile::stem
2profile namebytes(utf8) of Profile::name
3profile versionu32be, that grammar’s own position
4subjectbytes(utf8) of Subject::NAME
5rolebytes(utf8) of Role::name
6role slotone byte, Role::slot
7anchoringone byte, Anchoring::slot
8anchorbytes(…) — empty when rooted, else the full thirty-two
9materialbytes(…) — the full material, never a fold
10positionu32be

The derive-key context is Profile::context_for over the same subject and role, and the identity is blake3::derive_key(context, transcript). The subject’s stem is a segment of that context and is not a member here, so two subjects spelled alike under different stems derive under different keys. The generator is not a member either: it is carried for the derivation record (Transcript::provenance) and written into no preimage.

Implementations§

Source§

impl Transcript<'_>

Source

pub fn encoded<S: Subject>(&self) -> Vec<u8>

The transcript’s bytes for one identity subject, exactly as the specification on Transcript states them.

§Authority

The subject is the TYPE’s and never an argument. Member four of the preimage is the subject’s declared name, and it is part of what separates one subject’s identities from another’s — so an encoder that took the name as text would let a caller write member four to any key space it could spell, and the typed identity above it would be a promise this road never had to keep.

Source§

impl<'material> Transcript<'material>

Source

pub const fn under_profile( profile: Profile, role: Role, anchoring: Anchoring, material: &'material [u8], position: u32, ) -> Self

Write a transcript under a grammar the caller names.

The road for a preimage whose grammar is the caller’s own; the four roads below name a role and take this compiler’s grammar for it.

Source

pub const fn under( role: Role, anchoring: Anchoring, material: &'material [u8], position: u32, ) -> Self

Write a transcript under an anchoring the caller already decided.

The road for a mint site whose anchor depends on a typed posture rather than on which family of identity it holds — a plan hangs off whatever caused it, and what caused it is a sum type.

Source

pub const fn rooted( role: Role, material: &'material [u8], position: u32, ) -> Self

Derive under no anchor at all — the root of one derivation chain.

Source

pub const fn under_owner( role: Role, anchor: &OwnerIdentity, material: &'material [u8], position: u32, ) -> Self

Derive under an identity a CONSUMER minted.

Source

pub fn under_projection<S: Subject>( role: Role, anchor: &Identity<S>, material: &'material [u8], position: u32, ) -> Self

Derive under another identity this compiler derived.

Source

pub const fn profile(&self) -> Profile

The grammar this transcript is written under.

Source

pub const fn generator(&self) -> GeneratorIdentity

The generator this transcript records.

Recorded and never written: the encoding carries no member for it, and this road exists so the derivation record can.

Source

pub const fn role(&self) -> Role

The seat this transcript stands in.

Source

pub const fn anchoring(&self) -> Anchoring

What this transcript hangs off.

Source

pub const fn material(&self) -> &'material [u8]

The varying material, at full length.

Source

pub const fn position(&self) -> u32

The position inside the anchor’s declared sequence.

Source

pub fn provenance<S: Subject>(&self) -> Provenance

The derivation record this transcript leaves for one identity subject.

Trait Implementations§

Source§

impl<'material> Clone for Transcript<'material>

Source§

fn clone(&self) -> Transcript<'material>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'material> Copy for Transcript<'material>

Source§

impl<'material> Debug for Transcript<'material>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'material> Eq for Transcript<'material>

Source§

impl<'material> Hash for Transcript<'material>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'material> PartialEq for Transcript<'material>

Source§

fn eq(&self, other: &Transcript<'material>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'material> StructuralPartialEq for Transcript<'material>

Auto Trait Implementations§

§

impl<'material> Freeze for Transcript<'material>

§

impl<'material> RefUnwindSafe for Transcript<'material>

§

impl<'material> Send for Transcript<'material>

§

impl<'material> Sync for Transcript<'material>

§

impl<'material> Unpin for Transcript<'material>

§

impl<'material> UnsafeUnpin for Transcript<'material>

§

impl<'material> UnwindSafe for Transcript<'material>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.