fixed scan refresh issue when Carrot keys are still encrypted

This commit is contained in:
Some Random Crypto Guy
2025-11-12 14:46:41 +00:00
parent 38d2515dc5
commit 9725b921a5
4 changed files with 29 additions and 27 deletions

View File

@@ -1,4 +1,4 @@
# Salvium One v1.0.6 # Salvium One v1.0.7
Copyright (c) 2023-2025, Salvium Copyright (c) 2023-2025, Salvium
Portions Copyright (c) 2014-2023, The Monero Project Portions Copyright (c) 2014-2023, The Monero Project
@@ -172,7 +172,7 @@ invokes cmake commands as needed.
```bash ```bash
cd salvium cd salvium
git checkout v1.0.6 git checkout v1.0.7
make make
``` ```
@@ -251,7 +251,7 @@ Tested on a Raspberry Pi Zero with a clean install of minimal Raspbian Stretch (
```bash ```bash
git clone https://github.com/salvium/salvium git clone https://github.com/salvium/salvium
cd salvium cd salvium
git checkout v1.0.6 git checkout v1.0.7
``` ```
* Build: * Build:
@@ -370,10 +370,10 @@ application.
cd salvium cd salvium
``` ```
* If you would like a specific [version/tag](https://github.com/salvium/salvium/tags), do a git checkout for that version. eg. 'v1.0.6'. If you don't care about the version and just want binaries from master, skip this step: * If you would like a specific [version/tag](https://github.com/salvium/salvium/tags), do a git checkout for that version. eg. 'v1.0.7'. If you don't care about the version and just want binaries from master, skip this step:
```bash ```bash
git checkout v1.0.6 git checkout v1.0.7
``` ```
* If you are on a 64-bit system, run: * If you are on a 64-bit system, run:

View File

@@ -477,7 +477,9 @@ bool try_scan_carrot_enote_internal_receiver(const CarrotEnoteV1 &enote,
{ {
// Determine whether this is a full wallet or a watch-only wallet // Determine whether this is a full wallet or a watch-only wallet
const cryptonote::account_keys &keys = account.get_keys(); const cryptonote::account_keys &keys = account.get_keys();
bool watch_only = (keys.m_spend_secret_key == crypto::null_skey && keys.m_view_secret_key == crypto::null_skey); //bool watch_only = (keys.m_spend_secret_key == crypto::null_skey && keys.m_view_secret_key == crypto::null_skey);
bool keys_decrypted = (keys.m_spend_secret_key == keys.s_master);
bool can_scan_for_openings = keys_decrypted && (keys.m_spend_secret_key != crypto::null_skey);
// input_context // input_context
const input_context_t input_context = make_carrot_input_context(enote.tx_first_key_image); const input_context_t input_context = make_carrot_input_context(enote.tx_first_key_image);
@@ -524,24 +526,8 @@ bool try_scan_carrot_enote_internal_receiver(const CarrotEnoteV1 &enote,
// compute K_r = K_return + K_o // compute K_r = K_return + K_o
crypto::public_key K_r = rct::rct2pk(rct::addKeys(rct::pk2rct(K_return), rct::pk2rct(enote.onetime_address))); crypto::public_key K_r = rct::rct2pk(rct::addKeys(rct::pk2rct(K_return), rct::pk2rct(enote.onetime_address)));
// Is this a watch-only wallet? // Can we currently scan for onetime address openings?
if (watch_only) { if (can_scan_for_openings) {
// calculate the key image for the return output
crypto::secret_key sum_g;
sc_add(to_bytes(sum_g), to_bytes(sender_extension_g_out), to_bytes(k_return));
crypto::key_image key_image = account.derive_key_image_view_only(address_spend_pubkey_out,
sum_g,
sender_extension_t_out,
K_r
);
// HERE BE DRAGONS!!!
// SRCG: test whether this will even work for return_payment detection
account.insert_return_output_info({{K_r, {input_context, output_key, enote.onetime_address, key_image, crypto::null_skey, crypto::null_skey}}});
// LAND AHOY!!!
} else {
// calculate the key image for the return output // calculate the key image for the return output
crypto::secret_key sum_g; crypto::secret_key sum_g;
@@ -562,6 +548,22 @@ bool try_scan_carrot_enote_internal_receiver(const CarrotEnoteV1 &enote,
// save the input context & change output key // save the input context & change output key
account.insert_return_output_info({{K_r, {input_context, output_key, enote.onetime_address, key_image, x, y}}}); account.insert_return_output_info({{K_r, {input_context, output_key, enote.onetime_address, key_image, x, y}}});
} else {
// calculate the key image for the return output the "watch-only" way
crypto::secret_key sum_g;
sc_add(to_bytes(sum_g), to_bytes(sender_extension_g_out), to_bytes(k_return));
crypto::key_image key_image = account.derive_key_image_view_only(address_spend_pubkey_out,
sum_g,
sender_extension_t_out,
K_r
);
// HERE BE DRAGONS!!!
// SRCG: test whether this will even work for return_payment detection
account.insert_return_output_info({{K_r, {input_context, output_key, enote.onetime_address, key_image, crypto::null_skey, crypto::null_skey}}});
// LAND AHOY!!!
} }
} }

View File

@@ -4610,7 +4610,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
{ {
m_wallet_file = m_generate_from_svb_key; m_wallet_file = m_generate_from_svb_key;
// parse address // parse address
std::string address_string = input_line("Standard address"); std::string address_string = input_line("Carrot wallet address");
if (std::cin.eof()) if (std::cin.eof())
return false; return false;
if (address_string.empty()) { if (address_string.empty()) {
@@ -4635,7 +4635,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
} }
// parse view secret key // parse view secret key
epee::wipeable_string viewkey_string = input_secure_line("Secret view key"); epee::wipeable_string viewkey_string = input_secure_line("View-balance secret");
if (std::cin.eof()) if (std::cin.eof())
return false; return false;
if (viewkey_string.empty()) { if (viewkey_string.empty()) {

View File

@@ -1,5 +1,5 @@
#define DEF_SALVIUM_VERSION_TAG "@VERSIONTAG@" #define DEF_SALVIUM_VERSION_TAG "@VERSIONTAG@"
#define DEF_SALVIUM_VERSION "1.0.6" #define DEF_SALVIUM_VERSION "1.0.7"
#define DEF_MONERO_VERSION_TAG "release" #define DEF_MONERO_VERSION_TAG "release"
#define DEF_MONERO_VERSION "0.18.3.4" #define DEF_MONERO_VERSION "0.18.3.4"
#define DEF_MONERO_RELEASE_NAME "One" #define DEF_MONERO_RELEASE_NAME "One"