35 Commits

Author SHA1 Message Date
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
edb2c513a3
Bump lianad version to 2.0 2023-08-31 13:11:37 +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
96e4cb5353
Update proc-macro2 to fix a nightly compilation bug 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
b53236f9dd
Update libc wrapper and getrandom
For getrandom it's mostly updates to support new platforms, but also an
added fallback when one system RNG isn't available on some platforms.

See https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md
2023-06-28 11:18:03 +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
Antoine Poinsot
1271b646fb
Update backtrace dependency 2023-06-28 10:43:30 +02:00
Antoine Poinsot
5d7a1b4fe5
Update serde dependencies 2023-06-28 10:39:14 +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
a7aa4adef0
Cargo: bump dirs and bip39 dependencies major versions. 2023-03-24 18:14:12 +01:00
Antoine Poinsot
510f964e0c
Cargo.lock: minor version dependencies updates 2023-03-24 18:10:50 +01:00
Antoine Poinsot
4bf5234ce9
Cargo.lock: update libc 2023-03-24 17:48:32 +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
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
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
edouard
1d8527ed95 minisafe: bump miniscript 2022-11-03 15:00:41 +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
49ccc28ca7
Cargo: update most dependencies to the latest version 2022-10-20 17:53:27 +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
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
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
Antoine Poinsot
989a2cf8fd
daemon: introduce the DaemonHandle, which for now only creates a datadir
This code was mainly taken and adapted from revaultd at commit
7cd856d5a345319cebc815aa61f3b66cebb48b86.
2022-07-23 12:49:16 +02:00
Antoine Poinsot
1b35196448
daemon: backbone and configuration parsing
Taken from revaultd at 7cd856d5a345319cebc815aa61f3b66cebb48b86. Credits
to the revaultd contributors.
2022-07-20 18:42:08 +02:00