summaryrefslogtreecommitdiff
path: root/patches/monero
diff options
context:
space:
mode:
Diffstat (limited to 'patches/monero')
-rw-r--r--patches/monero/0001-polyseed.patch8
-rw-r--r--patches/monero/0002-wallet-background-sync-with-just-the-view-key.patch4
-rw-r--r--patches/monero/0003-airgap.patch4
-rw-r--r--patches/monero/0004-coin-control.patch4
-rw-r--r--patches/monero/0005-fix-build-issues.patch4
-rw-r--r--patches/monero/0006-macos-build-fix.patch4
-rw-r--r--patches/monero/0007-fix-make-debug-test-target.patch4
-rw-r--r--patches/monero/0008-fix-missing-___clear_cache-when-targetting-iOS.patch4
-rw-r--r--patches/monero/0009-Add-recoverDeterministicWalletFromSpendKey.patch153
-rw-r--r--patches/monero/0010-Add-hex-encoding-and-tx-key-getter-for-PendingTransc.patch68
10 files changed, 239 insertions, 18 deletions
diff --git a/patches/monero/0001-polyseed.patch b/patches/monero/0001-polyseed.patch
index 2a28d03..2db45e5 100644
--- a/patches/monero/0001-polyseed.patch
+++ b/patches/monero/0001-polyseed.patch
@@ -1,7 +1,7 @@
-From bf347a3c80f0e0647176752867a54ae9ecedb580 Mon Sep 17 00:00:00 2001
+From b9fac308d903e9dd79b95d6db73c37807e1219b7 Mon Sep 17 00:00:00 2001
From: tobtoht <tob@featherwallet.org>
Date: Tue, 12 Mar 2024 09:42:37 +0100
-Subject: [PATCH 1/8] polyseed
+Subject: [PATCH 01/10] polyseed
Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
---
@@ -150,7 +150,7 @@ index 5b7f69a56..1b9761d70 100644
\ No newline at end of file
diff --git a/external/polyseed b/external/polyseed
new file mode 160000
-index 000000000..b7c35bb3c
+index 000000000..9d4f1a032
--- /dev/null
+++ b/external/polyseed
@@ -0,0 +1 @@
@@ -468,7 +468,7 @@ index 000000000..f6253b9d7
\ No newline at end of file
diff --git a/src/polyseed/polyseed.cpp b/src/polyseed/polyseed.cpp
new file mode 100644
-index 000000000..b26f37574
+index 000000000..0a8852777
--- /dev/null
+++ b/src/polyseed/polyseed.cpp
@@ -0,0 +1,182 @@
diff --git a/patches/monero/0002-wallet-background-sync-with-just-the-view-key.patch b/patches/monero/0002-wallet-background-sync-with-just-the-view-key.patch
index 610e5bd..f5d87b6 100644
--- a/patches/monero/0002-wallet-background-sync-with-just-the-view-key.patch
+++ b/patches/monero/0002-wallet-background-sync-with-just-the-view-key.patch
@@ -1,7 +1,7 @@
-From 0cc1775c6a41a1768ebbe6155496f01289f903d4 Mon Sep 17 00:00:00 2001
+From f1cf1d2378a5bb6313eef9a58325b03cb4ac0f85 Mon Sep 17 00:00:00 2001
From: j-berman <justinberman@protonmail.com>
Date: Thu, 13 Oct 2022 18:33:33 -0700
-Subject: [PATCH 2/8] wallet: background sync with just the view key
+Subject: [PATCH 02/10] wallet: background sync with just the view key
- When background syncing, the wallet wipes the spend key
from memory and processes all new transactions. The wallet saves
diff --git a/patches/monero/0003-airgap.patch b/patches/monero/0003-airgap.patch
index 2689f06..401e4d8 100644
--- a/patches/monero/0003-airgap.patch
+++ b/patches/monero/0003-airgap.patch
@@ -1,7 +1,7 @@
-From c325add45cf950a42fc4cc16f99bb7385c53a634 Mon Sep 17 00:00:00 2001
+From c4499815188a0b8103092da07260074359a1874e Mon Sep 17 00:00:00 2001
From: tobtoht <tob@featherwallet.org>
Date: Tue, 12 Mar 2024 10:09:50 +0100
-Subject: [PATCH 3/8] airgap
+Subject: [PATCH 03/10] airgap
---
src/wallet/api/wallet.cpp | 23 ++++++++++++++++++++++
diff --git a/patches/monero/0004-coin-control.patch b/patches/monero/0004-coin-control.patch
index 9787116..fd777c3 100644
--- a/patches/monero/0004-coin-control.patch
+++ b/patches/monero/0004-coin-control.patch
@@ -1,7 +1,7 @@
-From fb9cd4ff500a56a1f29f323fe05de4633dd560de Mon Sep 17 00:00:00 2001
+From 8e069a8b7c15794b843471487c12c2c753d3afe2 Mon Sep 17 00:00:00 2001
From: tobtoht <tob@featherwallet.org>
Date: Tue, 12 Mar 2024 11:07:57 +0100
-Subject: [PATCH 4/8] coin control
+Subject: [PATCH 04/10] coin control
---
src/wallet/api/CMakeLists.txt | 8 +-
diff --git a/patches/monero/0005-fix-build-issues.patch b/patches/monero/0005-fix-build-issues.patch
index f5e5f08..2215c99 100644
--- a/patches/monero/0005-fix-build-issues.patch
+++ b/patches/monero/0005-fix-build-issues.patch
@@ -1,7 +1,7 @@
-From 6bd41f6e334fe979e2a5e874e404657ff0ef6c4f Mon Sep 17 00:00:00 2001
+From a24797410dcda06617ff2a81de3129d38b69f2a2 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Tue, 12 Mar 2024 17:59:13 +0100
-Subject: [PATCH 5/8] fix build issues
+Subject: [PATCH 05/10] fix build issues
---
contrib/depends/hosts/linux.mk | 8 +++----
diff --git a/patches/monero/0006-macos-build-fix.patch b/patches/monero/0006-macos-build-fix.patch
index 4f7228f..c149232 100644
--- a/patches/monero/0006-macos-build-fix.patch
+++ b/patches/monero/0006-macos-build-fix.patch
@@ -1,7 +1,7 @@
-From c8dfb421082c895c45c6e4fd1437fee4b554b612 Mon Sep 17 00:00:00 2001
+From bc3d91b07d77893983bbed0b165ce41e034579a7 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: Thu, 28 Mar 2024 02:03:08 +0100
-Subject: [PATCH 6/8] macos build fix
+Subject: [PATCH 06/10] macos build fix
---
contrib/depends/hosts/darwin.mk | 2 +
diff --git a/patches/monero/0007-fix-make-debug-test-target.patch b/patches/monero/0007-fix-make-debug-test-target.patch
index 1e3f708..25827bb 100644
--- a/patches/monero/0007-fix-make-debug-test-target.patch
+++ b/patches/monero/0007-fix-make-debug-test-target.patch
@@ -1,7 +1,7 @@
-From d0d86d333ea4788cc27c4c87c5ec2ec3bc1668b7 Mon Sep 17 00:00:00 2001
+From 14b4c210a11e0c333087026775cf22fcccf46a40 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Tue, 2 Apr 2024 01:13:12 +0200
-Subject: [PATCH 7/8] fix `make debug-test` target
+Subject: [PATCH 07/10] fix `make debug-test` target
---
src/simplewallet/simplewallet.cpp | 4 ++--
diff --git a/patches/monero/0008-fix-missing-___clear_cache-when-targetting-iOS.patch b/patches/monero/0008-fix-missing-___clear_cache-when-targetting-iOS.patch
index b4a14f9..cdd4ef2 100644
--- a/patches/monero/0008-fix-missing-___clear_cache-when-targetting-iOS.patch
+++ b/patches/monero/0008-fix-missing-___clear_cache-when-targetting-iOS.patch
@@ -1,7 +1,7 @@
-From b154719d3fe7ae407de91f5c5a245998efd05997 Mon Sep 17 00:00:00 2001
+From d3a704bfb62bede87d5da0261585f62f19f858c1 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Tue, 2 Apr 2024 16:51:56 +0200
-Subject: [PATCH 8/8] fix missing ___clear_cache when targetting iOS
+Subject: [PATCH 08/10] fix missing ___clear_cache when targetting iOS
---
.gitmodules | 2 +-
diff --git a/patches/monero/0009-Add-recoverDeterministicWalletFromSpendKey.patch b/patches/monero/0009-Add-recoverDeterministicWalletFromSpendKey.patch
new file mode 100644
index 0000000..3c2510e
--- /dev/null
+++ b/patches/monero/0009-Add-recoverDeterministicWalletFromSpendKey.patch
@@ -0,0 +1,153 @@
+From 8db1b159445a8aaca702a8bacb9476abe3aebcf1 Mon Sep 17 00:00:00 2001
+From: Konstantin Ullrich <konstantinullrich12@gmail.com>
+Date: Wed, 11 Oct 2023 16:47:59 +0200
+Subject: [PATCH 09/10] Add recoverDeterministicWalletFromSpendKey
+
+This function is used by Cake Wallet to enable polyseed (dart implementation)
+support.
+
+Sourced from the following commit:
+https://github.com/cake-tech/monero/commit/cb6fb5ab218878702ed151c0e3d5d68eb2732788
+
+Co-authored-by: Godwin Asuquo <godilite@gmail.com>
+---
+ src/wallet/api/wallet.cpp | 29 +++++++++++++++++++++++++++++
+ src/wallet/api/wallet.h | 4 ++++
+ src/wallet/api/wallet2_api.h | 19 +++++++++++++++++++
+ src/wallet/api/wallet_manager.cpp | 16 ++++++++++++++++
+ src/wallet/api/wallet_manager.h | 7 +++++++
+ 5 files changed, 75 insertions(+)
+
+diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
+index 2fe0d1d29..2411d948c 100644
+--- a/src/wallet/api/wallet.cpp
++++ b/src/wallet/api/wallet.cpp
+@@ -820,6 +820,35 @@ bool WalletImpl::recover(const std::string &path, const std::string &password, c
+ return status() == Status_Ok;
+ }
+
++bool WalletImpl::recoverDeterministicWalletFromSpendKey(const std::string &path, const std::string &password, const std::string &language, const std::string &spendkey_string)
++{
++ clearStatus();
++ m_errorString.clear();
++
++ m_recoveringFromSeed = true;
++ m_recoveringFromDevice = false;
++
++ // parse spend key
++ crypto::secret_key spendkey;
++ if (!spendkey_string.empty()) {
++ cryptonote::blobdata spendkey_data;
++ if(!epee::string_tools::parse_hexstr_to_binbuff(spendkey_string, spendkey_data) || spendkey_data.size() != sizeof(crypto::secret_key))
++ {
++ setStatusError(tr("failed to parse secret spend key"));
++ return false;
++ }
++ spendkey = *reinterpret_cast<const crypto::secret_key*>(spendkey_data.data());
++ }
++
++ try {
++ m_wallet->generate(path, password, spendkey, true, false);
++ setSeedLanguage(language);
++ } catch (const std::exception &e) {
++ setStatusCritical(e.what());
++ }
++ return status() == Status_Ok;
++}
++
+ bool WalletImpl::close(bool store)
+ {
+
+diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
+index 4a16ca028..d0f443abc 100644
+--- a/src/wallet/api/wallet.h
++++ b/src/wallet/api/wallet.h
+@@ -77,6 +77,10 @@ public:
+ const std::string &address_string,
+ const std::string &viewkey_string,
+ const std::string &spendkey_string = "");
++ bool recoverDeterministicWalletFromSpendKey(const std::string &path,
++ const std::string &password,
++ const std::string &language,
++ const std::string &spendkey_string);
+ bool recoverFromDevice(const std::string &path,
+ const std::string &password,
+ const std::string &device_name);
+diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
+index 8a5c4135e..a585c8212 100644
+--- a/src/wallet/api/wallet2_api.h
++++ b/src/wallet/api/wallet2_api.h
+@@ -1302,6 +1302,25 @@ struct WalletManager
+ return createWalletFromKeys(path, password, language, testnet ? TESTNET : MAINNET, restoreHeight, addressString, viewKeyString, spendKeyString);
+ }
+
++ /*!
++ * \brief recover deterministic wallet from spend key.
++ * \param path Name of wallet file to be created
++ * \param password Password of wallet file
++ * \param language language
++ * \param nettype Network type
++ * \param restoreHeight restore from start height
++ * \param spendKeyString spend key
++ * \param kdf_rounds Number of rounds for key derivation function
++ * \return Wallet instance (Wallet::status() needs to be called to check if recovered successfully)
++ */
++ virtual Wallet * createDeterministicWalletFromSpendKey(const std::string &path,
++ const std::string &password,
++ const std::string &language,
++ NetworkType nettype,
++ uint64_t restoreHeight,
++ const std::string &spendKeyString,
++ uint64_t kdf_rounds = 1) = 0;
++
+ /*!
+ * \deprecated this method creates a wallet WITHOUT a passphrase, use createWalletFromKeys(..., password, ...) instead
+ * \brief recovers existing wallet using keys. Creates a view only wallet if spend key is omitted
+diff --git a/src/wallet/api/wallet_manager.cpp b/src/wallet/api/wallet_manager.cpp
+index c79fe25d6..f88bd9e64 100644
+--- a/src/wallet/api/wallet_manager.cpp
++++ b/src/wallet/api/wallet_manager.cpp
+@@ -127,6 +127,22 @@ Wallet *WalletManagerImpl::createWalletFromKeys(const std::string &path,
+ return wallet;
+ }
+
++Wallet *WalletManagerImpl::createDeterministicWalletFromSpendKey(const std::string &path,
++ const std::string &password,
++ const std::string &language,
++ NetworkType nettype,
++ uint64_t restoreHeight,
++ const std::string &spendkey_string,
++ uint64_t kdf_rounds)
++{
++ WalletImpl * wallet = new WalletImpl(nettype, kdf_rounds);
++ if(restoreHeight > 0){
++ wallet->setRefreshFromBlockHeight(restoreHeight);
++ }
++ wallet->recoverDeterministicWalletFromSpendKey(path, password, language, spendkey_string);
++ return wallet;
++}
++
+ Wallet *WalletManagerImpl::createWalletFromDevice(const std::string &path,
+ const std::string &password,
+ NetworkType nettype,
+diff --git a/src/wallet/api/wallet_manager.h b/src/wallet/api/wallet_manager.h
+index 28fcd36c9..be3ff8184 100644
+--- a/src/wallet/api/wallet_manager.h
++++ b/src/wallet/api/wallet_manager.h
+@@ -67,6 +67,13 @@ public:
+ const std::string &addressString,
+ const std::string &viewKeyString,
+ const std::string &spendKeyString = "") override;
++ virtual Wallet * createDeterministicWalletFromSpendKey(const std::string &path,
++ const std::string &password,
++ const std::string &language,
++ NetworkType nettype,
++ uint64_t restoreHeight,
++ const std::string &spendkey_string,
++ uint64_t kdf_rounds) override;
+ virtual Wallet * createWalletFromDevice(const std::string &path,
+ const std::string &password,
+ NetworkType nettype,
+--
+2.44.0
+
diff --git a/patches/monero/0010-Add-hex-encoding-and-tx-key-getter-for-PendingTransc.patch b/patches/monero/0010-Add-hex-encoding-and-tx-key-getter-for-PendingTransc.patch
new file mode 100644
index 0000000..502de5e
--- /dev/null
+++ b/patches/monero/0010-Add-hex-encoding-and-tx-key-getter-for-PendingTransc.patch
@@ -0,0 +1,68 @@
+From db90a0218d581276fcede6f188cc951499095a2f Mon Sep 17 00:00:00 2001
+From: M <m@cakewallet.com>
+Date: Fri, 21 Apr 2023 15:43:47 -0400
+Subject: [PATCH 10/10] Add hex encoding and tx key getter for
+ PendingTransction in wallet api.
+
+---
+ src/wallet/api/pending_transaction.cpp | 16 ++++++++++++++++
+ src/wallet/api/pending_transaction.h | 2 ++
+ src/wallet/api/wallet2_api.h | 2 ++
+ 3 files changed, 20 insertions(+)
+
+diff --git a/src/wallet/api/pending_transaction.cpp b/src/wallet/api/pending_transaction.cpp
+index 70a702796..be20b478c 100644
+--- a/src/wallet/api/pending_transaction.cpp
++++ b/src/wallet/api/pending_transaction.cpp
+@@ -78,6 +78,22 @@ std::vector<std::string> PendingTransactionImpl::txid() const
+ return txid;
+ }
+
++std::vector<std::string> PendingTransactionImpl::hex() const
++{
++ std::vector<std::string> hexs;
++ for (const auto &pt: m_pending_tx)
++ hexs.push_back(epee::string_tools::buff_to_hex_nodelimer(cryptonote::tx_to_blob(pt.tx)));
++ return hexs;
++}
++
++std::vector<std::string> PendingTransactionImpl::txKey() const
++{
++ std::vector<std::string> keys;
++ for (const auto& pt: m_pending_tx)
++ keys.push_back(epee::string_tools::pod_to_hex(pt.tx_key));
++ return keys;
++}
++
+ bool PendingTransactionImpl::commit(const std::string &filename, bool overwrite)
+ {
+
+diff --git a/src/wallet/api/pending_transaction.h b/src/wallet/api/pending_transaction.h
+index 0a9779c07..2fbaa83d9 100644
+--- a/src/wallet/api/pending_transaction.h
++++ b/src/wallet/api/pending_transaction.h
+@@ -58,6 +58,8 @@ public:
+ std::string multisigSignData() override;
+ void signMultisigTx() override;
+ std::vector<std::string> signersKeys() const override;
++ std::vector<std::string> hex() const override;
++ std::vector<std::string> txKey() const override;
+
+ private:
+ friend class WalletImpl;
+diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
+index a585c8212..1c3a11c39 100644
+--- a/src/wallet/api/wallet2_api.h
++++ b/src/wallet/api/wallet2_api.h
+@@ -126,6 +126,8 @@ struct PendingTransaction
+ * @return vector of base58-encoded signers' public keys
+ */
+ virtual std::vector<std::string> signersKeys() const = 0;
++ virtual std::vector<std::string> hex() const = 0;
++ virtual std::vector<std::string> txKey() const = 0;
+ };
+
+ /**
+--
+2.44.0
+