Commit Graph

85 Commits

Author SHA1 Message Date
tomFlowee 11952ee75b Auto-archive the initial wallet after a while.
In some cases the initially created wallet is left running and taking a
peer (in order to check if anything ever got deposited at the QR-code
shown address).
This now sunsets those wallets after 2100 blocks (over 2 weeks).
2022-08-17 23:42:19 +02:00
tomFlowee b74bd2b7c1 This shows the xpub of a wallet in the details screen
Add xpub getters and property + show in details
2022-08-17 18:45:37 +02:00
tomFlowee e1cb6d3c40 Make connection between payment request & wallet more robust
As they have a pointer to each other we have to be a bit smart about how
removing works and how deletion works. Because otherwise we'll end up
with calling a deleted object.
2022-07-21 13:10:44 +02:00
tomFlowee df6eb5fb4c Improve PR saving and avoid unneeded wallet-writes.
For a payment-request we now remember if its been stored-to-disk so when
it gets removed again before we ever store it, we skip forcing an
unneeded save.
2022-07-15 14:20:58 +02:00
tomFlowee 6e4aa0065e Switch to the string type for saving mnemonics
This solves a recently introduced debt.
2022-07-14 17:03:00 +02:00
tomFlowee d4658564ff Use secure allocator for mnemonic
This ensures that we not swap out this value.
2022-07-14 15:28:23 +02:00
tomFlowee 0c9136be3b Refactor wallet encryption
This stops re-loading of the wallet-data on decrypt but instead keeps
the encrypted data in memory next to the (possibly) decrypted data.

This then means we can save a wallet that has its secrets still
encrypted (no password supplied) which is needed in order to propery
support the concept of xpub.

So, now a HD wallet that is closed can correctly sync and create new
public keys (which are needed to sync), including the step of saving
those to disk.
The first time the user provides a password we'll then create the
matching private keys (and their encrypted counterparts) which will then
be saved, and naturally can be used to sign transactions.
2022-07-13 13:54:29 +02:00
tomFlowee d42357e511 Match operator= with copy constructor.
This solves a gcc warning.
2022-07-11 19:26:59 +02:00
tomFlowee fdf42777c4 Save HD wallet data encrypted. 2022-07-11 18:30:18 +02:00
tomFlowee a94d305f42 Follow rename of CKey to PrivateKey 2022-07-06 22:15:08 +02:00
tomFlowee 663169530d Follow rename of CKeyID -> KeyId 2022-07-06 22:06:58 +02:00
tomFlowee 5720b9c2d0 Move wallet name to its own file.
This allows us to just fully encrypt the wallet.dat while still being
able to see the name of the wallet.
2022-06-24 15:02:52 +02:00
tomFlowee 940b1c9010 Make simple getter const. 2022-06-23 13:58:36 +02:00
tomFlowee 7558fb1517 Refactor encryption, pass pwd when needed. 2022-06-19 14:29:27 +02:00
tomFlowee 263418cffc Add various encryption UI parts. 2022-05-18 20:25:03 +02:00
tomFlowee 4bf79a7ae4 Add quick-and-dirty UI for encryption details.
Also avoid trying to save an encrypted wallet from the PaymentRequest
2022-05-18 15:48:50 +02:00
tomFlowee 9afdad806f Add more encryption support to the QML classes.
Also allow better interaction with the wallet.
2022-05-18 12:59:01 +02:00
tomFlowee e120df9b71 Implement fully encrypting the wallet files.
For the 'fullyEncrypted' option we now simply fully
encrypt the entire blob of both the secrets file as well
as the wallet.dat (which transactions we own).
2022-05-17 22:26:48 +02:00
tomFlowee f0ca231e7a Make the re-loading of an encrypted tx work. 2022-05-17 16:21:59 +02:00
tomFlowee fe6fa98ff2 Make full-encrypted encrypt the transactions
This additionally makes the password get hashed more often and we create
an 'iv' from it as well.
2022-05-17 00:44:51 +02:00
tomFlowee a58bf9f09f Make basic wallet-encryption work.
We encrypt using a standard AES256 encryption scheme.
The key is 256 bits and we derive that from a user provided password
which we double-hash (sha256). Additionally we use a randomly generated
salt for a specific wallet that is fed into the hashing algo as well.

This version simply encrypts the private keys of a wallet, which makes
it quite basic. A good start.
2022-05-14 14:34:28 +02:00
tomFlowee 2accfa9700 Start wallet-encryption 2022-05-13 19:29:25 +02:00
tomFlowee ba589abbea Fix typo in methodname. 2022-05-11 21:00:48 +02:00
tomFlowee f786db4627 Find address info. 2022-04-07 18:16:03 +02:00
tomFlowee 5aa2644717 Notify the UI about transaction comments. 2021-12-04 19:13:26 +01:00
tomFlowee d1e44fa515 Make an initial version of send-tx feedback. 2021-11-29 23:17:45 +01:00
tomFlowee ab79416de5 Merge branch 'master' into SendPanel 2021-11-27 09:26:05 +01:00
tomFlowee 3b85dfd2f3 Improve the output selection
This prioritizes cashfusion outputs in selection.
This optimizes different the number of outputs for single-key
wallets.
2021-11-26 17:01:30 +01:00
tomFlowee 6c805f29e8 Add Wallet::isLocked(outRef) const 2021-11-23 22:46:28 +01:00
tomFlowee e8c96d7c23 Add selection of inputs and make the UI pretty. 2021-11-23 17:17:40 +01:00
tomFlowee 9a2fe0444c Add most of WalletCoinsModel content. 2021-11-23 11:22:01 +01:00
tomFlowee ee50b65e66 Detect CashFusion transactions 2021-11-16 15:08:22 +01:00
tomFlowee ea8758c03d UX fixlets
- extend clearing of 'new' icon timeout.
- make unconfirmed transactions also 'new'
- put a timer on the datetime item of the transaction to allow
timestamps like "now" and "an hour ago" to be updated as time passes.
2021-11-09 20:49:37 +01:00
tomFlowee 7079b2c4a4 Make HD wallets put change on change addresses. 2021-11-09 10:37:31 +01:00
tomFlowee 5edfbe7ca4 Add test for rejected transactions 2021-11-08 19:36:47 +01:00
tomFlowee 06b02db4dc Add new unittest and code for output locking 2021-11-08 15:24:48 +01:00
tomFlowee d70eb30db4 Add API docs. 2021-11-08 15:23:29 +01:00
tomFlowee 351283e6bf Fix typo in methodname. 2021-11-08 15:21:53 +01:00
tomFlowee cfcbdede36 Add wallet-upgrade (version 1 -> version 2)
We introduced for secret keys the signature-type field, which is required
to avoid signing with one key as both Schnorr and ecdsa as
that can cause leakage making recovering the private key much easier.

So, we now store this data but old wallets didn't fetch that from
the incoming transactions. So this conversion fetches the data from the
transactions (which are on the device) and stores the sigtype with the
keys.
2021-11-02 14:54:59 +01:00
tomFlowee 27feaef5c4 Follow upstream refactor 2021-11-02 11:09:56 +01:00
tomFlowee 3696499d9f Split HD key managent into created and bloom-asked
The bloom filter didn't include all created keys and thus we didn't send
the bloom in some cases.

Now we keep track of exactly which keys were sent and we re-send a bloom
filter if half of those have been used in order to not miss out on any
transactions.
2021-11-01 13:33:33 +01:00
tomFlowee 35bd66297d Find in the transactions the signature type used.
As transactions are found on the blockchain we remember the signature
type used in order to avoid one private key to be used for both types of
signatures, which can cause compromised keys.
2021-10-31 16:56:03 +01:00
tomFlowee 32d2142ab0 Show dates nicer
This adds the feature that we show a "last receive" field on a wallet,
and we also change the date format to have "yesterday" style dates
for recent ones.
2021-10-31 15:30:38 +01:00
tomFlowee d50b0c169c Make wallet details pane more complete. 2021-10-30 15:23:43 +02:00
tomFlowee 6057d589b1 Working on a new AccountDetails view. 2021-10-29 18:20:42 +02:00
tomFlowee 80d7456898 Make new-wallet pane functional.
This changes the default generated wallet to be a HD wallet.
We also add a helper class to configure newly created wallets from QML.
This finishes up the new wallet panel to have all the visible features
actually do something.
2021-10-27 19:11:00 +02:00
tomFlowee da8b883116 Add 'startHeight' advanced property to import wallet.
This also fixes a bunch of bugs which makes HD wallets in principle work
(tested with big test wallet).
2021-10-21 20:54:34 +02:00
tomFlowee 80f731b8b4 Show more details about HD wallet in UI 2021-10-21 17:04:20 +02:00
tomFlowee d839e18ed2 Add to wallet ability to sync a HD path 2021-10-21 14:57:20 +02:00
tomFlowee 1106937648 Make wallet able to be hierarchically deterministic 2021-10-14 14:42:27 +02:00