Struct sp_consensus_babe::Transcript[][src]

pub struct Transcript { /* fields omitted */ }
Expand description

A transcript of a public-coin argument.

The prover’s messages are added to the transcript using append_message, and the verifier’s challenges can be computed using challenge_bytes.

Creating and using a Merlin transcript

To create a Merlin transcript, use Transcript::new(). This function takes a domain separation label which should be unique to the application.

To use the transcript with a Merlin-based proof implementation, the prover’s side creates a Merlin transcript with an application-specific domain separation label, and passes a &mut reference to the transcript to the proving function(s).

To verify the resulting proof, the verifier creates their own Merlin transcript using the same domain separation label, then passes a &mut reference to the verifier’s transcript to the verification function.

Implementing proofs using Merlin

For information on the design of Merlin and how to use it to implement a proof system, see the documentation at merlin.cool, particularly the Using Merlin section.

Implementations

Initialize a new transcript with the supplied label, which is used as a domain separator.

Note

This function should be called by a proof library’s API consumer (i.e., the application using the proof library), and not by the proof implementation. See the Passing Transcripts section of the Merlin website for more details on why.

Append a prover’s message to the transcript.

The label parameter is metadata about the message, and is also appended to the transcript. See the Transcript Protocols section of the Merlin website for details on labels.

👎 Deprecated since 1.1.0:

renamed to append_message for clarity.

Deprecated. This function was renamed to append_message.

This is intended to avoid any possible confusion between the transcript-level messages and protocol-level commitments.

Convenience method for appending a u64 to the transcript.

The label parameter is metadata about the message, and is also appended to the transcript. See the Transcript Protocols section of the Merlin website for details on labels.

Implementation

Calls append_message with the 8-byte little-endian encoding of x.

👎 Deprecated since 1.1.0:

renamed to append_u64 for clarity.

Deprecated. This function was renamed to append_u64.

This is intended to avoid any possible confusion between the transcript-level messages and protocol-level commitments.

Fill the supplied buffer with the verifier’s challenge bytes.

The label parameter is metadata about the challenge, and is also appended to the transcript. See the Transcript Protocols section of the Merlin website for details on labels.

Fork the current Transcript to construct an RNG whose output is bound to the current transcript state as well as prover’s secrets.

See the TranscriptRngBuilder documentation for more details.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

We delegate SigningTranscript methods to the corresponding inherent methods of merlin::Transcript and implement two witness methods to avoid abrtasting the merlin::TranscriptRng machenry.

Extend transcript with some bytes, shadowed by merlin::Transcript.

Produce some challenge bytes, shadowed by merlin::Transcript.

Produce secret witness bytes from the protocol transcript and any “nonce seeds” kept with the secret keys. Read more

Extend transcript with a protocol name

Extend the transcript with a compressed Ristretto point

Produce the public challenge scalar e.

Produce a secret witness scalar k, aka nonce, from the protocol transcript and any “nonce seeds” kept with the secret keys. Read more

Produce secret witness bytes from the protocol transcript and any “nonce seeds” kept with the secret keys. Read more

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert from a value of T into an equivalent instance of Option<Self>. Read more

Consume self to return Some equivalent value of Option<T>. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

Should always be Self

Convert from a value of T into an equivalent instance of Self. Read more

Consume self to return an equivalent value of T. Read more

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The counterpart to unchecked_from.

Consume self to return an equivalent value of T.

Real underlying SigningTranscript

Return the underlying SigningTranscript after addressing VRF output malleability, usually by making it non-malleable, Read more