DustParameters
Parameters for Dust generation and decay.
What are Dust Parameters? These control how Dust tokens generate and decay over time:
Night Dust Ratio: Maximum dust a Night UTXO can generate (capacity)
Generation/Decay Rate: How fast dust accumulates and decays
Dust Generation Formula:
max_capacity = night_value × night_dust_ratio
generation_rate = night_value × generation_decay_rate
decay_rate = night_value × generation_decay_rate (same as generation)Example:
Night value: 100 NIGHT
night_dust_ratio: 1000
generation_decay_rate: 10
→ Max capacity: 100 × 1000 = 100,000 Specks
→ Generation rate: 100 × 10 = 1,000 Specks/second
→ Time to full: 100,000 / 1,000 = 100 seconds
→ Decay rate: 1,000 Specks/second (back to zero in 100 seconds)Ledger Mapping: Mirrors the ledger's DustParameters: the Night-to-dust ratio, the generation/decay rate, and a grace period. The ratio is an unsigned 64-bit value (mapped to Kotlin Long) and the rate is an unsigned 32-bit value (mapped to Kotlin Int); both ranges are sufficient for valid positive values.
Network Defaults:
Testnet: Uses the initial dust parameters.
Mainnet: Determined by governance.
Usage:
val params = DustParameters.TESTNET_DEFAULTS
// Calculate max capacity for a Night UTXO
val nightValue = BigInteger.valueOf(100_000_000) // 100 NIGHT
val maxDust = params.calculateMaxCapacity(nightValue)
println("Max dust: $maxDust Specks")
// Calculate generation rate
val rate = params.calculateGenerationRate(nightValue)
println("Generation: $rate Specks/second")Properties
Functions
Calculates the decay rate for a given Night value.
Calculates the generation rate for a given Night value.
Calculates the maximum dust capacity for a given Night value.
Calculates the time to decay to zero for a given Night value.
Calculates the time to reach full capacity for a given Night value.