Skip to main content

alephium_web3/
constants.rs

1// Copyright 2018 - 2022 The Alephium Authors
2// This file is part of the alephium project.
3
4/// Total number of groups in the Alephium network
5pub const TOTAL_NUMBER_OF_GROUPS: u8 = 4;
6
7/// Number of groups per shard
8pub const GROUPS_PER_SHARD: u8 = 4;
9
10/// Zero address constant (used for contract creation)
11pub const ZERO_ADDRESS: &str = "tgx7VNFoP9DJiFMFgXXtafQZkUvyEdDHT9ryamHJYrjq";
12
13/// Mainnet network ID
14pub const MAINNET_NETWORK_ID: u8 = 0;
15
16/// Testnet network ID  
17pub const TESTNET_NETWORK_ID: u8 = 1;
18
19/// Devnet network ID
20pub const DEVNET_NETWORK_ID: u8 = 4;
21
22/// Default dust amount (minimum ALPH amount)
23pub const DUST_AMOUNT: u64 = 1_000_000_000_000; // 0.001 ALPH
24
25/// Number of decimals for ALPH token
26pub const ALPH_TOKEN_DECIMALS: u8 = 18;
27
28/// One ALPH in the smallest unit
29pub const ONE_ALPH: u128 = 1_000_000_000_000_000_000; // 10^18
30
31/// Default gas amount for transactions
32pub const DEFAULT_GAS_AMOUNT: u64 = 20_000;
33
34/// Default gas price
35pub const DEFAULT_GAS_PRICE: u64 = 100_000_000_000; // 100 Gwei
36
37/// Maximum transaction size in bytes
38pub const MAX_TX_SIZE: usize = 256 * 1024; // 256 KB
39
40/// Coinbase maturity (number of blocks)
41pub const COINBASE_MATURITY: u32 = 500;
42
43/// Block target time in milliseconds
44pub const BLOCK_TARGET_TIME: u64 = 64_000; // 64 seconds
45
46/// Public key hash size
47pub const PUBLIC_KEY_HASH_SIZE: usize = 32;
48
49/// Public key size (uncompressed)
50pub const PUBLIC_KEY_SIZE: usize = 33;
51
52/// Signature size
53pub const SIGNATURE_SIZE: usize = 65;
54
55/// Hash size (Blake2b)
56pub const HASH_SIZE: usize = 32;
57
58/// Contract ID size
59pub const CONTRACT_ID_SIZE: usize = 32;
60
61/// Transaction ID size
62pub const TX_ID_SIZE: usize = 32;
63
64/// Block hash size
65pub const BLOCK_HASH_SIZE: usize = 32;