Antoine Poinsot 8b129fe3e5
Merge #74: Decent change management (using multipath descriptors)
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
2022-10-28 13:44:29 +02:00
2022-10-18 19:54:03 +02:00
2022-10-21 10:43:08 +02:00
2022-08-22 17:19:08 +02:00
2022-10-24 09:01:03 +02:00
2022-10-24 09:01:03 +02:00
2022-07-20 16:17:32 +02:00
Description
A fork of https://github.com/wizardsardine/liana with removed loopback restrictions to allow connecting to a custom remote bitcoin core node
Languages
Rust 90.4%
Python 8.5%
Shell 0.5%
Scheme 0.3%
Nix 0.3%