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

pub trait DPCScheme<L: LedgerScheme> {
    type Account: AccountScheme;
    type LocalData;
    type NetworkParameters;
    type Payload;
    type PrivateProgramInput;
    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::NetworkParameters>;
fn create_account<R: Rng + CryptoRng>(
        parameters: &Self::SystemParameters,
        rng: &mut R
    ) -> Result<Self::Account>;
fn execute_offline_phase<R: Rng + CryptoRng>(
        parameters: Self::SystemParameters,
        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>(
        parameters: &Self::NetworkParameters,
        old_private_keys: &Vec<<Self::Account as AccountScheme>::PrivateKey>,
        transaction_kernel: Self::TransactionKernel,
        program_proofs: Vec<Self::PrivateProgramInput>,
        ledger: &L,
        rng: &mut R
    ) -> Result<(Vec<Self::Record>, Self::Transaction)>;
fn verify(
        parameters: &Self::NetworkParameters,
        transaction: &Self::Transaction,
        ledger: &L
    ) -> bool;
fn verify_transactions(
        parameters: &Self::NetworkParameters,
        block: &[Self::Transaction],
        ledger: &L
    ) -> bool; }

Associated Types

Required methods

Returns public parameters for the 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