93 Commits

Author SHA1 Message Date
edouardparis
b6971fdd64 Prepare version 12.0 2025-07-22 10:38:42 +02:00
Michael Mallan
cb60089ace
fix(poller): only update last used index for affected keychain 2025-07-09 10:48:18 +01:00
edouardparis
fef70879b9 refac: remove patch field from Version
The Version struct is used across the software
to display the release version. A release version
does not include patch number as we increment
only the major and the minor during a new release.

For very small patch that does not change the
API and does not require a new release, then the crates
Cargo.toml version patch number will be incremented.
2025-06-16 18:48:31 +02:00
edouardparis
a9d417bc39 Prepare v11.0-dev 2025-05-26 11:11:46 +02:00
Michael Mallan
3d6a22ea05
feat: add rpc command to list revealed addresses 2025-05-07 08:48:34 +01:00
Michael Mallan
d4151d88d6
rpc: allow to choose outpoints in createrecovery
To maintain backwards compatibility, the `outpoints` parameter
is the final positional argument and can be omitted entirely.
2025-04-08 14:50:10 +01:00
Michael Mallan
e987458657
lianad: ensure consistent derivation index management
The database should store the last used/revealed derivation index.

Docstrings have been updated accordingly.

Getting a new address requires that the database value first be
incremented.

When listing addresses without specifying a count, all
used/revealed addresses should be returned.
2025-03-24 18:39:04 +00:00
Michael Mallan
81a5b159e5
chore(qa): run black formatter 2025-03-24 16:17:45 +00:00
edouardparis
88cebffb03 Prepare v10.0 2025-03-21 16:12:32 +01:00
pythcoiner
2291138fb6
lianad: docs & tests for getlabelsbip329 command 2025-03-19 07:43:41 +01:00
pythcoiner
9417549ddb
lianad: docs & tests for updatederivationindexes command 2025-03-19 07:43:41 +01:00
pythcoiner
107e81071c
lianad; update docs & tests for getinfo command 2025-03-19 07:26:04 +01:00
Michael Mallan
1859a2d5f0
bump bdk_coin_select to 0.4
Weights are now stored as `u64` instead of `u32`.

The tests have been updated to reflect that coin selection now
calculates feerates using a transaction's size in rounded-up
vbytes.
2025-01-30 15:45:15 +00:00
Michael Mallan
4d05c1f0ff
commands: allow rbf for spending txs without saved psbt 2025-01-29 15:54:39 +00:00
Michael Mallan
4ce5ca4d80
qa: check psbt must be saved in db to use rbf 2025-01-29 15:45:20 +00:00
edouardparis
d0fefc37f4 Prepare v9 release 2025-01-07 11:22:24 +01:00
Michael Mallan
6b914fd249
bitcoind: parse descriptor before comparing strings
Parsing the descriptor first will ensure a match is found
regardless of whether bitcoind uses `h` or `'`.
2024-12-30 17:12:28 +00:00
Michael Mallan
1c0338610f
commands: add is_from_self to listcoins response 2024-12-02 10:08:18 +00:00
edouardparis
95e97bc7dc Bump liana version v8 2024-11-05 11:11:20 +01:00
Michael Mallan
0f9f1f352c
commands: return last poll timestamp from getinfo 2024-10-24 11:24:31 +01:00
edouardparis
aa1ca64816 Bump liana v7.0 2024-09-12 09:31:21 +02:00
Michael Mallan
b630d46770
func test: wait for block heights to match
This is copied from darosior's changes in
https://github.com/wizardsardine/liana/pull/1222#issuecomment-2324894986.
2024-09-05 14:56:00 +01:00
jp1ac4
371e31e3f3
func test: allow to run using electrs backend 2024-09-05 14:55:53 +01:00
jp1ac4
1b04b29491
func test: fix min rbf feerate
Here, the min RBF feerate is 1 more than that of the transaction
to be replaced.

The feerate of the transaction to be replaced may vary slightly
depending on the signature size and is calculated during the test.
As such, the min feerate should be set according to this
calculated value.
2024-09-05 14:55:48 +01:00
Antoine Poinsot
b2aeafab56
Merge #1186: Add minimum feerate to TooLowFeerate error message
8be0d9856b29eb30593ae7614fe74430ffd206d4 commands: add minimum feerate to TooLowFeerate error message (Aaron Carlucci)

Pull request description:

  This PR adds the minimum feerate value into the `TooLowFeerate` error message for additional context. Addresses the second bullet point in #853.

ACKs for top commit:
  jp1ac4:
    ACK 8be0d9856b29eb30593ae7614fe74430ffd206d4. Thanks!

Tree-SHA512: 3a0e9c69ddb40433faf1e58c16dfee0212641b34478eddeda99388ebf82e2fb466633ab8f79c9bb0bb784f4a46807aa0a5abd65b9d92506144b84addb01dfdd8
2024-07-29 13:53:27 +02:00
Antoine Poinsot
bb68fb5ec1
Merge #1092: spend: randomized anti-fee sniping
f2791744d8ad3068d12a39bb07f3745012785a5f spend: set locktime for anti-fee sniping (jp1ac4)

Pull request description:

  This is to resolve #44.

  In the first commit, I combine the destinations and change parameters in `spend::create_spend` in order to avoid "too many arguments" error when adding a new parameter. I think these two parameters combine naturally so that `destinations` includes both recipients and change address.

  The second commit sets locktime following the same approach as Bitcoin Core:
  - locktime is set to current tip height, but randomly (about 10% of cases) value is set up to 100 blocks earlier
  - if tip is more than 8 hours old, locktime is set to 0

  For randomness, I'm currently using the current time's milliseconds in order not to add another dependency, which I think is good enough for this use case.

  For consistency, I decided to use "locktime" everywhere instead of "lock time" or "lock-time".

ACKs for top commit:
  darosior:
    ACK f2791744d8ad3068d12a39bb07f3745012785a5f

Tree-SHA512: 69a57cf664e24b32a835c35eaf9016961b2d0f396891a826582044e6302b2ca04dcf5bf2617b5e18dcbfa25cc254a6e8025262718984095677c829ce051a66cc
2024-07-29 12:32:29 +02:00
Aaron Carlucci
8be0d9856b commands: add minimum feerate to TooLowFeerate error message 2024-07-10 14:47:10 +02:00
Antoine Poinsot
168112de10
Bump version to 6.0 2024-06-27 15:53:30 +02:00
jp1ac4
0eda557fdf
descriptors: improve satisfaction size estimate for primary path
Thanks to darosior for providing the changes to `max_sat_weight`
and the Taproot sanity checks test.
2024-06-20 17:09:38 +01:00
jp1ac4
f2791744d8
spend: set locktime for anti-fee sniping 2024-05-28 07:50:48 +01:00
Antoine Poinsot
d9337121ab
Bump Liana version 2024-03-22 16:42:33 +01:00
Antoine Poinsot
ecef6bff5e
qa: functional tests lianad using Taproot descriptors
We introduce Taproot support in the test framework through a global
toggle. A few modifications are made to some tests to adapt them under
Taproot (notably the hardcoded fees / amounts).

This is based on my introduction of a quick and dirty support for
TapMiniscript in my python-bip380 library:
https://github.com/darosior/python-bip380/pull/23. In addition to this i
didn't want to implement a signer in the Python test suite so here we
introduce a simple Rust program based on our "hot signer" which will
sign a PSBT with an xpriv provided through its stdin and output the
signed PSBT on its stdout. Eventually it would be nicer to have a Python
signer instead of having to call a program.

The whole test suite should pass under both Taproot and P2WSH. Only a
single test is skipped for now under Taproot since it needs a finalizer
in the test suite.

I also caught a bug in the RBF tests which i fixed in place.
2024-03-13 19:21:52 +01:00
Antoine Poinsot
cf299b997b
Merge #957: Get genesis timestamp from bitcoind
f2c418f79a6fe8f1d6138b12af9fdc7303b4725d get genesis timestamp from bitcoind (pythcoiner)

Pull request description:

  fixes #904

ACKs for top commit:
  jp1ac4:
    ACK f2c418f79a.

Tree-SHA512: 7b1b7c13c21b657109ab0aab0d89deb47f5f6693f95687b86c219fc109ee304c38e3ebe865d071ebbbfa890a6a754c615f5dd70f2fe8c492bdea35d0394f36eb
2024-03-09 19:04:00 +01:00
pythcoiner
da1ebce5b6 add txids param to listspendtxs 2024-02-24 21:56:48 +01:00
pythcoiner
f2c418f79a get genesis timestamp from bitcoind 2024-02-11 01:59:49 +01:00
Antoine Poinsot
79141e2042
Merge #927: commands: include missing amount in spend response
13398982534d56a5723dfa86723c5917483c8653 commands: include missing amount in response (jp1ac4)

Pull request description:

  This PR follows a discussion around https://github.com/wizardsardine/liana/pull/873#issuecomment-1886715468.

  The GUI uses the `InsufficientFunds` error to get the missing amount when the user is creating a new spend, but it is not straightforward to extract this information in a general way from the RPC error (see https://github.com/wizardsardine/liana/issues/822#issuecomment-1836482355) and instead the spend module's `create_spend` is currently used (see https://github.com/wizardsardine/liana/pull/863).

  With this PR, the missing amount will be included in the `createspend` response rather than as an error.

  These changes are based on suggestions from @darosior and @edouardparis.

  In a follow-up PR, the GUI should revert to using the `createspend` command to calculate the amount left to select.

ACKs for top commit:
  darosior:
    re-ACK 1339898

Tree-SHA512: bf702d6b355339e96e719c1d95824e7941ac4fbaece4ec4cccd00b56ea4683ce7fb0cefc43faa5731b57e7935ef99da3a2c73b84aaeb9fa5f67703c799be2196
2024-01-23 17:33:48 +01:00
jp1ac4
1339898253
commands: include missing amount in response
The GUI uses the InsufficientFunds error to get the missing
amount when the user is creating a new spend.

It is not straightforward to extract this information in a
general way from the RPC error. Instead, this missing amount
will be included in the command response.

These changes are based on suggestions from darosior
and edouardparis.
2024-01-23 15:01:34 +00:00
pythcoiner
79177945ad add timestamp field to getinfo 2024-01-19 13:06:32 +01:00
Antoine Poinsot
35e50b4f38
Bump lianad version to 4.0 2023-12-12 15:10:50 +01:00
edouardparis
572567a7e4 Expose ListCoinsEntry derivation_index and is_change 2023-12-11 13:35:30 +01:00
jp1ac4
5391bfe04c
commands: add rbfpsbt command 2023-12-06 17:35:05 +00:00
jp1ac4
68b2503b12
func tests: move function to utils 2023-11-28 13:55:26 +00:00
edouardparis
33384c89b5
Add derivation_index to GetAddressResult
The derivation index is required for
for client to derive and verify the address
on hardware wallets.

Co-Authored-By: Antoine Poinsot <darosior@protonmail.com>
2023-11-16 18:12:34 +01:00
jp1ac4
cfa0f91dd3
commands: auto-select coins if none provided
When creating a new spend, if coin outpoints are not provided,
then coins will be selected automatically.

This automatic selection is such that the transaction fee is
minimized, taking into account the cost of creating any
change output now and the cost of spending it in the future.

If change is added, it must reduce the transaction waste and
be above the dust threshold. This same policy is applied also
in the case of manual coin selection, replacing the previous
logic for determining the change amount. This ensures that
creating a spend with auto-selection and another with manual
selection using the same auto-selected coins will give the
same change amount.
2023-11-14 13:32:53 +00:00
Antoine Poinsot
44f5a85b43
Merge #808: Followup to #709
0812a1216690514a0cf5ee6d80dbc6366fd91d43 jsonrpc: don't ignore invalid params to listaddresses (Antoine Poinsot)
d5338201d292ccf8d87849966c2f93efdfa0ccda commands: listaddresses cleanups (Antoine Poinsot)

Pull request description:

  This addresses my latest review from #709.

ACKs for top commit:
  jp1ac4:
    ACK 0812a12166

Tree-SHA512: 6f708fd2f1aa2f229a5c78a35e363870ef390513cce10fc6a5938b49e6b7ee5be9205bc4566376750e4f7eeea404709ce6d8c7a29df15b9216b8dbcf4b4fed7e
2023-11-13 11:55:51 +01:00
Antoine Poinsot
479efe7494
Merge #709: Implement listadresses
2660b77487d63218019413a4ca33b3a9629fbfc8 implement listadresses (pythcoiner)

Pull request description:

  address #681

  todo:
  - [x]  implement tests
  - [x] update docs

  edit: i'm really new to rust, don't hesitate to kick my ass when i write stupid code

ACKs for top commit:
  darosior:
    ACK 2660b77487d63218019413a4ca33b3a9629fbfc8 -- my requests are addressed in followup #808.

Tree-SHA512: a5fdfb4516dc0379bfec1be535e752795dec75d28cbc5b9fa4fe9898fa00b1cfaa9cee3b95f4dfd68365f4585426e1b4457a8366cc4f783600704994f879526f
2023-11-11 14:43:23 +01:00
Antoine Poinsot
0812a12166
jsonrpc: don't ignore invalid params to listaddresses 2023-11-11 14:25:24 +01:00
Antoine Poinsot
d5338201d2
commands: listaddresses cleanups
Introduce a single error enum variant. Avoid underflows. Clarify and comment the logic.
2023-11-11 13:59:06 +01:00
pythcoiner
2660b77487 implement listadresses 2023-11-10 14:59:44 +01:00
Antoine Poinsot
17ca01322e
Revert "Merge #722: Only include BIP32 derivations for a single spending path when creating PSBTs"
This reverts commit 71056982636b408485ab24dab6628a555a6e7924, reversing
changes made to 03c37bd378f4f6bf11d90b224ed1db74b3596eaf.

This reverts PR #722. It turns out the Ledger Bitcoin app needs the
BIP32 derivation for all the keys in the Script, not only for the
spending path used. Therefore always create PSBT with all the BIP32
derivations. We'll add a way to prune them for talking to the Bitbox in
a future commit.
2023-10-27 15:46:03 +02:00