8c0c23e688b02a73393a7172b3f41bfaa2a9c143 Use gui panic hook (edouardparis)
40dc9ae8c01da0b250bf0e8ea40e275ef77bd23c Delete process internal bitcoind locks in case of panic (edouardparis)
0488ed37a3651add672212664d59f637be17c716 feat: asynchronous management of internal bitcoind (edouardparis)
Pull request description:
This PR introduces a feature allowing multiple liana processes to the same internally managed bitcoind binary,
by having the first process running a wallet relying a managed bitcoind to start it and the last process standing stopping it when closing.
A new directory `./liana/bitcoind/locks` is introduces where a Liana process creates a file `pid-timestamp` when it starts or uses the internally managed bitcoind binary and removes it when it does not use it anymore.
Another Liana process can infer that it can stop the bitcoind binary by looking if any other lock file is present in this directory.
In order to make the bitcoind child process survive once the Liana process that started it is closed, the `libc::setsid();` method for unix and the `DETACHED_PROCESS` flag for windows are added to the process command.
The current panic hook of the gui was override by the one present in lianad daemon start method. The latter was moved to the daemon main.rs file.
ACKs for top commit:
edouardparis:
Self-ACK 8c0c23e688b02a73393a7172b3f41bfaa2a9c143
Tree-SHA512: b8ea415750c656786b64bc7ea97194f27db37267820f1a413ce6639e48dae542e644958856ffaddd53ab1ad047072a9bcc11ad304c060417b9542d4ee61089a3
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.