pub trait Network: 'static + Environment + Copy + Clone + Debug + Eq + PartialEq<Self> + Hash + Serialize + DeserializeOwned + for<'a> Deserialize<'a> + Send + Sync {
    type StateRoot: Bech32ID<Field<Self>>;
    type BlockHash: Bech32ID<Field<Self>>;
    type TransactionID: Bech32ID<Field<Self>>;
    type TransitionID: Bech32ID<Field<Self>>;
Show 29 associated constants and 53 methods const ID: u16; const NAME: &'static str; const EDITION: u16; const INCLUSION_FUNCTION_NAME: &'static str; const GENESIS_TIMESTAMP: i64 = 1_680_307_200i64; const GENESIS_COINBASE_TARGET: u64 = 4_095u64; const GENESIS_PROOF_TARGET: u64 = 32u64; const STARTING_SUPPLY: u64 = 1_500_000_000_000_000u64; const DEPLOYMENT_FEE_MULTIPLIER: u64 = 1_000u64; const MAX_FEE: u64 = 1_000_000_000_000_000u64; const ANCHOR_TIME: u16 = 25u16; const COINBASE_PUZZLE_DEGREE: u32 = 8_191u32; const MAX_PROVER_SOLUTIONS: usize = 256usize; const NUM_BLOCKS_PER_EPOCH: u32 = 256u32; const MAX_DATA_ENTRIES: usize = 32usize; const MAX_DATA_DEPTH: usize = 32usize; const MAX_DATA_SIZE_IN_FIELDS: u32 = (128 * 1024 * 8 / Field<Self>::SIZE_IN_DATA_BITS) as u32; const MIN_STRUCT_ENTRIES: usize = 1usize; const MAX_STRUCT_ENTRIES: usize = Self::MAX_DATA_ENTRIES; const MIN_RECORD_ENTRIES: usize = 1usize; const MAX_RECORD_ENTRIES: usize = Self::MIN_RECORD_ENTRIES.saturating_add(Self::MAX_DATA_ENTRIES); const MAX_MAPPINGS: usize = 31usize; const MAX_FUNCTIONS: usize = 31usize; const MAX_OPERANDS: usize = Self::MAX_INPUTS; const MAX_INSTRUCTIONS: usize = 65_535usize; const MAX_COMMANDS: usize = 65_535usize; const MAX_WRITES: u16 = 10u16; const MAX_INPUTS: usize = 16usize; const MAX_OUTPUTS: usize = 16usize; // Required methods fn genesis_bytes() -> &'static [u8] ; fn get_credits_proving_key( function_name: String ) -> Result<&'static Arc<CircuitProvingKey<Self::PairingCurve, MarlinHidingMode>, Global>, Error>; fn get_credits_verifying_key( function_name: String ) -> Result<&'static Arc<CircuitVerifyingKey<Self::PairingCurve>, Global>, Error>; fn inclusion_proving_key( ) -> &'static Arc<CircuitProvingKey<Self::PairingCurve, MarlinHidingMode>, Global>; fn inclusion_verifying_key( ) -> &'static Arc<CircuitVerifyingKey<Self::PairingCurve>, Global>; fn g_powers() -> &'static Vec<Group<Self>, Global>; fn g_scalar_multiply(scalar: &Scalar<Self>) -> Group<Self>; fn marlin_universal_prover() -> &'static UniversalProver<Self::PairingCurve>; fn marlin_universal_verifier( ) -> &'static UniversalVerifier<Self::PairingCurve>; fn marlin_fs_parameters( ) -> &'static <PoseidonSponge<<Self::PairingCurve as PairingEngine>::Fq, 2, 1> as AlgebraicSponge<<Self::PairingCurve as PairingEngine>::Fq, 2>>::Parameters; fn encryption_domain() -> Field<Self>; fn graph_key_domain() -> Field<Self>; fn serial_number_domain() -> Field<Self>; fn commit_bhp256( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Field<Self>, Error>; fn commit_bhp512( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Field<Self>, Error>; fn commit_bhp768( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Field<Self>, Error>; fn commit_bhp1024( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Field<Self>, Error>; fn commit_ped64( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Field<Self>, Error>; fn commit_ped128( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Field<Self>, Error>; fn commit_to_group_bhp256( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Group<Self>, Error>; fn commit_to_group_bhp512( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Group<Self>, Error>; fn commit_to_group_bhp768( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Group<Self>, Error>; fn commit_to_group_bhp1024( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Group<Self>, Error>; fn commit_to_group_ped64( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Group<Self>, Error>; fn commit_to_group_ped128( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Group<Self>, Error>; fn hash_bhp256(input: &[bool]) -> Result<Field<Self>, Error>; fn hash_bhp512(input: &[bool]) -> Result<Field<Self>, Error>; fn hash_bhp768(input: &[bool]) -> Result<Field<Self>, Error>; fn hash_bhp1024(input: &[bool]) -> Result<Field<Self>, Error>; fn hash_ped64(input: &[bool]) -> Result<Field<Self>, Error>; fn hash_ped128(input: &[bool]) -> Result<Field<Self>, Error>; fn hash_psd2(input: &[Field<Self>]) -> Result<Field<Self>, Error>; fn hash_psd4(input: &[Field<Self>]) -> Result<Field<Self>, Error>; fn hash_psd8(input: &[Field<Self>]) -> Result<Field<Self>, Error>; fn hash_many_psd2( input: &[Field<Self>], num_outputs: u16 ) -> Vec<Field<Self>, Global>; fn hash_many_psd4( input: &[Field<Self>], num_outputs: u16 ) -> Vec<Field<Self>, Global>; fn hash_many_psd8( input: &[Field<Self>], num_outputs: u16 ) -> Vec<Field<Self>, Global>; fn hash_to_group_bhp256(input: &[bool]) -> Result<Group<Self>, Error>; fn hash_to_group_bhp512(input: &[bool]) -> Result<Group<Self>, Error>; fn hash_to_group_bhp768(input: &[bool]) -> Result<Group<Self>, Error>; fn hash_to_group_bhp1024(input: &[bool]) -> Result<Group<Self>, Error>; fn hash_to_group_ped64(input: &[bool]) -> Result<Group<Self>, Error>; fn hash_to_group_ped128(input: &[bool]) -> Result<Group<Self>, Error>; fn hash_to_group_psd2(input: &[Field<Self>]) -> Result<Group<Self>, Error>; fn hash_to_group_psd4(input: &[Field<Self>]) -> Result<Group<Self>, Error>; fn hash_to_group_psd8(input: &[Field<Self>]) -> Result<Group<Self>, Error>; fn hash_to_scalar_psd2(input: &[Field<Self>]) -> Result<Scalar<Self>, Error>; fn hash_to_scalar_psd4(input: &[Field<Self>]) -> Result<Scalar<Self>, Error>; fn hash_to_scalar_psd8(input: &[Field<Self>]) -> Result<Scalar<Self>, Error>; fn merkle_tree_bhp<const DEPTH: u8>( leaves: &[Vec<bool, Global>] ) -> Result<MerkleTree<Self, BHP<Self, 8, 54>, BHP<Self, 6, 43>, DEPTH>, Error>; fn merkle_tree_psd<const DEPTH: u8>( leaves: &[Vec<Field<Self>, Global>] ) -> Result<MerkleTree<Self, Poseidon<Self, 4>, Poseidon<Self, 2>, DEPTH>, Error>; fn verify_merkle_path_bhp<const DEPTH: u8>( path: &MerklePath<Self, DEPTH>, root: &Field<Self>, leaf: &Vec<bool, Global> ) -> bool; fn verify_merkle_path_psd<const DEPTH: u8>( path: &MerklePath<Self, DEPTH>, root: &Field<Self>, leaf: &Vec<Field<Self>, Global> ) -> bool;
}

Required Associated Types§

source

type StateRoot: Bech32ID<Field<Self>>

The state root type.

source

type BlockHash: Bech32ID<Field<Self>>

The block hash type.

source

type TransactionID: Bech32ID<Field<Self>>

The transaction ID type.

source

type TransitionID: Bech32ID<Field<Self>>

The transition ID type.

Required Associated Constants§

source

const ID: u16

The network ID.

source

const NAME: &'static str

The network name.

source

const EDITION: u16

The network edition.

source

const INCLUSION_FUNCTION_NAME: &'static str

The function name for the inclusion circuit.

Provided Associated Constants§

source

const GENESIS_TIMESTAMP: i64 = 1_680_307_200i64

The fixed timestamp of the genesis block.

source

const GENESIS_COINBASE_TARGET: u64 = 4_095u64

The genesis block coinbase target.

source

const GENESIS_PROOF_TARGET: u64 = 32u64

The genesis block proof target.

source

const STARTING_SUPPLY: u64 = 1_500_000_000_000_000u64

The starting supply of Aleo credits.

source

const DEPLOYMENT_FEE_MULTIPLIER: u64 = 1_000u64

The cost in microcredits per byte for the deployment transaction.

source

const MAX_FEE: u64 = 1_000_000_000_000_000u64

The maximum number of microcredits that can be spent as a fee.

source

const ANCHOR_TIME: u16 = 25u16

The anchor time per block in seconds, which must be greater than the round time per block.

source

const COINBASE_PUZZLE_DEGREE: u32 = 8_191u32

The coinbase puzzle degree.

source

const MAX_PROVER_SOLUTIONS: usize = 256usize

The maximum number of prover solutions that can be included per block.

source

const NUM_BLOCKS_PER_EPOCH: u32 = 256u32

The number of blocks per epoch (1 hour).

source

const MAX_DATA_ENTRIES: usize = 32usize

The maximum number of entries in data.

source

const MAX_DATA_DEPTH: usize = 32usize

The maximum recursive depth of an entry. Note: This value must be strictly less than u8::MAX.

source

const MAX_DATA_SIZE_IN_FIELDS: u32 = (128 * 1024 * 8 / Field<Self>::SIZE_IN_DATA_BITS) as u32

The maximum number of fields in data (must not exceed u16::MAX).

source

const MIN_STRUCT_ENTRIES: usize = 1usize

The minimum number of entries in a struct.

source

const MAX_STRUCT_ENTRIES: usize = Self::MAX_DATA_ENTRIES

The maximum number of entries in a struct.

source

const MIN_RECORD_ENTRIES: usize = 1usize

The minimum number of entries in a record.

source

const MAX_RECORD_ENTRIES: usize = Self::MIN_RECORD_ENTRIES.saturating_add(Self::MAX_DATA_ENTRIES)

The maximum number of entries in a record.

source

const MAX_MAPPINGS: usize = 31usize

The maximum number of mappings in a program.

source

const MAX_FUNCTIONS: usize = 31usize

The maximum number of functions in a program.

source

const MAX_OPERANDS: usize = Self::MAX_INPUTS

The maximum number of operands in an instruction.

source

const MAX_INSTRUCTIONS: usize = 65_535usize

The maximum number of instructions in a closure or function.

source

const MAX_COMMANDS: usize = 65_535usize

The maximum number of commands in finalize.

source

const MAX_WRITES: u16 = 10u16

The maximum number of write commands in finalize.

source

const MAX_INPUTS: usize = 16usize

The maximum number of inputs per transition.

source

const MAX_OUTPUTS: usize = 16usize

The maximum number of outputs per transition.

Required Methods§

source

fn genesis_bytes() -> &'static [u8]

Returns the genesis block bytes.

source

fn get_credits_proving_key( function_name: String ) -> Result<&'static Arc<CircuitProvingKey<Self::PairingCurve, MarlinHidingMode>, Global>, Error>

Returns the proving key for the given function name in credits.aleo.

source

fn get_credits_verifying_key( function_name: String ) -> Result<&'static Arc<CircuitVerifyingKey<Self::PairingCurve>, Global>, Error>

Returns the verifying key for the given function name in credits.aleo.

source

fn inclusion_proving_key( ) -> &'static Arc<CircuitProvingKey<Self::PairingCurve, MarlinHidingMode>, Global>

Returns the proving key for the inclusion circuit.

source

fn inclusion_verifying_key( ) -> &'static Arc<CircuitVerifyingKey<Self::PairingCurve>, Global>

Returns the verifying key for the inclusion circuit.

source

fn g_powers() -> &'static Vec<Group<Self>, Global>

Returns the powers of G.

source

fn g_scalar_multiply(scalar: &Scalar<Self>) -> Group<Self>

Returns the scalar multiplication on the generator G.

source

fn marlin_universal_prover() -> &'static UniversalProver<Self::PairingCurve>

Returns the Marlin universal prover.

source

fn marlin_universal_verifier() -> &'static UniversalVerifier<Self::PairingCurve>

Returns the Marlin universal verifier.

source

fn marlin_fs_parameters( ) -> &'static <PoseidonSponge<<Self::PairingCurve as PairingEngine>::Fq, 2, 1> as AlgebraicSponge<<Self::PairingCurve as PairingEngine>::Fq, 2>>::Parameters

Returns the sponge parameters for Marlin.

source

fn encryption_domain() -> Field<Self>

Returns the encryption domain as a constant field element.

source

fn graph_key_domain() -> Field<Self>

Returns the graph key domain as a constant field element.

source

fn serial_number_domain() -> Field<Self>

Returns the serial number domain as a constant field element.

source

fn commit_bhp256( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Field<Self>, Error>

Returns a BHP commitment with an input hasher of 256-bits and randomizer.

source

fn commit_bhp512( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Field<Self>, Error>

Returns a BHP commitment with an input hasher of 512-bits and randomizer.

source

fn commit_bhp768( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Field<Self>, Error>

Returns a BHP commitment with an input hasher of 768-bits and randomizer.

source

fn commit_bhp1024( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Field<Self>, Error>

Returns a BHP commitment with an input hasher of 1024-bits and randomizer.

source

fn commit_ped64( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Field<Self>, Error>

Returns a Pedersen commitment for the given (up to) 64-bit input and randomizer.

source

fn commit_ped128( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Field<Self>, Error>

Returns a Pedersen commitment for the given (up to) 128-bit input and randomizer.

source

fn commit_to_group_bhp256( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Group<Self>, Error>

Returns a BHP commitment with an input hasher of 256-bits and randomizer.

source

fn commit_to_group_bhp512( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Group<Self>, Error>

Returns a BHP commitment with an input hasher of 512-bits and randomizer.

source

fn commit_to_group_bhp768( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Group<Self>, Error>

Returns a BHP commitment with an input hasher of 768-bits and randomizer.

source

fn commit_to_group_bhp1024( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Group<Self>, Error>

Returns a BHP commitment with an input hasher of 1024-bits and randomizer.

source

fn commit_to_group_ped64( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Group<Self>, Error>

Returns a Pedersen commitment for the given (up to) 64-bit input and randomizer.

source

fn commit_to_group_ped128( input: &[bool], randomizer: &Scalar<Self> ) -> Result<Group<Self>, Error>

Returns a Pedersen commitment for the given (up to) 128-bit input and randomizer.

source

fn hash_bhp256(input: &[bool]) -> Result<Field<Self>, Error>

Returns the BHP hash with an input hasher of 256-bits.

source

fn hash_bhp512(input: &[bool]) -> Result<Field<Self>, Error>

Returns the BHP hash with an input hasher of 512-bits.

source

fn hash_bhp768(input: &[bool]) -> Result<Field<Self>, Error>

Returns the BHP hash with an input hasher of 768-bits.

source

fn hash_bhp1024(input: &[bool]) -> Result<Field<Self>, Error>

Returns the BHP hash with an input hasher of 1024-bits.

source

fn hash_ped64(input: &[bool]) -> Result<Field<Self>, Error>

Returns the Pedersen hash for a given (up to) 64-bit input.

source

fn hash_ped128(input: &[bool]) -> Result<Field<Self>, Error>

Returns the Pedersen hash for a given (up to) 128-bit input.

source

fn hash_psd2(input: &[Field<Self>]) -> Result<Field<Self>, Error>

Returns the Poseidon hash with an input rate of 2.

source

fn hash_psd4(input: &[Field<Self>]) -> Result<Field<Self>, Error>

Returns the Poseidon hash with an input rate of 4.

source

fn hash_psd8(input: &[Field<Self>]) -> Result<Field<Self>, Error>

Returns the Poseidon hash with an input rate of 8.

source

fn hash_many_psd2( input: &[Field<Self>], num_outputs: u16 ) -> Vec<Field<Self>, Global>

Returns the extended Poseidon hash with an input rate of 2.

source

fn hash_many_psd4( input: &[Field<Self>], num_outputs: u16 ) -> Vec<Field<Self>, Global>

Returns the extended Poseidon hash with an input rate of 4.

source

fn hash_many_psd8( input: &[Field<Self>], num_outputs: u16 ) -> Vec<Field<Self>, Global>

Returns the extended Poseidon hash with an input rate of 8.

source

fn hash_to_group_bhp256(input: &[bool]) -> Result<Group<Self>, Error>

Returns the BHP hash with an input hasher of 256-bits.

source

fn hash_to_group_bhp512(input: &[bool]) -> Result<Group<Self>, Error>

Returns the BHP hash with an input hasher of 512-bits.

source

fn hash_to_group_bhp768(input: &[bool]) -> Result<Group<Self>, Error>

Returns the BHP hash with an input hasher of 768-bits.

source

fn hash_to_group_bhp1024(input: &[bool]) -> Result<Group<Self>, Error>

Returns the BHP hash with an input hasher of 1024-bits.

source

fn hash_to_group_ped64(input: &[bool]) -> Result<Group<Self>, Error>

Returns the Pedersen hash for a given (up to) 64-bit input.

source

fn hash_to_group_ped128(input: &[bool]) -> Result<Group<Self>, Error>

Returns the Pedersen hash for a given (up to) 128-bit input.

source

fn hash_to_group_psd2(input: &[Field<Self>]) -> Result<Group<Self>, Error>

Returns the Poseidon hash with an input rate of 2 on the affine curve.

source

fn hash_to_group_psd4(input: &[Field<Self>]) -> Result<Group<Self>, Error>

Returns the Poseidon hash with an input rate of 4 on the affine curve.

source

fn hash_to_group_psd8(input: &[Field<Self>]) -> Result<Group<Self>, Error>

Returns the Poseidon hash with an input rate of 8 on the affine curve.

source

fn hash_to_scalar_psd2(input: &[Field<Self>]) -> Result<Scalar<Self>, Error>

Returns the Poseidon hash with an input rate of 2 on the scalar field.

source

fn hash_to_scalar_psd4(input: &[Field<Self>]) -> Result<Scalar<Self>, Error>

Returns the Poseidon hash with an input rate of 4 on the scalar field.

source

fn hash_to_scalar_psd8(input: &[Field<Self>]) -> Result<Scalar<Self>, Error>

Returns the Poseidon hash with an input rate of 8 on the scalar field.

source

fn merkle_tree_bhp<const DEPTH: u8>( leaves: &[Vec<bool, Global>] ) -> Result<MerkleTree<Self, BHP<Self, 8, 54>, BHP<Self, 6, 43>, DEPTH>, Error>

Returns a Merkle tree with a BHP leaf hasher of 1024-bits and a BHP path hasher of 512-bits.

source

fn merkle_tree_psd<const DEPTH: u8>( leaves: &[Vec<Field<Self>, Global>] ) -> Result<MerkleTree<Self, Poseidon<Self, 4>, Poseidon<Self, 2>, DEPTH>, Error>

Returns a Merkle tree with a Poseidon leaf hasher with input rate of 4 and a Poseidon path hasher with input rate of 2.

source

fn verify_merkle_path_bhp<const DEPTH: u8>( path: &MerklePath<Self, DEPTH>, root: &Field<Self>, leaf: &Vec<bool, Global> ) -> bool

Returns true if the given Merkle path is valid for the given root and leaf.

source

fn verify_merkle_path_psd<const DEPTH: u8>( path: &MerklePath<Self, DEPTH>, root: &Field<Self>, leaf: &Vec<Field<Self>, Global> ) -> bool

Returns true if the given Merkle path is valid for the given root and leaf.

Implementors§

source§

impl Network for Testnet3

§

type BlockHash = AleoID<Field<Testnet3>, snarkvm_console_network::::testnet3::{impl#2}::BlockHash::{constant#0}>

§

type StateRoot = AleoID<Field<Testnet3>, snarkvm_console_network::::testnet3::{impl#2}::StateRoot::{constant#0}>

§

type TransactionID = AleoID<Field<Testnet3>, snarkvm_console_network::::testnet3::{impl#2}::TransactionID::{constant#0}>

§

type TransitionID = AleoID<Field<Testnet3>, snarkvm_console_network::::testnet3::{impl#2}::TransitionID::{constant#0}>

source§

const EDITION: u16 = 0u16

source§

const ID: u16 = 3u16

source§

const INCLUSION_FUNCTION_NAME: &'static str = snarkvm_parameters::testnet3::TESTNET3_INCLUSION_FUNCTION_NAME

source§

const NAME: &'static str = "Aleo Testnet 3"