1871 Commits

Author SHA1 Message Date
Antoine Poinsot
24edaecbdc
commands: don't add der paths for keys from diff path but same signer
When creating a PSBT, we were checking whether the key was for this path
by checking its origin. This check would return false positive for keys
from other paths but same signer (which shares the same fingerprint).

Instead, check the entire origin for each key to make sure it's actually
the one used in the path we are interested about.

Thanks to Edouard Paris for finding this bug.
2023-10-24 15:44:48 +02:00
edouard
15851383a7 Single Add label button 2023-10-24 15:32:41 +02:00
edouard
7105698263
Merge #722: Only include BIP32 derivations for a single spending path when creating PSBTs
7f3b0b021858cfb2fe914f3ba6b30a39e3ae05ff qa: test a PSBT has only the BIP32 derivations for a single spending path (Antoine Poinsot)
b71bd693d6ea4c1c3567194fc82be43fb70c05bb qa: don't use a static dummy origin for descriptor xpubs (Antoine Poinsot)
a81d39c81a89cdf5e70b9888cbeb3abaf290a365 commands: do not include BIP32 derivations for other spending paths (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  edouardparis:
    ACK 7f3b0b021858cfb2fe914f3ba6b30a39e3ae05ff

Tree-SHA512: f0e132edf8d653c5575f843b1e85d995f155a2435a6e6257564dc945562df70ec2049c29d77f7580858d9e4a58290b0798f298f77c18255415c4cf26ccc07f33
2023-10-24 12:40:43 +02:00
Steven Roose
e07637c156
signer: Fix a small borrowck-related fixme 2023-10-23 22:45:38 +01:00
edouard
03c37bd378
Merge #736: Enhance labelling
b88781e62828cc6fc56e49f3ad1ebdeb39788573 remove font bold for labels (edouard)
8e806404c4e12f6d67cef320a4c5485723a0f993 change labels font weight for lists (edouard)
c170f7b25ba704beaa4e37a99302ccb25e0baa77 fix psbt labelling for single payment (edouard)
28aaca919aa7a1afc63a659780c6af063578a5ef gui: update liana:master (edouard)
0873cdb944e0bc4976b0f9dc6208fe68e322f330 disable confirm button if label len > 100 (edouard)
1aae2a52da94b6a3791a7a5b058e9e6a23483089 Add From: txid label for coin selection view (edouard)
07fbc0c1b3f3b55ebd7e684e2cf15032703c54db Attach outpoint and txid labels for single payment transaction (edouard)
bdac902307c25ee02093f369aca9258edacc4a4e Change coin change labelling (edouard)

Pull request description:

  tackle most issues of #732, may need another round of external tries

ACKs for top commit:
  edouardparis:
    Self-ACK b88781e62828cc6fc56e49f3ad1ebdeb39788573

Tree-SHA512: 51ee18d8a064afb6eb96926783f13fd7dc703e3464ff5af5d6f40e15ce86e16d8afd8b5f0ca82030976664101fd340f69a8c7102e88fd2c46d5755a4b0219286
2023-10-23 18:53:51 +02:00
edouard
b88781e628 remove font bold for labels 2023-10-23 18:28:53 +02:00
edouard
8e806404c4 change labels font weight for lists 2023-10-23 18:21:10 +02:00
edouard
c170f7b25b fix psbt labelling for single payment 2023-10-23 16:45:09 +02:00
edouard
28aaca919a gui: update liana:master 2023-10-23 16:17:57 +02:00
edouard
0873cdb944 disable confirm button if label len > 100 2023-10-23 16:17:57 +02:00
edouard
1aae2a52da Add From: txid label for coin selection view 2023-10-23 16:17:57 +02:00
edouard
07fbc0c1b3 Attach outpoint and txid labels for single payment transaction 2023-10-23 16:17:57 +02:00
edouard
bdac902307 Change coin change labelling 2023-10-23 16:17:57 +02:00
Antoine Poinsot
6869d8554a
Merge #737: Make it possible to delete labels
01ca960370b55042cfe364c14aa012f016e1fc2b Delete empty labels when they are updated (edouard)

Pull request description:

  This is an alternative to #735. I believe it's slightly better as it's shorter and does not introduce new allocations. I also addressed my review comments from #735.

ACKs for top commit:
  edouardparis:
    ACK 01ca960370b55042cfe364c14aa012f016e1fc2b

Tree-SHA512: 29819740e10458eb944c94eae732cea5104003c531f9b7374f9461bca30a7a829422856da70fca77fd21bd55105f9d6e018c7654f975922618e424bfbd40be94
2023-10-23 11:39:06 +02:00
edouard
01ca960370
Delete empty labels when they are updated
In order to delete a label, client sends in the
request a null value as label value.

Co-Authored-by: Antoine Poinsot <darosior@protonmail.com>
2023-10-21 09:21:02 +02:00
Antoine Poinsot
a4183dde69
Merge #734: commands: add weights before converting to vbytes
176859ed926febfa16055d9e8e8f57ddc72cb9ba commands: add weights before converting to vbytes (jp1ac4)

Pull request description:

  The `sanity_check_psbt()` function checks, among other things, that the feerate in sats/vbytes is in the required range. When estimating the transaction size, converting each part to vbytes first can lead to a larger result due to rounding multiple times and therefore a lower feerate, which could fall below 1 and fail the sanity check.

  This issue has arisen in #560 when creating a transaction using coin selection.

ACKs for top commit:
  darosior:
    utACK 176859ed926febfa16055d9e8e8f57ddc72cb9ba -- great catch

Tree-SHA512: 5e4fc795c5977c71a0f02b21c09cd71d59c9412f94bcafd5a4adb429c4ae3a568a25c4174bd305e0be927f06ae4e9be9aef791ffbbee2a7ac1c40740f639ab10
2023-10-20 12:42:32 +02:00
edouard
65cf5cc884
Merge #731: installer: forbid keys with same master fg in same path
70dea710ae4e4427402120cc8f54516d9f2cf9b4 installer: forbid keys with same master fg in same path (edouard)

Pull request description:

  ![2023-10-19T17:59:11,287163921+02:00](https://github.com/wizardsardine/liana/assets/6933020/2a7041fa-8d17-43b0-94a9-3412caebc9cc)
  based on #723

ACKs for top commit:
  edouardparis:
    Self-ACK 70dea710ae4e4427402120cc8f54516d9f2cf9b4

Tree-SHA512: 82ef0cbcdad827ae2df4e15cc86cdb54aab29f959124ad35aee5f3e0ba24e2773279d8be109ee33569681c287dcd066e05df4950ff3a773975546a0991b84000
2023-10-20 12:08:56 +02:00
edouard
70dea710ae installer: forbid keys with same master fg in same path 2023-10-20 11:48:18 +02:00
jp1ac4
176859ed92
commands: add weights before converting to vbytes
Converting to vbytes first can lead to a larger result and
therefore a lower feerate, which could fall below 1 and fail the
sanity check.
2023-10-20 10:03:03 +01:00
Antoine Poinsot
4f2ff1abc0
Merge #723: descriptors: prevent using a signer more than once in a single path
730409eb5299724cdbe1a4da06d272098a791621 descriptors: prevent using a signer more than once in a single path (Antoine Poinsot)
0a95266cce618f83782d3d30362cb2d383b659bf qa: don't use a static dummy origin for descriptor xpubs (Antoine Poinsot)

Pull request description:

  This is necessary to support signers which sign for a single key at once. It also doesn't make any sense to reuse a signer within the same spending path, so rule it out before it creates any new edge cases.

  For more about the Bitbox signer support, which motivated this change, see
  https://github.com/wizardsardine/liana/pull/706#issuecomment-1744705808.

ACKs for top commit:
  edouardparis:
    ACK 730409eb5299724cdbe1a4da06d272098a791621

Tree-SHA512: 3fb34f2a85e103ca5f8eeec901c283c649636971f7730743af24b270626a7fdf11f207a8f3535c9ff69ce475f34c69472595219ac97b8cfd5749379c4213a6e5
2023-10-20 10:15:42 +02:00
Antoine Poinsot
9b7273651b
Merge #730: ci: use Bitcoin Core 25.1
42ab2f686fd87be98381547486f684c23ac9cdcf ci: use Bitcoin Core 25.1 (fanquake)

Pull request description:

ACKs for top commit:
  darosior:
    Thanks! ACK 42ab2f686fd87be98381547486f684c23ac9cdcf

Tree-SHA512: 151a53fe76536a15f4d3b3ea2c943cf930d91d6656e239f4bed278772184cf7452e911795df66dd2b8735b8b3157ace8f3e32f65c2b9e1341b04aec3da303287
2023-10-20 10:14:28 +02:00
Antoine Poinsot
935d2964da
Merge #729: Make sure we're actuall caught up to tip before starting up
6dfa04f6c7f6e5649f44ccf1503d9ce6b75d7568 bitcoin: also log the number of verified blocks in the poller (Antoine Poinsot)
b84dbc668c5aeb2560ee2b595c46e42ee89b7f40 commands: don't return 100% sync progress until we're done syncing (Antoine Poinsot)
f687145c1e5865c2e9be9aa7643c64da6f1ee0ff bitcoin: make sure we are *completely* synced before starting up (Antoine Poinsot)
03fe06fd1f1d5c32b4630b40f253d49e3e44b55d descriptors: remove trailing debug trace (Antoine Poinsot)

Pull request description:

  Fixes #726. We actually do update our internal state before we are synced but we weren't waiting for the chain to be entirely synced.

ACKs for top commit:
  edouardparis:
    ACK 6dfa04f6c7f6e5649f44ccf1503d9ce6b75d7568

Tree-SHA512: 0c3a2494b1522d94cb2731e951bca9623fa02824426ab0a526e2a99b0c5433bb11059717ad1873eda778f175bafbbf636dedfaccfae88f217de0d5e677458fc1
2023-10-20 10:12:57 +02:00
fanquake
42ab2f686f
ci: use Bitcoin Core 25.1 2023-10-19 11:08:03 +01:00
edouard
2fbafd9325
Merge #621: Gui labels
757b53ebab43c05a444ce22c8dd666fb367e6ee0 cargo update -p liana (edouard)
aeff735ac320e4c3addb11460869fc0cb0146802 fix unconfirmed payments layouts with labels (edouard)
dbb91464c82bb11be4fab679a673c3695248dd7d fix update labels for pending_txs (edouard)
9edcdd9a4e4170ce48ca656e0e8f36dcbe42ff07 Add labels to change outputs according to main label (edouard)
2354ac9175b5766286852a035c106e44425ffb72 cargo clippy --fix --lib -p liana_gui (edouard)
9db4541952561de8d50bdee35fa7ec737c3e65e8 Add labels support to gui (edouard)

Pull request description:

  This PR use the lianad update_labels and get_labels commands.
  It also introduce new concepts from talks with Kevin and Antoine:
  - User spending is creating a payment, when he does not add multiple recipients anymore, he is doing multiple payment in one bitcoin transaction.
  - a transaction that have multiple outgoing outputs (multiple payment) is tagged as a 'Batch'.

ACKs for top commit:
  edouardparis:
    Self-ACK 757b53ebab43c05a444ce22c8dd666fb367e6ee0

Tree-SHA512: 2208009fcc0ab8f587929a347d191d428156984e87b732fb6efa5f08a3962c85510c82fcdeba687a6d2bd2fa45f5a17384d8a9b709e1407ebbbe0f451fe69e90
2023-10-19 10:49:20 +02:00
Antoine Poinsot
6dfa04f6c7
bitcoin: also log the number of verified blocks in the poller 2023-10-19 10:11:12 +02:00
Antoine Poinsot
b84dbc668c
commands: don't return 100% sync progress until we're done syncing 2023-10-19 10:09:35 +02:00
Antoine Poinsot
f687145c1e
bitcoin: make sure we are *completely* synced before starting up
When not in IBD but catching up to the latest tip, our rounding up of
verificationprogress makes us start while bitcoind is still kind of far
from being caught up. Make sure it doesn't happen by not returning until
bitcoind validated all the blocks we've fetched the headers for.
2023-10-18 19:12:33 +02:00
Antoine Poinsot
03fe06fd1f
descriptors: remove trailing debug trace 2023-10-18 19:10:19 +02:00
edouard
757b53ebab cargo update -p liana 2023-10-18 17:37:12 +02:00
edouard
aeff735ac3 fix unconfirmed payments layouts with labels 2023-10-18 17:37:12 +02:00
edouard
dbb91464c8 fix update labels for pending_txs 2023-10-18 17:37:12 +02:00
edouard
9edcdd9a4e Add labels to change outputs according to main label 2023-10-18 17:37:12 +02:00
edouard
2354ac9175 cargo clippy --fix --lib -p liana_gui 2023-10-18 17:37:12 +02:00
edouard
9db4541952 Add labels support to gui 2023-10-18 17:37:12 +02:00
Antoine Poinsot
605a13d4ba
Merge #724: bitcoind: don't set load_on_startup when loading watchonly wallet
e072e896c7dc744147c38a7d36d9eedd413399fa bitcoind: don't set load_on_startup when loading watchonly wallet (Antoine Poinsot)

Pull request description:

  This was necessary to transition wallets that were created without this flag, but since v2 they are always created with it so this is redundant: it'd unnecessarily try to update the flag over and over again on bitcoind's side, always with the same value.

  Fixes #641.

ACKs for top commit:
  edouardparis:
    utACK e072e896c7dc744147c38a7d36d9eedd413399fa

Tree-SHA512: 517cdb2ee44f9237325dee76646aa84decc5bfb8c375798ebf6a8729c3acbe1661afb61eb69901a284bd6074b2b090115d145ec2a87cba1d434e6f77e78cbb14
2023-10-17 12:33:37 +02:00
Antoine Poinsot
e8ba65c501
Merge #725: gui: display (estimated) feerate
846431ed53efd2b29aefabe84ed56d054c0d4b45 gui: display (estimated) feerate (jp1ac4)

Pull request description:

  This is to resolve #558.

  For transactions that have been broadcast, the feerate is calculated using the transaction's actual size. For PSBTs, the feerate is calculated using the max satisfaction size for all inputs, whether they have been signed or not (see https://github.com/wizardsardine/liana/issues/558#issuecomment-1750128022).

  In both cases, the calculated feerate currently has type `u64`.

  This is an example of a transaction on the Home tab:
  ![image](https://github.com/wizardsardine/liana/assets/121959000/ad81094f-ac16-4dd4-9229-75dbda2ca5b5)

  The same transaction on the Transactions tab:
  ![image](https://github.com/wizardsardine/liana/assets/121959000/576f3f1f-81c0-4f1f-8f9d-fc4e1fdec000)

  On the PSBTs tab, the feerate is an estimate:
  ![image](https://github.com/wizardsardine/liana/assets/121959000/cf7a4d44-fe5e-44a8-b9bb-e429e76540a5)

ACKs for top commit:
  edouardparis:
    ACK 846431ed53efd2b29aefabe84ed56d054c0d4b45
  darosior:
    Github ACK 846431ed53efd2b29aefabe84ed56d054c0d4b45 -- feerate estimate assumption seem fine for now.

Tree-SHA512: 499e798a62bad2f1937ab7aa303bccbdfd5b58c730c0384f1ab58d8e2904b30221c585eb37e11cabb200662920bbdca2b1c5ce886eb187539386da42daa64bbd
2023-10-17 12:27:41 +02:00
jp1ac4
846431ed53
gui: display (estimated) feerate
For transactions that have been broadcast, the feerate is calculated
using the transaction's actual size. For PSBTs, the feerate is
calculated using the max satisfaction size for all inputs, whether
they have been signed or not.
2023-10-12 16:16:55 +01:00
Antoine Poinsot
7f314844b1
Merge #710: Try.md update with Liana 2.0 managed node
5858f2c30b7bd71a1027fa7484bf989b9891bd3a Update doc/TRY.md (Kevin Loaec)
e069be87c42f620f210f85e0762f4fdd41c00255 Update doc/TRY.md (Kevin Loaec)
e5652d9eb8d885d3f8598c90dcc406f7f1106b7e Update TRY.md (Kevin Loaec)
02a18392622b5b21b73c699ebbbc6b3dffc2db48 Update TRY.md (Kevin Loaec)
e1451fc2af4e432e7bf3365816a51ccd08eb86ff Update TRY.md (Kevin Loaec)

Pull request description:

ACKs for top commit:
  darosior:
    ACK 5858f2c30b7bd71a1027fa7484bf989b9891bd3a

Tree-SHA512: 2dcbb7d0c83c9ebe5fe3c8d4242ae33879dc889da283c2752c904d6b282be3c6388496a75c06b1ea5b83604e6076214be16bfaec365e7891222c53a31718ab31
2023-10-08 12:37:57 +02:00
Antoine Poinsot
b877498284
Merge #716: Minor fix RECOVER.md
78ac13cdb56426f38523d0b0b9fbd241dd655673 fee_rate (pythcoiner)
a0186a95509bcea147f19da3f9360ed427ae7bd6 liana => liana_recovery (pythcoiner)

Pull request description:

ACKs for top commit:
  darosior:
    ACK 78ac13cdb56426f38523d0b0b9fbd241dd655673

Tree-SHA512: 450e1d8dc6090a1a9d13f617f2c2ff58f0e95b27fa76cbfe1ece342fb783c6f7ba75df12e40b40bbab88f63ecf9ae348ffc2a070efd2bd887ca9ff0ed8105ad1
2023-10-08 12:35:41 +02:00
Antoine Poinsot
e072e896c7
bitcoind: don't set load_on_startup when loading watchonly wallet
This was necessary to transition wallets that were created without this
flag, but since v2 they are always created with it so this is redundant:
it'd unnecessarily try to update the flag over and over again on
bitcoind's side, always with the same value.
2023-10-08 12:31:41 +02:00
Antoine Poinsot
730409eb52
descriptors: prevent using a signer more than once in a single path
This is necessary to support signers which sign for a single key at
once. It also doesn't make any sense to reuse a signer within the same
spending path, so rule it out before it creates any new edge cases.

For more about the Bitbox signer support, which motivated this change,
see
https://github.com/wizardsardine/liana/pull/706#issuecomment-1744705808.
2023-10-08 11:50:59 +02:00
Antoine Poinsot
0a95266cce
qa: don't use a static dummy origin for descriptor xpubs 2023-10-08 11:50:58 +02:00
Antoine Poinsot
7f3b0b0218
qa: test a PSBT has only the BIP32 derivations for a single spending path 2023-10-06 18:23:12 +02:00
Antoine Poinsot
b71bd693d6
qa: don't use a static dummy origin for descriptor xpubs 2023-10-06 18:23:12 +02:00
Antoine Poinsot
a81d39c81a
commands: do not include BIP32 derivations for other spending paths
When creating a PSBT, only include the BIP32 derivations in each input
for the spending path this PSBT was created for.

This is to workaround Bitbox only providing a single signature per
input. Most likely other signing devices will have this behaviour too in
the future. See
https://github.com/wizardsardine/liana/pull/706#issuecomment-1744705808.
2023-10-06 18:23:11 +02:00
edouard
19491d1d00
Merge #720: gui: Trim text inputs
9895b493f1d79ae8fc5a1591ef455ccda2d81ccd gui: trim text input strings (jp1ac4)
d3f2931375ff95c201a60164bf1015f18c6e87ce gui: remove unused file (jp1ac4)

Pull request description:

  This is to resolve #323.

  Following suggestions in #323, I've added a new `TrimmedString` struct that takes a string and applies `trim()`. This type is then used as `form::Value<TrimmedString>` to ensure text inputs are trimmed.

  I'm creating this PR as draft to check if this is the right approach before applying the change to other inputs.

  I've also removed a view file that seems to have been created accidentally.

ACKs for top commit:
  edouardparis:
    ACK 9895b493f1d79ae8fc5a1591ef455ccda2d81ccd

Tree-SHA512: 76c7f28ed2d0b6b6b76658a9368b918b0b211e2fabd72ac5d19c13adcbb2d3645b78680a8849f235ee58620fbe8df440ef8354f2d50d39601879bb7727465335
2023-10-06 10:22:53 +02:00
jp1ac4
9895b493f1
gui: trim text input strings
This is applied to all forms except those concerning fingerprint labels
and the new GUI labels feature.
2023-10-06 01:48:41 +01:00
edouard
52eabd6e07
Merge #715: installer: Finalize installation and start automatically on final step
f771e674faccf150a5210b3abe829d443619c3e6 gui(installer): restrict clicking previous on final step (jp1ac4)
45f91216d5d0991d7aebde8d4c8bc99edaf5521a gui(installer): remove unused fields from final step (jp1ac4)
03c2bd76b8c6c1b721014afb37da7732ddfeb0cd gui(installer): install and start automatically on final step (jp1ac4)

Pull request description:

  This is to resolve #679.

  The following changes have been made:
  - Change title of final step to "Finalize installation"
  - Install and load wallet automatically when reaching final step
  - Remove fields from `Final` step that are no longer used

  This is how the page looks when installing:
  ![image](https://github.com/wizardsardine/liana/assets/121959000/a5f2b35d-4c4b-4316-9b7b-744a19daf597)

  The following is only shown for ~1 sec once wallet has been installed and before loading wallet:
  ![image](https://github.com/wizardsardine/liana/assets/121959000/830240a1-860c-4c89-890a-e1fb91adfc25)

ACKs for top commit:
  edouardparis:
    ACK f771e674faccf150a5210b3abe829d443619c3e6

Tree-SHA512: b5360c77a13e4028331e4072246f1c897aa6fe61b0c8697b33d5c91ed460e55fe76b8808f4779db2b2f0322e27433e5dbb72fd0210cbf77f28a270bd82ea2558
2023-10-05 11:09:38 +02:00
jp1ac4
f771e674fa
gui(installer): restrict clicking previous on final step 2023-10-04 18:26:08 +01:00
edouard
b38d63d665
Merge #721: gui: show more info on synchronisation screen
2a9274adba60b9d4f2895f5547aa88c432ac9349 gui: show more info on synchronisation screen (jp1ac4)

Pull request description:

  This is to resolve #646.

  I've added the specified text to the synchronisation screen and also display the progress as a percentage above the progress bar.

  This is how it looks (on signet with Liana-managed bitcoind):

  ![image](https://github.com/wizardsardine/liana/assets/121959000/c274a373-3691-4035-a04e-e443853a4074)

  ![image](https://github.com/wizardsardine/liana/assets/121959000/bc2e9055-a9d6-4f68-b303-0ffa82bc08ab)

  ![image](https://github.com/wizardsardine/liana/assets/121959000/1a58a21c-f5ee-403e-bf40-09bdb1a6bf6f)

  Also, for external bitcoind:

  ![image](https://github.com/wizardsardine/liana/assets/121959000/e85efe6c-9f45-4cf7-97ba-15e40492655d)

ACKs for top commit:
  edouardparis:
    ACK 2a9274adba60b9d4f2895f5547aa88c432ac9349

Tree-SHA512: d12ab5c4dc4951c2393f2a9f26f3d01bcee82592b7dfc33c2fbf522e29745b1d894e1023daeb6ad1ae8082f1a9715c6487e1fd8e84db61574d96919f040c9323
2023-10-04 11:14:33 +02:00