20f394a452e425f4bdad0195637612499575a878 random: add a commented-out test i used to run ENT (Antoine Poinsot)
157eea989322eed2ea9553d3640e884fb657541a lib: re-export the bip39 dependency (Antoine Poinsot)
50f13d3e2e2802ebbc6efceccb03eafe352b1e77 signer: allow to the set the network for extended keys encoding (Antoine Poinsot)
f5e7632c73abef4f27f5617c877caf8574b3fe3b signer: expose a method for signing a PSBT (Antoine Poinsot)
b88874107e3b45876a63506ab67afbc710cd2a27 signer: add a method to get the xpub at a given path (Antoine Poinsot)
59e55ae9f2c33f4865ff28282325a5cf156ca37e signer: implement mnemonics storage, and initialization from storage (Antoine Poinsot)
d341b6dea9d7eb9663eb9a4ef55617340146dc1e signer: cache the master xpriv (Antoine Poinsot)
6e3b951e5452a3cd4a050bde32ee930f6613e601 signer: a new module with a BIP39-based hot signer (Antoine Poinsot)
Pull request description:
This introduces a new `signer` module. Its purpose is to provide clients of the Liana daemon (such as the GUI) with tools to sign transactions.
For now, the only signer available is a hot signer based on BIP39. It allows to generate new mnemonics from OS-provided randomness (with added randomness from the CPU if available and mixed-in contextual data). Mnemonics are stored in plaintext in a `mnemonics` folder at the root of a provided data directory.
Fixes#49.
ACKs for top commit:
edouardparis:
ACK 20f394a452e425f4bdad0195637612499575a878
Tree-SHA512: 299476fdec69139cab9428e8466b4d320798ecd91a08251cac9d1fb086e43cffdb296eca4061a022a7182b5df2101977bb8300ead0d31f3f75988792145bba7f
https://www.fourmilab.ch/random/
Entropy = 8.000000 bits per byte.
Optimum compression would reduce the size
of this 912444480 byte file by 0 percent.
Chi square distribution for 912444480 samples is 254.09, and randomly
would exceed this value 50.43 percent of the times.
Arithmetic mean value of data bytes is 127.4952 (127.5 = random).
Monte Carlo value for Pi is 3.141641048 (error 0.00 percent).
Serial correlation coefficient is 0.000022 (totally uncorrelated = 0.0).
fcc1c21dbb3a735407d0352c555f448ae80fac64 descriptors: use the origin as xpub UID in partial spend info, not the fingerprint (Antoine Poinsot)
4af1a12a2a239a25c3ab50e4943fa7897be40091 descriptors: fix the spending policy inference (Antoine Poinsot)
Pull request description:
The analysis was assuming missing that a `thresh(2, older(x), thresh(k, key1, key2, ..)` policy could be normalized to `thresh(k + 1, older(x), key1, key2, ..)` when `k == the number of keys` (i.e. in case of a N-of-N multisig). This also merges the analysis logic with the parsing check to make sure we don't introduce any inconsistency.
ACKs for top commit:
edouardparis:
utACK fcc1c21dbb3a735407d0352c555f448ae80fac64
Tree-SHA512: d12db2ccf43d20fc85ea6f9fdfe2869948d2c63a2af22287c9133cf6f732fe92c7c0c63ba70ea3dfb0c910a93753ebd42cb168b4cf6bd6ccbed4e1cc7028b614
We were using the fingerprint as a stable unique identifier for xpubs in
a descriptor. It's not. For instance, what if a single signer is used
both in the primary and recovery path? The same fingerprint would appear
in both paths and we would mix up the signatures for both paths (ie if a
signature for each was provided, we would count each path as having 2
signatures).
3a573b695e07d357e844dd9d573d578e05ecebed qa: test we discard RBF'd deposits (Antoine Poinsot)
f1532f8afcceb5ded299f5ddc425c0473de49871 bitcoin: track expired unconfirmed deposits, remove them from DB (Antoine Poinsot)
ed156543c95db2e6e1fd4712ec7dcb0dfc025c41 database: permit to remove coins from DB (Antoine Poinsot)
62c4b9a01c16c60f66db99abab967efa4e0429dd bitcoind: cleanup gettx cache and conflict detection in spent_coins (Antoine Poinsot)
201c9f21b60dbc5ff0afd9aa73c3a011c08e4459 bitcoin: cache calls to 'gettransaction' when checking for coins confirmation (Antoine Poinsot)
13214c887f373fbe953c01aa8d3a31ae9b65ee98 qa: test we discard RBF'd deposits when replacement is confirmed (Antoine Poinsot)
Pull request description:
Previously we would not detect whether the transaction for an unconfirmed deposit was still in our mempool. For instance a deposit that was RBF'd would result in us storing two coins, the replaced and the replacement. Keeping the unconfirmed replaced coin forever.
Fix this by dropping unconfirmed coins from our database if their transaction isn't in our mempool (anymore).
Fixes#72.
ACKs for top commit:
edouardparis:
utACK 3a573b695e07d357e844dd9d573d578e05ecebed
Tree-SHA512: 677bedbf8024eb16e5f97264c2e01d733732673548772fc3a97868b9ca42a0429ad8c0d888b05d3bb2db9b85d309c418b916c9af578f54e499b5d0689376a1b0
This is the same logic as the (cleaner) one we introduced in
confirmed_coins. Merge the two in a single CachedTxGetter, unfortunaly
at the expense of having to clone() the GetTxRes for now because i don't
want to fight with the borrow checker.
It would be possible for users to create a descriptor with xpubs without
an origin set. In fact, not many are used to origins and it's a very
likely mistake. Signers need this information in order to be able to
sign. So they could potentially create a wallet and potentially never be
able to sign for one or multiple keys.
Fix this by requiring an origin for all keys in the descriptor.
We were checking the bitcoind version *after* trying to create a
watchonly wallet with a Miniscript descriptor, which defeats the purpose
of the check.
Fixes#284.
We only allow to create "legacy" multisigs for now (that is, what fits
in a CHECKMULTISIG, ie k-of-n with n<=20). See
https://github.com/wizardsardine/liana/issues/53 for discussions around
this.
We are a bit more laxist on parsing, where any miniscript that
corresponds to a multisig policy will be accepted.
Note this makes the helper inferring the CSV value from semantic policy
incorrect, but this is fix in a later commit as part of a complete
refactor of this logic.
Multiple change indexes may be present in a spend
draft transaction and can be detected instead
in the response psbt with the bip32_derivation
outputs fields.
48e4909e7ad83c21f788802953327f8041a69b7d daemon: store the watchonly wallet file in bitcoind's datadir on Windows (Antoine Poinsot)
Pull request description:
Turns out that providing an absolute path to bitcoind when loading a wallet on Windows results in surprising behaviour.
ACKs for top commit:
edouardparis:
ACK 48e4909e7ad83c21f788802953327f8041a69b7d
Tree-SHA512: b432460d529cf5b879361452af1e7947ec877c293f8a8a2e1740975a2957c0cdb288d1f9a1fa07e56193c7c65edf1f985d9e24dd3412f2bfc10922df239de766
ba994ff8ff01d04fd31ed77cf7f66e0862e68e17 commands: do not underestimate the size of created transactions (Antoine Poinsot)
46a94d6c8eb144484a4b0df2ddbd48b32d4d096f qa: test recovery 'sweep' transaction creation (Antoine Poinsot)
3b5cbd5122fa53d0247e82dd7fc703b5d0a4bae3 qa: introduce a sign_and_broadcast utility (Antoine Poinsot)
d362885b85107b616447899d5eaaa5ba1b55c170 qa: record the recovery xpub too (Antoine Poinsot)
a69fb625ea3b8dfbfa1bf384e001f167fd04ff86 qa: use a CSV of 10 for recovery (Antoine Poinsot)
a78f46fa2fc5337c51d1eaa6ac6bbee04cfdf437 [refactoring] jsonrpc: sort command names alphabetically (Antoine Poinsot)
c09ae3f87bc8bb2391d88d1a718b35d4a6c568fa commands, jsonrpc: add a new 'createrecovery' command (Antoine Poinsot)
3d5d0134b4b5bc06910a89d23def36de5b548c30 commands: fix the capacity of input vectors in create_spend (Antoine Poinsot)
f2312593da8b27c6c6a69c7b0463959369c5acb6 commands: check for dust outputs in the PSBT sanity checks (Antoine Poinsot)
9f23161a53ad32d03d4ec464c48a819862dbf3e5 commands: correct the max feerate value (Antoine Poinsot)
54410cd9c435e1e6228b985d78e55b357c2368b8 database: allow to query coins by their spending status (Antoine Poinsot)
Pull request description:
A new command that provides a simple way for a user to sweep all the coins whose timelocked recovery path is available.
The first part of #180. Note this also contains a number of drive-by fixes that i noticed while coding this up.
ACKs for top commit:
darosior:
self-ACK ba994ff8ff01d04fd31ed77cf7f66e0862e68e17 -- tested by Edouard on the GUI
Tree-SHA512: 002cb8602370fe3bec0692fe7bbe9e7af494b43756d3092da99b37e4ce2837bcdfcfb3afe7043900eb41c70de12e2129e19363b9efe41cee91c7f1f7c2824fb0
acd6929831964d643565f8f22b552f74613a3a1d doc: update for bitcoind 24.0.1 release (Antoine Poinsot)
650101525d890f50290989bd58c367024a69115c bitcoind: set minimum required version to 24.0 (Antoine Poinsot)
9211d849c191ff5d2552bde681edaa7038c8d049 bitcoind: be less stupid when loading the watchonly wallet (Antoine Poinsot)
Pull request description:
Fixes#210Fixes#209Fixes#213
ACKs for top commit:
darosior:
self-ACK acd6929831964d643565f8f22b552f74613a3a1d
Tree-SHA512: 8cacf41b0e00faed877462dc57b595265ff2936937d45535d1be2b42fd1bf80df2928ccacbefd43f82d88a728aca898a8549899380e341de8b8e74d34ec74642
This is a new command dedicated to the recovery usecase. For now it's
dead simple: sweep all coins that are available through the recovery
path to a given address.