What changed, and why it matters
This update changes Monero wallet code so it refuses to create 'spend proofs' for coinbase transactions (the special transactions that pay mining rewards) and also rejects spend-proof strings that claim zero signatures. Spend proofs are a feature that lets a wallet prove it paid someone. The change prevents the wallet from generating or accepting proofs in situations where the proof math does not apply, which could otherwise let someone create a misleading or invalid proof.
Treat as a low-to-moderate correctness/security hardening patch. Review the spend-proof protocol documentation to confirm whether coinbase proofs were ever meaningful, and consider adding unit tests for coinbase and zero-signature proof cases. No immediate emergency response is indicated, but the fix should be included in the next release.
Security signals we found
Rejects generation of spend proofs for coinbase transactions
Adds zero-signature validation in spend proof verification
Prevents potential construction of invalid/misleading spend proofs
Evidence from the diff
The patch adds a check in wallet2::get_spend_proof() that throws if the requested transaction is a coinbase tx, because coinbase outputs are not spendable using the same ring-signature key images that ordinary spends use, so a spend proof cannot be constructed honestly. It also hardens wallet2::check_spend_proof() by returning false when num_sigs == 0, so an empty/crafted proof string cannot pass further validation. The commit message does not explain the exact failure mode, but the two changes together close a logical gap in the spend-proof protocol for coinbase transactions and malformed zero-signature proofs.
Changed components
src/wallet/wallet2.cppwallet2::get_spend_proof()wallet2::check_spend_proof()Inspect captured patch +2 / −1
### src/wallet/wallet2.cpp
@@ -12265,6 +12265,7 @@ std::string wallet2::get_spend_proof(const crypto::hash &txid, const std::string
crypto::hash tx_hash;
THROW_WALLET_EXCEPTION_IF(!get_pruned_tx(res.txs[0], tx, tx_hash), error::wallet_internal_error, "Failed to get tx from daemon");
THROW_WALLET_EXCEPTION_IF(tx_hash != txid, error::wallet_internal_error, "Failed to get the right transaction from daemon");
+ THROW_WALLET_EXCEPTION_IF(tx.is_coinbase(), error::wallet_internal_error, "Cannot generate spend proof for a coinbase transaction");
std::vector<std::vector<crypto::signature>> signatures;
@@ -12393,7 +12394,7 @@ bool wallet2::check_spend_proof(const crypto::hash &txid, const std::string &mes
}
std::vector<std::vector<crypto::signature>> signatures = { std::vector<crypto::signature>(1) };
const size_t sig_len = tools::base58::encode(std::string((const char *)&signatures[0][0], sizeof(crypto::signature))).size();
- if( sig_str.size() != header_len + num_sigs * sig_len ) {
+ if( num_sigs == 0 || sig_str.size() != header_len + num_sigs * sig_len ) {
return false;
}
Why this scored 46/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.