clementine_core/
constants.rs1use bitcoin::{transaction::Version, Address, Amount, ScriptBuf};
2
3pub const NON_EPHEMERAL_ANCHOR_AMOUNT: Amount = Amount::from_sat(240);
5
6pub const MIN_TAPROOT_AMOUNT: Amount = Amount::from_sat(330);
8
9pub const TEN_MINUTES_IN_SECS: u32 = 600;
10
11pub const DEFAULT_CHANNEL_SIZE: usize = 1280;
12
13pub const MAX_EXTRA_WATCHTOWERS: usize = 5;
16
17pub const NUM_NONCES_LIMIT: u32 = 150 * 1_000_000 / MUSIG_SECNONCE_LEN as u32;
21
22pub const MAX_ALL_SESSIONS_BYTES: usize = 2_000_000_000;
27
28pub const MAX_NUM_SESSIONS: usize = 2000;
31
32use secp256k1::ffi::MUSIG_SECNONCE_LEN;
33pub const MAX_WINTERNITZ_DIGITS_PER_KEY: usize = 68;
40
41pub const MAX_SCRIPT_REPLACEMENT_OPERATIONS: usize = 100_000;
48
49pub const MAX_BYTES_PER_WINTERNITZ_KEY: usize = MAX_WINTERNITZ_DIGITS_PER_KEY * 20;
51
52pub use timeout::*;
53
54mod timeout {
55 use std::time::Duration;
56
57 pub const OVERALL_DEPOSIT_TIMEOUT: Duration = Duration::from_secs(7200); pub const KEY_DISTRIBUTION_TIMEOUT: Duration = Duration::from_secs(1200); pub const OPERATOR_GET_KEYS_TIMEOUT: Duration = Duration::from_secs(600); pub const VERIFIER_SEND_KEYS_TIMEOUT: Duration = Duration::from_secs(600); pub const NONCE_STREAM_CREATION_TIMEOUT: Duration = Duration::from_secs(300); pub const PARTIAL_SIG_STREAM_CREATION_TIMEOUT: Duration = Duration::from_secs(300); pub const OPERATOR_SIGS_STREAM_CREATION_TIMEOUT: Duration = Duration::from_secs(300); pub const DEPOSIT_FINALIZE_STREAM_CREATION_TIMEOUT: Duration = Duration::from_secs(300); pub const SETUP_COMPLETION_TIMEOUT: Duration = Duration::from_secs(1800); pub const PIPELINE_COMPLETION_TIMEOUT: Duration = Duration::from_secs(3600); pub const OPERATOR_SIGS_TIMEOUT: Duration = Duration::from_secs(1200); pub const SEND_OPERATOR_SIGS_TIMEOUT: Duration = Duration::from_secs(600); pub const DEPOSIT_FINALIZATION_TIMEOUT: Duration = Duration::from_secs(2400); pub const OPTIMISTIC_PAYOUT_TIMEOUT: Duration = Duration::from_secs(300); pub const RESTART_BACKGROUND_TASKS_TIMEOUT: Duration = Duration::from_secs(120);
78
79 pub const ENTITY_STATUS_POLL_TIMEOUT: Duration = Duration::from_secs(120);
80
81 pub const ENTITY_COMP_DATA_POLL_TIMEOUT: Duration = Duration::from_secs(240); pub const PUBLIC_KEY_COLLECTION_TIMEOUT: Duration = Duration::from_secs(30);
84
85 pub const WITHDRAWAL_TIMEOUT: Duration = Duration::from_secs(120); }
87
88pub const NON_STANDARD_V3: Version = Version(3);
89
90lazy_static::lazy_static! {
91 pub static ref BURN_SCRIPT: ScriptBuf = ("1111111111111111111114oLvT2")
92 .parse::<Address<_>>()
93 .expect("valid burn address")
94 .assume_checked()
95 .script_pubkey();
96
97}