pub struct PrecompileCommitment { /* private fields */ }Expand description
A commitment to the evaluation of PrecompileRequest, representing both the input and result
of the request.
This structure contains both the tag (which includes metadata like event ID) and the commitment to the input and result (calldata) of the precompile request.
§Tag Structure
The tag is a 4-element word [event_id, meta1, meta2, meta3] where:
- First element: The
EventIdfrom the correspondingEventHandler - Remaining 3 elements: Available for precompile-specific metadata (e.g.,
len_bytesfor hash functions to distinguish actual data from padding)
Implementations§
Source§impl PrecompileCommitment
impl PrecompileCommitment
Sourcepub fn new(tag: Word, comm: Word) -> Self
pub fn new(tag: Word, comm: Word) -> Self
Creates a new precompile commitment from a TAG and COMM.
TAG: 4-element word where the first element encodes theEventId; the remaining elements are available as precompile-specific metadata (e.g.,len_bytes).COMM: 4-element word containing the commitment to the calldata (or handler-specific witness) for this precompile request.
Sourcepub fn tag(&self) -> Word
pub fn tag(&self) -> Word
Returns the TAG word which encodes the EventId in the first element and optional
precompile-specific metadata in the remaining three elements.
Sourcepub fn comm_calldata(&self) -> Word
pub fn comm_calldata(&self) -> Word
Returns the COMM word (calldata commitment), i.e., the commitment to the precompile’s
calldata (or other handler-specific witness).
Sourcepub fn to_elements(&self) -> [Felt; 8]
pub fn to_elements(&self) -> [Felt; 8]
Returns the concatenation of TAG and COMM as field elements.
Trait Implementations§
Source§impl Clone for PrecompileCommitment
impl Clone for PrecompileCommitment
Source§fn clone(&self) -> PrecompileCommitment
fn clone(&self) -> PrecompileCommitment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrecompileCommitment
impl Debug for PrecompileCommitment
Source§impl PartialEq for PrecompileCommitment
impl PartialEq for PrecompileCommitment
impl Copy for PrecompileCommitment
impl Eq for PrecompileCommitment
impl StructuralPartialEq for PrecompileCommitment
Auto Trait Implementations§
impl Freeze for PrecompileCommitment
impl RefUnwindSafe for PrecompileCommitment
impl Send for PrecompileCommitment
impl Sync for PrecompileCommitment
impl Unpin for PrecompileCommitment
impl UnwindSafe for PrecompileCommitment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more