edouardparis bd54fb29bf
Merge #1576: Wallet backup
f8ca6f123fd56ac71a2a3bffe9568c0ecb5a9b4d backup: add ser/de test & minors changes (pythcoiner)
477e914801f3d9c0b06be56617a5dc2f3273d136 export: remove NotImplemented from RestoreBackupError (pythcoiner)
df8d98b275bbf0aa96729f46afc53a24728ed60e gui: use Display instead Debug to print ExportModal errors (pythcoiner)
1abe503431892c45b9459849f4ac94b814c67e71 backup: update local state when alias updated from a backup restore (pythcoiner)
2e6cceea96783b85c6e7654cfc7600d63c86133c backup: rename Key::metadata in Key::proprietary (pythcoiner)
4e17483340971b1f3ff4674385843aa1bc068000 lianad: reverse the byte order of txid before parsing bip329 label transactions (pythcoiner)
cac7bce60aedc5097bbdf9ffb1184688f4bcb48a installer: minor UI fixes (pythcoiner)
2291138fb64d5be7d66e24e72cbfb11af6a55915 lianad: docs & tests for getlabelsbip329 command (pythcoiner)
9417549ddb5e6ffb51e668228e6faf8d18937db5 lianad: docs & tests for updatederivationindexes command (pythcoiner)
e1b90b056fe6a339acd4f9726cc10813d96bc741 lianad: in DaemonControl::update_deriv_indexes() limit the gap the index can be incremented and return db indexes (pythcoiner)
107e81071c7e60157fb3d00f90e3e3258c213aff lianad; update docs & tests for getinfo command (pythcoiner)
091557a8dfd03788cfaa202ad87c2dd15e1e347f installer: add existing wallet from backup (pythcoiner)
aa53c3e44e375656b0b9d3076167c82f2204273e import: implement wallet_from_backup() (pythcoiner)
03476de35abd779de95595f538b081d2c945285f gui: call import_backup_at_launch (pythcoiner)
33e39316c7c265ff64c55133fbf6e7ac908e660a import: implement import_backup_at_launch() (pythcoiner)
e19644ae8cf0acf7bd21eec2a609f76cb6810293 gui: display export error (pythcoiner)
29b1673460fd2160e2e768c30f5e7f151f065b92 fix user ACK + call import in settings/wallet (pythcoiner)
2fe297879b022d5da9e562816774d70075e40536 gui: integrate restore backup to settings (pythcoiner)
d0d7007e8398035e43d6d32eff149f167301ae32 import: implement import_backup() (pythcoiner)
b6f900355c6803490a79c0c058252ca5a45afb0c lianad: implement LabelItem.from_bip329() (pythcoiner)
02e28bbd3e72ae5aacde38552ac5dc892639a20e gui: implement Daemon.update_wallet_metadata() for lianad (pythcoiner)
6988fa40c92d2b2c518456284d685810c1ffb575 gui: implement Daemon.update_deriv_indexes() (pythcoiner)
39f71d3de8570e776096f2ce904cc1d783d96703 lianad: add update_deriv_indexes() command (pythcoiner)
4c2adec67c09befc604e7dd70d5a19e5fae6adf4 backup: serialize PSBT w/ Psbt::to_string() instead Psbt::serialize_hex() (pythcoiner)
31f834f41dd355116dd039b05541f24d798b1fe3 backup: default deserialization (pythcoiner)
4ba6486645766b65d12be063b8e1ab644b7c45bb gui: add import/export features in settings (pythcoiner)
325e2dc9b91c4553384c4751cdcfe9bee57f5a33 backup: add chain tip (pythcoiner)
c4585e8efe8f0ff27b92b8e930582650b6460e9f backup: add backup & Liana versions (pythcoiner)
61793b35ce4b329690970fc26a6a6f629513f66e backup: backup coins (pythcoiner)
68bb742755b3a277aa91b15f540ab6d8012e1384 installer: add wallet export feature at descriptor backup step (pythcoiner)
b0e560c0b523fba9994697c1f410ce0245c8ce09 export: make ExportModal::view() generic (pythcoiner)
5dcecc5542f3feeb989d40de2c8cc3063f1409d5 gui: make ExportModal.daemon optionnal (pythcoiner)
530b8c12bcd79075e39c7ff7fa289c4234d9fa15 gui: clippyfy (pythcoiner)
ab3c8007bac711c3e964fb21f192c03c5753b276 gui: implement ExportModal.modal_title() (pythcoiner)
f41de56e38164d9a9bad78a0abffaebdd92e6768 gui: add import/export features in settings (pythcoiner)
f1b62074d309059c4a8b5cc1d954c25bb7cff0d7 gui: implement backup (pythcoiner)
f7ed341d284d0563a93314be439a8facff971767 gui: Daemon trait => add receive and change indexes to GetInfoResult (pythcoiner)
86313f528221ddb7d766b3f59d4f255b4f49eedf export: implement export labels using BIP-0329 (pythcoiner)
38eed1b8810976ef903063d7f74b39dd06affcfc lianad: add feature to dump labels in BIP-0329 format (pythcoiner)
158651ebe7fbbf07fa8f8fbd74aa927ea53034ce import: implement import from file for psbt & descriptor (pythcoiner)
2b9324993a92ecb082d59c6aa013e6136b025aba export: implement export for psbt (pythcoiner)
baf4e75efe3b1150a4a8277f3ed8b1f265f75cdd export: implement export for descriptor (pythcoiner)
a3bf250696c7305e2af2667792ba6c1d02e8a111 gui: make 'ExportModal' generic (pythcoiner)
f13cd1fe73f2fc1afda0a4f35cac7f4840e5c7c8 export: rename 'State' into 'Export' and separate export logic (pythcoiner)

Pull request description:

  This PR:
   - [x] Implement export of PSBTs
   - [x] Implement export of Descriptor
   - [x] Implement export of Labels in BIP-0329 format
   - [x] Implement export of PSBTs
   - [x] Implement export of Descriptor
   - [x] Implement import of Labels in BIP-0329 format (restore for liana-connect not addressed here)
   - [x] add `receive_index` and `change_index` to `Daemon.get_info()` result+
   - [x] add test & update docs for `get_info()`
   - [x] add `get_labels_bip329()` to `Daemon` trait & RPC commands
   - [x] add tests & docs for `get_labels_bip329()`
   - [x] add `update_deriv_indexes()` to `Daemon` trait & RPC commands
   - [x] add tests & docs for `update_deriv_indexes()`
   - [x] implement wallet backup/export feature
   - [x] implement wallet backup/import feature (restore for liana-connect not addressed here)
   - [x] Integrate the exports & backup feature to the settings panel (GUI)
   - [x] Integrate the imports & restore feature to the settings panel (GUI) (restore for liana-connect not addressed here)
   - [x] Integrate the backup feature at wallet descriptor backup step (Installer)
   - [x] Integrate the "Add existing wallet" from a previous backup (Installer) (restore for liana-connect not addressed here)
   - [x] Handle and display gracefully errors in the GUI/Installer
   - [x] Update `Wallet` after restoring a backup from Settings
   - [x] write serializing/deserializing tests for backup
   - [x] backing up coins
   - [x] backing up chain tip (~`block_hash`~ + `block_height`)
   - [x] rename label export name to `.jsonl`
   - [x] add backup version + liana version

  This PR depends on [this PR](https://github.com/wizardsardine/liana-backend/pull/288) on our backend

  comments:
   - [x] The title should be "Backup your wallet" without "descriptor";
   - [x] The "Backup" button should be the primary action
   - [x] We could also consider calling it "Backup Wallet";
   - [x] The checkbox should become "I have backed up my wallet" or alternatively "I have backed up my wallet/descriptor".
   - [x] Aliases and transaction labels seem to not be imported correctly in the GUI when doing a Backup and Restore of the wallet.
   - [x] Another thing I wanted to mention, which I think is required, is that we have the same icon for all the new actions (backup wallet, restore wallet and all the options in the new "Import/export" section of the settings). We should differentiate by function.
   - [x] I get "Labels conflict" in the text also when I change the aliases and not the labels: we should keep it generic with something like "One or more elements conflict. (...)"
   - [x] I would reduce the space between the title and the text in the modal.
   - [x] For the always visible explanation: "A backup of your wallet configuration is necessary to recover your funds. Please make sure to store your Wallet backup file (or alternatively to copy and paste the descriptor string) in one or more secure and accessible locations. You still need to back up your seed phrases too, since they are not included in the file.”
   - [x] In the "Learn more" part, where it says "(...) this is your descriptor", I would just add "(...) this is your descriptor, included in your wallet backup file.".
   - [x] As we were discussing, we should change "backup" to "back up" when it is a verb (sorry for the confusion).
     - [x] The title in "Back up your wallet" (and "Back up your mnemonic" too);
     - [x] The button "Back Up Wallet" in the back up step and in the settings (both in "Wallet" and "Import/Export").
   - [x] increase modal height of 30 pixels in order to display well 2 liner messages

  Should be done as follow-up:
    - add a `retailler` field in proprietary
    - add `block_hash` to get_info()
    - replace `sync_channel()` by `tokio::mpsc::channel()`
    - handle if index increment gap > 1000
    - in `SqliteConn::set_derivation_indexes()` addresses should be inserted in batch
    - restore wallet backup for liana-connect
    - finalyze labels import
    - finalyze PSBT export
    - finalyze PSBT import
    - finalyze descriptor(only) import?

ACKs for top commit:
  jp1ac4:
    ACK f8ca6f123f.

Tree-SHA512: b9a2f21e95f77d9902abe1fcdd364dabd1ba562789023a81a7dd6d6d0a7ca86975cca02dfad8de1bfc09d711ccb1af0c8347376a543ce170c4f10e03b249cda9
2025-03-19 11:31:29 +01:00
2025-02-26 09:53:22 +00:00
2025-01-27 14:36:29 +00:00
2025-01-30 15:45:15 +00:00
2025-03-19 11:31:29 +01:00
2025-03-19 10:44:56 +01:00
2025-02-03 09:27:32 +00:00
2025-03-19 07:26:02 +01:00
2025-02-03 15:47:38 +01:00
2025-01-07 11:22:24 +01:00
2024-01-04 14:32:57 +01:00
2022-11-17 17:10:22 +01:00
2024-11-15 13:47:06 +01:00
2024-12-17 10:52:03 +01:00

Liana

The missing safety net for your bitcoins.

About

Liana is a simple Bitcoin wallet. Like other Bitcoin wallets you have one key which can spend the funds in the wallet immediately. Unlike other wallets, Liana lets you in addition specify one key which can only spend the coins after the wallet has been inactive for some time.

We refer to these as the primary spending path (always accessible) and the recovery path (only available after some time of inactivity). You may have more than one key in either the primary or the recovery path (multisig). You may have more than one recovery path.

Here is an example of a Liana wallet configuration:

  • Owner's key (can always spend)
  • Any 2 keys from the owner's spouse and two kids (after 1 year)
  • A third party, in case all else failed (after 1 year and 3 months)

The lockup period is enforced onchain by the Bitcoin network. This is achieved by leveraging timelock capabilities of Bitcoin smart contracts (Script).

Liana can be used for trustless inheritance, loss protection or safer backups. Visit our website for more information.

Usage

Liana is available on Windows, Mac and Linux. To install and start using it see doc/USAGE.md. A more accessible version of Liana is also available as a web application here.

If you just want to quickly try out Liana on Bitcoin Signet, see doc/TRY.md.

Hacking on Liana

Liana is an open source project. It is hosted at Github. Contributions are very welcome. See here for guidelines. Most regular contributors hang out on our Discord. Join us there if you have any question about contributing.

Liana is separated in two main components: the daemon and the Graphical User Interface.

Liana daemon

The daemon contains the core logic of the wallet. It is both a library (a Rust crate) that exposes a command interface and a standalone UNIX daemon that exposes a JSONRPC API through a Unix Domain Socket.

The code for the daemon can be found in the liana folder.

Liana GUI

The GUI contains both an installer that guides a user through setting up a Liana wallet, as well as a graphical interface to the daemon using the iced library.

The code for the GUI can be found in the liana-gui folder.

Security

See SECURITY.md for details about reporting a security vulnerability or any bug that could potentially impact the security of users' funds.

License

Released under the BSD 3-Clause Licence. See the LICENCE file.

Description
A fork of https://github.com/wizardsardine/liana with removed loopback restrictions to allow connecting to a custom remote bitcoin core node
Readme
Languages
Rust 90.4%
Python 8.5%
Shell 0.5%
Scheme 0.3%
Nix 0.3%