53 Commits

Author SHA1 Message Date
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
Antoine Poinsot
6f5b053ea5
Revert "Merge #742: commands: don't add derivation paths for keys from different path but same signer"
This reverts commit ec0c2426aa5fa6cee2efabd3ee6f175b41c35f64, reversing
changes made to 26d750d09c84734f56c2dc18cb332a232e24fb6d.

This reverts the fixes to the pruning of BIP32 derivation paths when
creating a PSBT, in preparation of reverting the merge of this feature
altogether. This is because always creating PSBT with only the BIP32
derivations for a single path broke the Ledger support.
2023-10-27 15:43:52 +02:00
Antoine Poinsot
2e1c54491e
qa: test der paths in PSBT when desc has duplicate signer 2023-10-24 16:38:57 +02:00
Antoine Poinsot
8d213d5e31
qa: correct create_spend functional test
Both transactions may not spend the same coins. We need to compare the set of all der paths across inputs.
2023-10-24 16:38:57 +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
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
7f3b0b0218
qa: test a PSBT has only the BIP32 derivations for a single spending path 2023-10-06 18:23:12 +02:00
jp1ac4
eeaf90e522
commands: optionally filter listcoins by status and/or outpoint 2023-09-13 08:49:54 +01:00
Antoine Poinsot
edb2c513a3
Bump lianad version to 2.0 2023-08-31 13:11:37 +02:00
Antoine Poinsot
204c160c4d tests: test the RPC interface for managing labels 2023-08-28 13:14:21 +02:00
Antoine Poinsot
289f6581cc
qa: functional test createspend refuses immature outpoints 2023-07-20 13:43:15 +02:00
Antoine Poinsot
fe906da612
Bump version to 1.0.0 2023-05-11 11:44:57 +02:00
Antoine Poinsot
a076a83cba
Reset the daemon and GUI versions post 0.4 branch-off 2023-04-13 08:54:18 +02:00
Antoine Poinsot
baf68e8224
lianad: bump version 2023-04-10 11:23:55 +02:00
Antoine Poinsot
104c6e1a09
commands: add an 'updated_at' field to listspendtxs entries 2023-04-05 12:41:03 +02:00
Antoine Poinsot
d68d0e1134
commands: adapt 'createrecovery' to multiple recovery paths 2023-04-04 11:53:22 +02:00
Antoine Poinsot
b8cd0d0e27
Bump version to 0.3 2023-02-27 14:46:28 +01:00
Antoine Poinsot
d0de88bc01
daemon: release 0.2 2023-02-03 16:10:20 +01:00
Antoine Poinsot
3c82173f46
qa: abstract the signer from the Lianad class
That's prep work to introduce a multisig
2023-01-24 19:38:34 +01:00
edouard
103c1950ba Remove change_index from listspendtxs response
Multiple change indexes may be present in a spend
draft transaction and can be detected instead
in the response psbt with the bip32_derivation
outputs fields.
2022-12-20 14:00:16 +01:00
Antoine Poinsot
46a94d6c8e
qa: test recovery 'sweep' transaction creation 2022-12-13 15:34:25 +01:00
Antoine Poinsot
3b5cbd5122
qa: introduce a sign_and_broadcast utility 2022-12-09 12:27:50 +01:00
Antoine Poinsot
07e5ea3fd2
commands: fill non_witness_utxo field in PSBT inputs for createspend
We are still in segwit v0, so signers need it!!
2022-12-09 10:49:49 +01:00
Antoine Poinsot
dc61a1c3bd
commands: remove discrepancy between blockheight and block_height 2022-12-07 11:42:17 +01:00
Antoine Poinsot
c39cb07360 qa: functional test for transaction listing commands 2022-11-22 19:31:02 +01:00
Antoine Poinsot
968a7d17a0
daemon: rename Minisafe to Liana 2022-11-17 17:10:22 +01:00
Antoine Poinsot
4bd65213e2
commands: swap the outpoints and destinations arguments to createspend
The outpoints argument could eventually be made optional in order to
introduce some automated coin selection. So it makes more sense for it
to be after a required parameter, the destinations.
2022-11-17 15:15:22 +01:00
Antoine Poinsot
94d8ea6d60
qa: test "next derivation index" update from onchain usage 2022-11-16 15:46:26 +01:00
Antoine Poinsot
55cf21fa2a
qa: unflake the getinfo RPC functional test 2022-11-14 09:48:09 +01:00
Antoine Poinsot
8a22f5e8c9
qa: functional tests for block chain rescans 2022-11-14 09:20:28 +01:00
Antoine Poinsot
d4db804e4b
qa: add a missing 'wait_for' in spend creation test 2022-10-24 15:00:14 +02:00
Antoine Poinsot
f3e93df80c
qa: add missing sighash type to dummy signatures in test_update_spend 2022-10-20 16:37:47 +02:00
Antoine Poinsot
b89401e583
qa: remove an unused variable in test_update_spend
The new PSBT implementation brought it to light.
2022-10-19 12:07:22 +02:00
Antoine Poinsot
af9f0aeaed
qa: replace our PSBT implementation with a tweaked version of Bitcoin Core's
This replaces our existing implementation of PSBTs with a more
straightforward one, adapted from the Bitcoin Core functional tests
framework. This fixes a few flakes that occured because the previous
implementation could produce invalid PSBTs.

The Bitcoin Core implementation is pretty low level and was adapted to
treat mappings as such (the value in the PSBTMap can itself be a
mapping, like for partial signatures or BIP32 derivation paths).

The rest of the diff is adapting the users of PSBT to use the new
implementation and the clearly superior interface (yay!).
2022-10-19 12:07:22 +02:00
Antoine Poinsot
eff39ee35a
rpc: a new 'broadcastspend' command 2022-10-18 19:54:03 +02:00
Antoine Poinsot
99ab0d7add
commands: add a 'spend_info' field to the 'listcoins' entries 2022-10-17 11:47:42 +02:00
Antoine Poinsot
57add1d86b
commands: return the DB's block height in 'getinfo'
It makes more sense than to return the Bitcoin backend's. And it's helpful to wait for sync in functional tests.
2022-10-17 11:47:41 +02:00
Antoine Poinsot
c73e8a42dd
commands: add a new 'delspendtx' command 2022-10-01 14:05:27 +02:00
Antoine Poinsot
d5bd10add8
commands: add a change_index field to listspendtxs entries 2022-10-01 13:40:49 +02:00
Antoine Poinsot
c6e004806a
commands: add a 'list_spend' command (and 'listspendtxs' RPC) 2022-10-01 13:33:08 +02:00
Antoine Poinsot
3dfc7261db
jsonrpc: a new 'updatespend' RPC 2022-09-15 11:41:34 +02:00