wallet: add shared ring database
This maps key images to rings, so that different forks can reuse the rings by key image. This avoids revealing the real inputs like would happen if two forks spent the same outputs with different rings. This database is meant to be shared with all Monero forks which don't bother making a new chain, putting users' privacy at risk in the process. It is placed in a shared data directory by default ($HOME/.shared-ringdb on UNIX like systems). You may use --shared-ringdb-dir to override this location, and should then do so for all Monero forks for them to share the database.
This commit is contained in:
+16
-1
@@ -810,6 +810,9 @@ namespace tools
|
||||
if(ver < 23)
|
||||
return;
|
||||
a & m_account_tags;
|
||||
if(ver < 24)
|
||||
return;
|
||||
a & m_ring_history_saved;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1046,6 +1049,11 @@ namespace tools
|
||||
return epee::net_utils::invoke_http_json_rpc(uri, method_name, req, res, m_http_client, timeout, http_method, req_id);
|
||||
}
|
||||
|
||||
void set_ring_database(const std::string &filename);
|
||||
const std::string get_ring_database() const { return m_ring_database; }
|
||||
bool get_ring(const std::string &filename, const crypto::key_image &key_image, std::vector<uint64_t> &outs);
|
||||
bool find_and_save_rings(const std::string &filename, bool force = true);
|
||||
|
||||
private:
|
||||
/*!
|
||||
* \brief Stores wallet information to wallet file.
|
||||
@@ -1102,6 +1110,10 @@ namespace tools
|
||||
rct::multisig_kLRki get_multisig_kLRki(size_t n, const rct::key &k) const;
|
||||
rct::key get_multisig_k(size_t idx, const std::unordered_set<rct::key> &used_L) const;
|
||||
void update_multisig_rescan_info(const std::vector<std::vector<rct::key>> &multisig_k, const std::vector<std::vector<tools::wallet2::multisig_info>> &info, size_t n);
|
||||
bool add_rings(const std::string &filename, const crypto::chacha_key &key, const cryptonote::transaction_prefix &tx);
|
||||
bool add_rings(const std::string &filename, const cryptonote::transaction_prefix &tx);
|
||||
bool remove_rings(const std::string &filename, const cryptonote::transaction_prefix &tx);
|
||||
bool get_ring(const std::string &filename, const crypto::chacha_key &key, const crypto::key_image &key_image, std::vector<uint64_t> &outs);
|
||||
|
||||
bool get_output_distribution(uint64_t &start_height, std::vector<uint64_t> &distribution);
|
||||
|
||||
@@ -1187,9 +1199,12 @@ namespace tools
|
||||
std::unordered_map<crypto::hash, address_tx> m_light_wallet_address_txs;
|
||||
// store calculated key image for faster lookup
|
||||
std::unordered_map<crypto::public_key, std::map<uint64_t, crypto::key_image> > m_key_image_cache;
|
||||
|
||||
std::string m_ring_database;
|
||||
bool m_ring_history_saved;
|
||||
};
|
||||
}
|
||||
BOOST_CLASS_VERSION(tools::wallet2, 23)
|
||||
BOOST_CLASS_VERSION(tools::wallet2, 24)
|
||||
BOOST_CLASS_VERSION(tools::wallet2::transfer_details, 9)
|
||||
BOOST_CLASS_VERSION(tools::wallet2::multisig_info, 1)
|
||||
BOOST_CLASS_VERSION(tools::wallet2::multisig_info::LR, 0)
|
||||
|
||||
Reference in New Issue
Block a user