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: Record<Owner = <Self::Account as AccountScheme>::AccountAddress>;
    type SystemParameters;
    type Transaction: Transaction<SerialNumber = <Self::Record as Record>::SerialNumber>;
    type TransactionKernel;
    fn setup<R: Rng>(
        ledger_parameters: &L::MerkleParameters,
        rng: &mut R
    ) -> Result<Self::NetworkParameters>;
fn create_account<R: Rng>(
        parameters: &Self::SystemParameters,
        rng: &mut R
    ) -> Result<Self::Account>;
fn execute_offline<R: Rng>(
        parameters: Self::SystemParameters,
        old_records: Vec<Self::Record>,
        old_account_private_keys: Vec<<Self::Account as AccountScheme>::AccountPrivateKey>,
        new_record_owners: Vec<<Self::Account as AccountScheme>::AccountAddress>,
        new_is_dummy_flags: &[bool],
        new_values: &[u64],
        new_payloads: Vec<Self::Payload>,
        new_birth_program_ids: Vec<Vec<u8>>,
        new_death_program_ids: Vec<Vec<u8>>,
        memorandum: <Self::Transaction as Transaction>::Memorandum,
        network_id: u8,
        rng: &mut R
    ) -> Result<Self::TransactionKernel>;
fn execute_online<R: Rng>(
        parameters: &Self::NetworkParameters,
        transaction_kernel: Self::TransactionKernel,
        old_death_program_proofs: Vec<Self::PrivateProgramInput>,
        new_birth_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
    ) -> Result<bool>;
fn verify_transactions(
        parameters: &Self::NetworkParameters,
        block: &[Self::Transaction],
        ledger: &L
    ) -> Result<bool>; }

Associated Types

Loading content...

Required methods

fn setup<R: Rng>(
    ledger_parameters: &L::MerkleParameters,
    rng: &mut R
) -> Result<Self::NetworkParameters>
[src]

Returns public parameters for the DPC.

fn create_account<R: Rng>(
    parameters: &Self::SystemParameters,
    rng: &mut R
) -> Result<Self::Account>
[src]

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

fn execute_offline<R: Rng>(
    parameters: Self::SystemParameters,
    old_records: Vec<Self::Record>,
    old_account_private_keys: Vec<<Self::Account as AccountScheme>::AccountPrivateKey>,
    new_record_owners: Vec<<Self::Account as AccountScheme>::AccountAddress>,
    new_is_dummy_flags: &[bool],
    new_values: &[u64],
    new_payloads: Vec<Self::Payload>,
    new_birth_program_ids: Vec<Vec<u8>>,
    new_death_program_ids: Vec<Vec<u8>>,
    memorandum: <Self::Transaction as Transaction>::Memorandum,
    network_id: u8,
    rng: &mut R
) -> Result<Self::TransactionKernel>
[src]

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

fn execute_online<R: Rng>(
    parameters: &Self::NetworkParameters,
    transaction_kernel: Self::TransactionKernel,
    old_death_program_proofs: Vec<Self::PrivateProgramInput>,
    new_birth_program_proofs: Vec<Self::PrivateProgramInput>,
    ledger: &L,
    rng: &mut R
) -> Result<(Vec<Self::Record>, Self::Transaction)>
[src]

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

fn verify(
    parameters: &Self::NetworkParameters,
    transaction: &Self::Transaction,
    ledger: &L
) -> Result<bool>
[src]

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

fn verify_transactions(
    parameters: &Self::NetworkParameters,
    block: &[Self::Transaction],
    ledger: &L
) -> Result<bool>
[src]

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

Loading content...

Implementors

impl<Components: BaseDPCComponents, L: LedgerScheme> DPCScheme<L> for DPC<Components> where
    L: LedgerScheme<Commitment = <Components::RecordCommitment as CommitmentScheme>::Output, MerkleParameters = Components::MerkleParameters, MerklePath = MerklePath<Components::MerkleParameters>, MerkleTreeDigest = MerkleTreeDigest<Components::MerkleParameters>, SerialNumber = <Components::AccountSignature as SignatureScheme>::PublicKey, Transaction = DPCTransaction<Components>>, 
[src]

type Account = Account<Components>

type LocalData = LocalData<Components>

type NetworkParameters = PublicParameters<Components>

type Payload = <Self::Record as Record>::Payload

type PrivateProgramInput = PrivateProgramInput

type Record = DPCRecord<Components>

type SystemParameters = SystemParameters<Components>

type Transaction = DPCTransaction<Components>

type TransactionKernel = TransactionKernel<Components>

fn verify_transactions(
    parameters: &Self::NetworkParameters,
    transactions: &[Self::Transaction],
    ledger: &L
) -> Result<bool>
[src]

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

Loading content...