Trait snarkvm_dpc::traits::dpc::DPCScheme[][src]

pub trait DPCScheme<L: LedgerScheme>: Sized {
    type Account: AccountScheme;
    type LocalData;
    type Execution;
    type Record: RecordScheme<Owner = <Self::Account as AccountScheme>::Address>;
    type SystemParameters;
    type Transaction: TransactionScheme<SerialNumber = <Self::Record as RecordScheme>::SerialNumber>;
    type TransactionKernel;
    fn setup<R: Rng + CryptoRng>(
        ledger_parameters: &Arc<L::MerkleParameters>,
        rng: &mut R
    ) -> Result<Self>;
fn load(verify_only: bool) -> Result<Self>;
fn create_account<R: Rng + CryptoRng>(
        &self,
        rng: &mut R
    ) -> Result<Self::Account>;
fn execute_offline_phase<R: Rng + CryptoRng>(
        &self,
        old_private_keys: &Vec<<Self::Account as AccountScheme>::PrivateKey>,
        old_records: Vec<Self::Record>,
        new_records: Vec<Self::Record>,
        memorandum: <Self::Transaction as TransactionScheme>::Memorandum,
        rng: &mut R
    ) -> Result<Self::TransactionKernel>;
fn execute_online_phase<R: Rng + CryptoRng>(
        &self,
        old_private_keys: &Vec<<Self::Account as AccountScheme>::PrivateKey>,
        transaction_kernel: Self::TransactionKernel,
        program_proofs: Vec<Self::Execution>,
        ledger: &L,
        rng: &mut R
    ) -> Result<(Vec<Self::Record>, Self::Transaction)>;
fn verify(&self, transaction: &Self::Transaction, ledger: &L) -> bool;
fn verify_transactions(
        &self,
        block: &[Self::Transaction],
        ledger: &L
    ) -> bool; }

Associated Types

Required methods

Initializes a new instance of DPC.

Loads the saved instance of DPC.

Returns an account, given the system parameters, metadata, and an RNG.

Returns the execution context required for program snark and DPC transaction generation.

Returns new records and a transaction based on the authorized consumption of old records.

Returns true iff the transaction is valid according to the ledger.

Returns true iff all the transactions in the block are valid according to the ledger.

Implementors