e9fa816be7c6ddbf64413dc4df6940d0f90c1f87 Delete install target datadir in case of failure (edouard)
Pull request description:
close#20
ACKs for top commit:
edouardparis:
Self-ACK e9fa816be7c6ddbf64413dc4df6940d0f90c1f87
Tree-SHA512: 21b78bdad3a3e5127703211e5d119dc9ec88e4bc881ab744e1f6e20d51000af8b5aac4a12f19c775576c69ce958cac7d905378ec8fa4d69e4398fb5fedb61a05
08505b25452e61a92d5b7eb4a02c893f0d585a91 commands: actually use the change descriptor when creating a Spend (Antoine Poinsot)
Pull request description:
Fixes#78
ACKs for top commit:
darosior:
ACK 08505b25452e61a92d5b7eb4a02c893f0d585a91
Tree-SHA512: 4cccb6636f4e95831a9b3555f6a35cff85d855758b4c26c83b3db8086ea3012af6552ab0db485e982757b68c5c40d6b6696a95bca28c5b5b2f78339bfd800636
3b2c9109dd2c16e3812feb06f322ff0e6b6a61a0 Clippy fixes (Antoine Poinsot)
Pull request description:
Clippy just broke under our feets by enabling more checks and making CI fail...
ACKs for top commit:
darosior:
ACK 3b2c9109dd2c16e3812feb06f322ff0e6b6a61a0
Tree-SHA512: 973f7ae94609209038626a3b6f9ff940d9e488c8588865b439a37a46eec1a5df995013ac98be0fc63e50009339e78238b3a317c568c89677fcb0facf08736874
117171f24ff5bd6731d9e5e50e4515a03013a9eb commands: use a separate key chain for change addresses (Antoine Poinsot)
d9f905a19a5c6076683bbe7714ecb86fbafe0555 db: track the next unused derivation index for change, too (Antoine Poinsot)
58a0e57c59bf7b4f451580917f701e95e45d1af6 db: record whether a coin was received on a change address (Antoine Poinsot)
9b04a551474b2cd5ed793e42832454635d964495 db: store derivation index also for addresses from the change desc (Antoine Poinsot)
4f3daa7741b6996c17133dacedb4e70c66f5bac8 descriptors: cache the receive and change descriptors (Antoine Poinsot)
ca3d7c1f3360daa53fbec723fb960051a926d687 descriptors: introduce a newtype for the multipath descriptor (Antoine Poinsot)
1320ee30bacdedd449dfa89a3008e01995917c9f daemon: use multipath descriptors (Antoine Poinsot)
d4db804e4bad928466fa1db4a84a474ff4c33d7b qa: add a missing 'wait_for' in spend creation test (Antoine Poinsot)
7a18c583cbfcd958db9c79e8b13a0a68c1d20d41 bitcoind: filter received coins based on parent descriptors (Antoine Poinsot)
ba4c1e0383e302d2a822176d93b3b9fadc174b4b bitcoind: include change outputs in listsinceblock (Antoine Poinsot)
caaca1fd1a721acae150b8bd9212e51b8e378c99 descriptors: rename derive into derive_received (Antoine Poinsot)
f985fd787917e344b17ae90edd7b99bc1c9f3a7c descriptors: remove as_inner method (Antoine Poinsot)
846d924792089e41e530e414b26f0823afc151eb qa: upgrade python-bip380 to latest master (Antoine Poinsot)
3105b86a28444097e20e14261ffbfd5448b2854b Use my own fork of rust-miniscript (Antoine Poinsot)
Pull request description:
This fixes#18 by implementing the de-facto standard of using a `/0/*` keychain for receiving addresses and a `/1/*` keychain for change addresses. Note that once we'll have multisig, reusing addresses will still be possible since wallet don't share the same "next derivation index".
In order to avoid forcing the user to configure and backup two almost identical descriptors, we make use of the recently proposed BIP389 (https://github.com/bitcoin/bips/pull/1354). In order to prevent as much as possible introducing a backward incompatibility in the configuration file after the first release, we restrict the usage of multipath descriptors to `<0;1>` here.
We now derive public keys from `xpub/0/*` and `xpub/1/*` while we were previously deriving them from `xpub/*`.
This triggered a pretty invasive refactoring, as most parts of the codebase had to be updated to support the new change/receive separation (even the functional test miniscript dependency had to be updated, see https://github.com/darosior/python-bip380/pull/21).
Broadly, this:
1. Update our Miniscript dependency to my upstream PR (https://github.com/rust-bitcoin/rust-miniscript/pull/470) rebased on top of the 8.0.0 release.
2. Updates the descriptors module to handle somewhat safely the multipath descriptors (to avoid mixing up the single, multi, and derived descriptors).
3. Makes a multipath descriptor mandatory in the configuration file.
4. Updates the Bitcoin backend poller aware of descriptors for which to track coins.
- Necessarily this updates the bitcoind implementation to import two descriptors
5. Record in database whether a coin was for the change or receive descriptor, in addition to its derivation index
ACKs for top commit:
edouardparis:
ACK 117171f24ff5bd6731d9e5e50e4515a03013a9eb
Tree-SHA512: efcb7267f1ba6a5a3072e96fd1c70272f81092e86ee1178833f83d0aa88f271f42c269b71ca9992e76bb3e103baf1a189a609cc20f14f29b7388ab133da99044
In config, expect to be given a multipath descriptor that contains a
derivation path for both receive and change addresses, but only for
those.
Instead of 'xpub/*', start using 'xpub/0/*' and 'xpub/1/*'.
When creating the watchonly wallet on bitcoind import both the receive
and change descriptors.
When polling, check for coins on both descriptors.
Our bitcoind watchonly wallet could, maybe, have other descriptors that
were imported. Sounds pretty unlikely since we use a dedicated wallet
but hey.
More importantly, we'll need to know the parent descriptor of the coin
in order to recognize it as newly received or change.
49ccc28ca7b0ee6e266d79ace67ff35c3d50905c Cargo: update most dependencies to the latest version (Antoine Poinsot)
a4bdb1efb79b8b87ba6131dea96798766e1fbcf5 tree wide: upgrade to Miniscript 8.0.0 (Antoine Poinsot)
d432745da583e2c38e67cae540b9417d76867bfa Cargo: don't require the 'compiler' feature from miniscript (Antoine Poinsot)
f7ca86191a6972bb6a8e3d78261159648db4ca23 ci: temporary disable 1.48 build on macOS (Antoine Poinsot)
f3e93df80c5f400e0b8f83c4862f0ff4b9f0f367 qa: add missing sighash type to dummy signatures in test_update_spend (Antoine Poinsot)
Pull request description:
Took the opportunity to update some dependencies, too.
ACKs for top commit:
darosior:
ACK 49ccc28ca7b0ee6e266d79ace67ff35c3d50905c
Tree-SHA512: babd0ac6af752e4671b1221f63bcc85cf9f1029162893c71ba991b2da0c16bf02e70bf061969b1a058d7c22d57061d99a82d4ed8564787a38f8a35a784d21812
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.