What changed, and why it matters
This commit fixes the minimum spendable amount ('dust limit') for Dash in the Stack Wallet app. It was incorrectly set to 0.01 DASH (1,000,000 satoshis), which is far above Dash's actual network rule of 546 satoshis. The change lowers the limit so users can send smaller valid Dash amounts. A test was added to prevent the value from drifting again.
Verify the 546-satoshi value matches the Dash Core policy used by the ElectrumX servers this wallet connects to, and confirm no other coin classes have similarly mismatched dust limits. Consider centralizing dust-limit values from network parameters rather than hard-coding them.
Security signals we found
Incorrect dust limit could cause the wallet to reject legitimate small-value transactions or construct transactions that violate network policy
Mismatch between wallet policy and network consensus/policy rules is a common source of transaction broadcast failures or unexpected user-facing errors
No explicit security framing in commit title or message
Evidence from the diff
The Dash currency class in Stack Wallet had dustLimit hard-coded to 1,000,000 satoshis (0.01 DASH). Dash’s standard dust threshold is 546 satoshis, matching Bitcoin’s policy for a non-segwit output. The patch changes the raw value to 546 and adds a unit test asserting dash.dustLimit.raw == 546 and fractionDigits == 8.
Changed components
lib/wallets/crypto_currency/coins/dash.darttest/wallets/dash_policy_test.dartInspect captured patch +12 / −1
diff --git a/lib/wallets/crypto_currency/coins/dash.dart b/lib/wallets/crypto_currency/coins/dash.dart
index e2ad041..4c3f3d8 100644
--- a/lib/wallets/crypto_currency/coins/dash.dart
+++ b/lib/wallets/crypto_currency/coins/dash.dart
@@ -90,7 +90,7 @@ class Dash extends Bip39HDCurrency with ElectrumXCurrencyInterface {
@override
Amount get dustLimit =>
- Amount(rawValue: BigInt.from(1000000), fractionDigits: fractionDigits);
+ Amount(rawValue: BigInt.from(546), fractionDigits: fractionDigits);
@override
String get genesisHash {
diff --git a/test/wallets/dash_policy_test.dart b/test/wallets/dash_policy_test.dart
new file mode 100644
index 0000000..0e6a238
--- /dev/null
+++ b/test/wallets/dash_policy_test.dart
@@ -0,0 +1,11 @@
+import 'package:flutter_test/flutter_test.dart';
+import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
+
+void main() {
+ test('Dash dust limit uses network policy units', () {
+ final dash = Dash(CryptoCurrencyNetwork.main);
+
+ expect(dash.dustLimit.raw, BigInt.from(546));
+ expect(dash.dustLimit.fractionDigits, 8);
+ });
+}
Why this scored 37/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.