Firo: recognize Spark V2 spend transactions
What changed, and why it matters
This commit updates the Stack Wallet app so it can correctly identify a newer kind of Firo cryptocurrency transaction (Spark V2 spends). Previously, the wallet only recognized one transaction type as a Spark spend; now it also recognizes type 11. This is a small correctness fix that helps the wallet display balances and transaction history accurately for Firo users. There is no direct evidence in the commit that this is a security vulnerability or that it was exploited.
Review as a normal feature/compatibility update. No immediate security action is indicated by the diff alone. If this change relates to a known Firo protocol issue, verify with the Firo project or Stack Wallet maintainers whether additional handling is needed.
Security signals we found
Transaction classification logic changed to recognize additional spend type
No input validation, cryptography, or authorization changes observed
No vendor disclosure of security relevance in commit or references
Evidence from the diff
The change extracts the Spark spend detection logic into a new helper, isSparkSpendTransaction, and updates the condition from (type == 9 && version == 3) to (version == 3 && (type == 9 || type == 11)). This adds support for Spark V2 spend transactions (type 11). The commit includes a unit test covering both recognized and unrecognized type/version combinations. The change is localized to Firo wallet transaction classification.
Changed components
lib/wallets/wallet/impl/firo_wallet.dartlib/wallets/wallet/impl/firo_transaction_type.darttest/wallets/firo_transaction_type_test.dartInspect captured patch +17 / −1
diff --git a/lib/wallets/wallet/impl/firo_transaction_type.dart b/lib/wallets/wallet/impl/firo_transaction_type.dart
new file mode 100644
index 0000000..501ae00
--- /dev/null
+++ b/lib/wallets/wallet/impl/firo_transaction_type.dart
@@ -0,0 +1,4 @@
+bool isSparkSpendTransaction(Map<String, dynamic> transaction) {
+ final type = transaction['type'];
+ return transaction['version'] == 3 && (type == 9 || type == 11);
+}
diff --git a/lib/wallets/wallet/impl/firo_wallet.dart b/lib/wallets/wallet/impl/firo_wallet.dart
index 34c68c2..ea27514 100644
--- a/lib/wallets/wallet/impl/firo_wallet.dart
+++ b/lib/wallets/wallet/impl/firo_wallet.dart
@@ -30,6 +30,7 @@ import '../wallet_mixin_interfaces/coin_control_interface.dart';
import '../wallet_mixin_interfaces/electrumx_interface.dart';
import '../wallet_mixin_interfaces/extended_keys_interface.dart';
import '../wallet_mixin_interfaces/spark_interface.dart';
+import 'firo_transaction_type.dart';
class MasternodeInfo {
final String proTxHash;
@@ -332,7 +333,7 @@ class FiroWallet<T extends ElectrumXCurrencyInterface> extends Bip39HDWallet<T>
bool isMint = false;
bool isJMint = false;
bool isSparkMint = false;
- final bool isSparkSpend = txData["type"] == 9 && txData["version"] == 3;
+ final bool isSparkSpend = isSparkSpendTransaction(txData);
final bool isMySpark = sparkTxids.contains(txData["txid"] as String);
final bool isMySpentSpark = missing
.where((e) => e.txid == txData["txid"])
diff --git a/test/wallets/firo_transaction_type_test.dart b/test/wallets/firo_transaction_type_test.dart
new file mode 100644
index 0000000..89abfa3
--- /dev/null
+++ b/test/wallets/firo_transaction_type_test.dart
@@ -0,0 +1,11 @@
+import 'package:flutter_test/flutter_test.dart';
+import 'package:paymint/wallets/wallet/impl/firo_transaction_type.dart';
+
+void main() {
+ test('recognizes Spark spend transaction types', () {
+ expect(isSparkSpendTransaction({'version': 3, 'type': 9}), isTrue);
+ expect(isSparkSpendTransaction({'version': 3, 'type': 11}), isTrue);
+ expect(isSparkSpendTransaction({'version': 3, 'type': 10}), isFalse);
+ expect(isSparkSpendTransaction({'version': 2, 'type': 11}), isFalse);
+ });
+}
Why this scored 28/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.