52 Commits

Author SHA1 Message Date
edouardparis
ad297d1ef8 iced v0.13 2025-02-03 15:47:38 +01:00
edouardparis
74820d97e9 Split into lianad and liana crate 2024-11-19 18:01:25 +01:00
edouardparis
f28b40fe8d fix fuzz, build and tests 2024-11-15 13:26:13 +01:00
edouardparis
2ab6e40c93 refac workspace: move files 2024-11-15 13:26:13 +01:00
edouardparis
95e97bc7dc Bump liana version v8 2024-11-05 11:11:20 +01:00
edouardparis
aa1ca64816 Bump liana v7.0 2024-09-12 09:31:21 +02:00
jp1ac4
c7ee862020
bitcoin: add electrum backend
This includes changes from darosior's comment in
https://github.com/wizardsardine/liana/pull/1222#issuecomment-2324894986.
2024-09-05 14:55:45 +01:00
Antoine Poinsot
168112de10
Bump version to 6.0 2024-06-27 15:53:30 +02:00
jp1ac4
936d7e9585
spend: bump bdk_coin_select to 0.3.0
The `score` method of the `LowestFee` metric has been fixed
and so our temporary fix is no longer required.

The `min_fee` parameter of `select_coins_for_spend`,
if positive, now ensures that RBF rule 4 is satisfied.

`base_weight` is no longer stored in `CoinSelector` and
instead the output weights are stored in `Target`. This
means that the `output_weight` of `DrainWeights` no longer needs
to take into account a potential change in output count varint.
2024-04-05 21:46:06 +01:00
Antoine Poinsot
d9337121ab
Bump Liana version 2024-03-22 16:42:33 +01:00
Antoine Poinsot
ce026a62e6
Update rust-bitcoin and rust-miniscript
The most notable change is rust-bitcoin's change in the serialization of
transaction with no input. It now accounts for the segwit marker even
for those. The base tx weight in coin selection had to be adapted to
handle this.

See https://gnusha.org/bitcoin-rust/2024-01-04.log for details.
2024-01-11 10:45:36 +01:00
Antoine Poinsot
2bce4c525d
Cargo: bump jsonrpc version to 0.17
It now finally accepts an option as argument.
2024-01-04 14:32:58 +01:00
Antoine Poinsot
65c9e389bb
Cargo: bump rusqlite to 0.30
This gives us bundled SQLite 3.44.0. Notably this patches CVE-2022-35737
but it shouldn't affect us.
2024-01-04 14:32:58 +01:00
Antoine Poinsot
35e50b4f38
Bump lianad version to 4.0 2023-12-12 15:10:50 +01:00
Antoine Poinsot
36700c4759
Cargo: use the published bdk_coin_select 2023-12-05 10:00:09 +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
5f0abbcc87
Cargo: drop two keywords 2023-10-30 18:40:50 +01:00
Antoine Poinsot
edb2c513a3
Bump lianad version to 2.0 2023-08-31 13:11:37 +02:00
Antoine Poinsot
2a6b775f60
lib: non-blocking daemon shutdown
This makes it possible to trigger the shutdown of the daemon through the
DaemonHandle, without having to block while waiting for the poller
thread to join.

Incidently, this allows to avoid having to move `self` which in turns
allows to fix a GUI bug (see
https://github.com/wizardsardine/liana/issues/622).

Only available as an optional feature since `is_finished` needs rustc
1.61.
2023-08-22 14:55:14 +02:00
Antoine Poinsot
9007947e4e
bitcoind: use minreq as HTTP transport for JSONRPC
Instead of the hand-written HTTP implementation in the rust-jsonrpc
library, use the minreq crate. It's a small, maintained, low dependency
library actually focused on writing an HTTP client.

This also reworks and better document the request retry logic.
2023-07-13 10:18:07 +02:00
Antoine Poinsot
e3ee50b7af
Update rust-jsonrpc dependency to latest version 2023-07-13 10:07:00 +02:00
Antoine Poinsot
a19f2c1536
daemon: drop the base64 dependency
rust-bitcoin now takes care of that.
2023-07-13 09:56:11 +02:00
Antoine Poinsot
e28010915f
lianad: update rust-miniscript (and rust-bitcoin) dependencies
Rust-bitcoin, that we use through rust-miniscript, has seen plenty of
breaking changes in the latest version. I've tried to keep the necessary
changes here minimal, still it had to be a single commit to keep it
hygienic. But i'll try to summarize the main things here. Tobin also
wrote a guide about the release at
https://rust-bitcoin.org/blog/release-0.30.0/.

The most verbose change in this commit is probably due to the `Address`
type overhaul. It's overengineered if you ask me but hey here we are. I
tried to keep network validation in commands, and otherwise passing
around unchecked addresses (to avoid having to pass around a global
state between our various components).

Another non-obvious change was changes in hash types upstream and the
removal of `ToHex`, forcing us to get the hex representation of a txid
through its `Display` implementation. It is however displayed backward
in this case ("little-endian" if you will), and we need a regular hex
encoding for some queries to the database. We needed to make sure we
didn't implement any silent bug here.

The rest (Script type changes, PSBT serialization updates, ..) is
probably self-explanatory.
2023-07-13 09:56:09 +02:00
Antoine Poinsot
9b17d7029f
Update rusqlite to 0.27
The release is >1yo but they keep breaking the MSRV so we can't get the
fixes without upgrading to a bleeding edge compiler...

This upgrades the bundled SQLite to version 3.38, which had quite some
patch releases but no issue that should be relevant to us.
https://sqlite.org/releaselog/3_38_0.html

Full rusqlite changelog available here:
https://github.com/rusqlite/rusqlite/releases/tag/v0.27.0.
2023-06-28 11:01:29 +02:00
raphjaph
700f6e1d6f make compilable on aarch64 (M1) 2023-05-24 00:08:54 +02:00
Antoine Poinsot
fe906da612
Bump version to 1.0.0 2023-05-11 11:44:57 +02:00
Antoine Poinsot
baf68e8224
lianad: bump version 2023-04-10 11:23:55 +02:00
Antoine Poinsot
55d86c62a5
descriptors: use the Miniscript compiler to create a descriptor 2023-04-04 11:50:26 +02:00
Antoine Poinsot
a7aa4adef0
Cargo: bump dirs and bip39 dependencies major versions. 2023-03-24 18:14:12 +01:00
Antoine Poinsot
6ea9ba5c1c
Cargo: get rid of the jsonrpc_server feature.
It implies daemon. (Also, it needed libc.)
2023-03-24 17:46:37 +01:00
edouard
cc88446717 deps: make libc optional
libc dependency is only use by the lianad
binary it is not needed for liana-gui.
This commit makes the dependency optional
by introducing a new default feature named
daemon.

liana/src/daemonize.rs is still compiling
because the feature daemon is marked as required
for the lianad binary.
2023-03-14 09:39:36 +01:00
Antoine Poinsot
b8cd0d0e27
Bump version to 0.3 2023-02-27 14:46:28 +01:00
Antoine Poinsot
6e3b951e54
signer: a new module with a BIP39-based hot signer 2023-02-10 12:21:21 +01:00
Antoine Poinsot
0bd3bd4d2e
Update Github links to wizardsardine/liana 2023-02-03 16:52:06 +01:00
Antoine Poinsot
d0de88bc01
daemon: release 0.2 2023-02-03 16:10:20 +01:00
edouard
c31751dee3 liana: 0.1 2022-12-21 11:44:41 +01:00
Antoine Poinsot
8dda896e4b
guix: Linux reproducible builds of the daemon 2022-12-13 14:50:55 +01:00
Antoine Poinsot
293c28570c
Cargo: fix the rust-miniscript patched dependency for downstream
This new syntax would actually force all downstream users to apply the
patch section in their Cargo.toml! Revert to the previous syntax of
specifying the git repo directly.
2022-12-08 12:06:19 +01:00
Antoine Poinsot
3224f08ba0
daemon: update rust-miniscript to 0.9
This also updates the multipaths descriptor patch to the review PR https://github.com/rust-bitcoin/rust-miniscript/pull/470 (rebased on 0.9)
2022-12-07 11:58:36 +01:00
Antoine Poinsot
968a7d17a0
daemon: rename Minisafe to Liana 2022-11-17 17:10:22 +01:00
Antoine Poinsot
3105b86a28
Use my own fork of rust-miniscript
It supports multipath descriptors. We'll need to find a solution for the release
2022-10-24 09:01:03 +02:00
Antoine Poinsot
a4bdb1efb7
tree wide: upgrade to Miniscript 8.0.0
This also updates the indirect rust-bitcoin dependency to 0.29.

Major changes are in the descriptors management:
	- The rust-miniscript descriptors don't support raw hashes
	  within the pk_h() fragments, so we don't need all the boutique
	  management for this.
	- The key translator API changed.
	- We now take a u16 for the timelock instead of our previous
	  checks. This was inspired by the new rust-bitcoin Sequence
	  type.
	- We now take a path instead of just a derivation index in
	  DerivedKey. We might use paths after all...

As for rust-bitcoin it's just a few nits:
	- No more 'global' field on PSBTs (yay)
	- Couple more trait derivation on types
	- Some APIs were renamed.
2022-10-20 17:53:26 +02:00
Antoine Poinsot
d432745da5
Cargo: don't require the 'compiler' feature from miniscript 2022-10-20 17:53:26 +02:00
Antoine Poinsot
9afd44061e
commands: add a new create_spend command 2022-09-15 11:41:31 +02:00
edouard
0d79a31eb2 fix crate name: minisafe 2022-07-26 10:46:16 +02:00
Antoine Poinsot
ad32977558
Don't compile daemon and cli binaries on Windows 2022-07-25 11:37:56 +02:00
Antoine Poinsot
11cc4dc2e6
Cargo: pin rusqlite dependency for MSRV
Sigh...
2022-07-25 11:37:56 +02:00
Antoine Poinsot
7340c13142
daemon: implement daemonize for UNIX platforms 2022-07-25 11:37:55 +02:00
Antoine Poinsot
c095346e17
Introduce the Bitcoin network interface along with a bitcoind module 2022-07-23 12:49:18 +02:00
Antoine Poinsot
b0196ab529
daemon: introduce an SQLite database
With a schema similar to revaultd, but a different interface.
2022-07-23 12:49:17 +02:00