183 Commits

Author SHA1 Message Date
edouard
edb4359087
Merge #89: installer: check xpub network
25056d0d5e173c2c9378cdc2a98c5880d7451c83 installer: check xpub network (edouard)

Pull request description:

Top commit has no ACKs.

Tree-SHA512: 3ff1b9e25c84ca086f7c9a5bd11293bc40506a002d9a2d23dc4dd58bfe287e85aa71140724218b41373817fd56ed2e82be78de84f7caa5c29a45492e784875f9
2022-11-15 17:57:07 +01:00
edouard
25056d0d5e installer: check xpub network 2022-11-14 19:33:00 +01:00
edouard
5595e91e57
Merge #85: Delete install target datadir in case of failure
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
2022-11-10 17:04:04 +01:00
edouard
e9fa816be7 Delete install target datadir in case of failure
close #20
2022-11-10 12:11:33 +01:00
edouard
e69d354e89
Merge #83: fix installer: check if setup exists before install
8903dedaf556d0032b4f72e76b78fc0b58b44e0d fix installer: check if setup exists before install (edouard)

Pull request description:

ACKs for top commit:
  edouardparis:
    Self-ACK 8903dedaf556d0032b4f72e76b78fc0b58b44e0d

Tree-SHA512: c2e97dc5cf8949d635ef5d6a441532c56e66df8121edf91088c3860450062a52c3ade5b757af891a49abac09318ffcc92896863abe784b1e1a7f1b78ed1fe48d
2022-11-10 09:04:01 +01:00
edouard
8903dedaf5 fix installer: check if setup exists before install 2022-11-09 18:45:25 +01:00
Antoine Poinsot
9fa4b95847
Merge #79: commands: actually use the change descriptor when creating a Spend
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
2022-11-05 12:09:41 +01:00
Antoine Poinsot
1ef45b7806
Merge #80: Clippy fixes
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
2022-11-05 12:02:11 +01:00
Antoine Poinsot
08505b2545
commands: actually use the change descriptor when creating a Spend 2022-11-05 11:53:38 +01:00
Antoine Poinsot
3b2c9109dd
Clippy fixes
Clippy just broke under our feets by enabling more checks and making CI
fail...
2022-11-05 11:51:45 +01:00
edouard
76bd319d88
Merge #75: Add spend panel
6f75515f9b572d6fa77facdba9ddd2cd1bf94a64 Add coins and recipients view (edouard)
a043f024e2e6fd2355b8bff3e27c7e8e58886c92 fix clippy errors (edouard)
063786fe5485e4f5a857ed9c45f3fbec3fc5f69a Create spend transaction (edouard)
7fda64f4adae04e2f95439975e6e82a66c0a6035 Add select inputs step (edouard)
0b2f64279b92bf0502f4edc1d9bee3c231e933e8 Add choose feerate step (edouard)
5b9414260b34c37e9cddc7d79eb0a16d8d42767e Add choose recipient step (edouard)
e1209d2cff01a11053263c2e4934e80c088a83bd Add spend panel (edouard)
95aa8a152993a43dc2451c45efcfe73d68f4c45b Add spend txs to app cache (edouard)

Pull request description:

  based on #71

ACKs for top commit:
  edouardparis:
    Self-ACK 6f75515f9b572d6fa77facdba9ddd2cd1bf94a64

Tree-SHA512: 7edeb66b21af61f610d492576aac56b2dc1bfe1eb12a665787e5db03f54b55970c607d6ff29d6227360c7544bae4168f8d22ade648a0e13bc2f9050af0d95d06
2022-11-04 18:30:04 +01:00
edouard
6f75515f9b Add coins and recipients view 2022-11-04 18:07:49 +01:00
edouard
a043f024e2 fix clippy errors 2022-11-04 16:22:32 +01:00
edouard
063786fe54 Create spend transaction 2022-11-03 18:11:28 +01:00
edouard
7fda64f4ad Add select inputs step 2022-11-03 16:33:05 +01:00
edouard
0b2f64279b Add choose feerate step 2022-11-03 16:33:05 +01:00
edouard
5b9414260b Add choose recipient step 2022-11-03 16:33:05 +01:00
edouard
e1209d2cff Add spend panel 2022-11-03 16:33:05 +01:00
edouard
95aa8a1529 Add spend txs to app cache 2022-11-03 16:33:05 +01:00
edouard
ecd5962831
Merge #71: gui: import xpubs from hws
1d8527ed95e8e8454ffb989aded266224ec753e3 minisafe: bump miniscript (edouard)
258aeb57feba3b84e09d5bf3e863209cea06113a hw: load wallet from config (edouard)
6500381059c232023c29eb251e66cdb68bbe8148 installer: add clipboard (edouard)
c2ed30961c4c49826e97f6ab59eb0952ef1a9d2c installer: register wallet (edouard)
a2021ca326d614d7a604e3e6cad9f568e29a2d20 installer: refac context (edouard)
56be997d6bdbecc4d8c5ae7cded322c6c6936ed5 gui: fix ci add missing deps (edouard)
8ad37f18a88a57748a7c3f53f1ecb6bb8347194a gui: import xpubs from hws (wip) (edouard)

Pull request description:

ACKs for top commit:
  edouardparis:
    self-ACK 1d8527ed95e8e8454ffb989aded266224ec753e3

Tree-SHA512: 21b669915388ec60ff37dbb5be3a5f635571c60387ebb696689eddcc7f41cd3d900aff8aa3c5f11fd60860dc19e87dac7fd39e7cbbe6a8eae0ea8baba643354a
2022-11-03 16:10:54 +01:00
edouard
1d8527ed95 minisafe: bump miniscript 2022-11-03 15:00:41 +01:00
edouard
258aeb57fe hw: load wallet from config 2022-11-02 16:21:55 +01:00
edouard
6500381059 installer: add clipboard 2022-10-31 14:56:54 +01:00
edouard
c2ed30961c installer: register wallet 2022-10-31 14:54:26 +01:00
edouard
a2021ca326 installer: refac context 2022-10-31 14:54:26 +01:00
edouard
56be997d6b gui: fix ci add missing deps 2022-10-31 14:54:26 +01:00
edouard
8ad37f18a8 gui: import xpubs from hws (wip) 2022-10-31 14:54:26 +01:00
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
Antoine Poinsot
117171f24f
commands: use a separate key chain for change addresses 2022-10-24 15:00:17 +02:00
Antoine Poinsot
d9f905a19a
db: track the next unused derivation index for change, too 2022-10-24 15:00:17 +02:00
Antoine Poinsot
58a0e57c59
db: record whether a coin was received on a change address
So we know what descriptor to use when spending it.
2022-10-24 15:00:16 +02:00
Antoine Poinsot
9b04a55147
db: store derivation index also for addresses from the change desc
This doubles the storage required but there is no way around it if we
want the poller to detect those coins without grinding.
2022-10-24 15:00:16 +02:00
Antoine Poinsot
4f3daa7741
descriptors: cache the receive and change descriptors 2022-10-24 15:00:15 +02:00
Antoine Poinsot
ca3d7c1f33
descriptors: introduce a newtype for the multipath descriptor
The multipath descriptor has very different properties than the receive
and change ones. Use a newtype to assist us in differentiating those.
2022-10-24 15:00:15 +02:00
Antoine Poinsot
1320ee30ba
daemon: use multipath descriptors
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.
2022-10-24 15:00:14 +02:00
Antoine Poinsot
d4db804e4b
qa: add a missing 'wait_for' in spend creation test 2022-10-24 15:00:14 +02:00
Antoine Poinsot
7a18c583cb
bitcoind: filter received coins based on parent 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.
2022-10-24 15:00:13 +02:00
Antoine Poinsot
ba4c1e0383
bitcoind: include change outputs in listsinceblock 2022-10-24 15:00:13 +02:00
Antoine Poinsot
caaca1fd1a
descriptors: rename derive into derive_received
We'll be able to derive change addresses too
2022-10-24 15:00:12 +02:00
Antoine Poinsot
f985fd7879
descriptors: remove as_inner method
We'll change the semantic of the descriptor, so we need to make sure
nothing accesses it with the old semantic.
2022-10-24 15:00:12 +02:00
Antoine Poinsot
846d924792
qa: upgrade python-bip380 to latest master
For multipath descriptors support
2022-10-24 15:00:11 +02: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
edouard
a623bd0f7a
Merge #70: bump minisafe#790d28
813b9684a90b2cf9b39d6e96c9d383d8d32ba5b8 bump minisafe#790d28 (edouard)

Pull request description:

ACKs for top commit:
  edouardparis:
    ACK 813b9684a90b2cf9b39d6e96c9d383d8d32ba5b8

Tree-SHA512: 8af937fdeac2e6d7df77cfd57eb5ab047d7babdedfbe9db67304b066c3779bb61806da24b0b5cba7c18fd8ee1df51a6258ea8df72f8ad608ddad9711c07d10be
2022-10-21 11:39:41 +02:00
edouard
813b9684a9 bump minisafe#790d28 2022-10-21 10:43:08 +02:00
Antoine Poinsot
790d283e77
Merge #67: Update rust-miniscript to 8.0.0
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
2022-10-20 18:17:04 +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
d432745da5
Cargo: don't require the 'compiler' feature from miniscript 2022-10-20 17:53:26 +02:00
Antoine Poinsot
f7ca86191a
ci: temporary disable 1.48 build on macOS 2022-10-20 17:53:25 +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