Struct miden_objects::transaction::TransactionWitness
source · pub struct TransactionWitness { /* private fields */ }Expand description
Transaction witness contains all the data required to execute and prove a Miden rollup transaction.
The main purpose of the transaction witness is to enable stateless re-execution and proving of transactions.
A transaction witness consists of:
- The executable transaction Program.
- Transaction inputs which contain information about the initial state of the account, input notes, block header etc.
- An optional transaction script.
- Advice witness which contains all data requested by the VM from the advice provider while executing the transaction program.
TODO: currently, the advice witness contains redundant and irrelevant data (e.g., tx inputs and tx outputs). we should optimize it to contain only the minimum data required for executing/proving the transaction.
Implementations§
source§impl TransactionWitness
impl TransactionWitness
sourcepub fn new(
program: Program,
tx_inputs: TransactionInputs,
tx_args: TransactionArgs,
advice_witness: AdviceInputs
) -> Self
pub fn new( program: Program, tx_inputs: TransactionInputs, tx_args: TransactionArgs, advice_witness: AdviceInputs ) -> Self
Creates a new TransactionWitness from the provided data.
sourcepub fn account(&self) -> &Account
pub fn account(&self) -> &Account
Returns the account state before the transaction was executed.
sourcepub fn input_notes(&self) -> &InputNotes
pub fn input_notes(&self) -> &InputNotes
Returns the notes consumed in this transaction.
sourcepub fn block_header(&self) -> &BlockHeader
pub fn block_header(&self) -> &BlockHeader
Returns the block header for the block against which the transaction was executed.
sourcepub fn tx_args(&self) -> &TransactionArgs
pub fn tx_args(&self) -> &TransactionArgs
Returns a reference to the transaction args.
sourcepub fn tx_inputs(&self) -> &TransactionInputs
pub fn tx_inputs(&self) -> &TransactionInputs
Returns a reference to the inputs for this transaction.
sourcepub fn advice_witness(&self) -> &AdviceInputs
pub fn advice_witness(&self) -> &AdviceInputs
Returns all the data requested by the VM from the advice provider while executing the transaction program.