59035060e9b2b911809fdc225bfa862244f5f6d6 gui: refactor amount formatting (Aaron Carlucci) c6b8133286a4009cc1e72935e30af36d43705237 gui: add space separator to amount integer (Aaron Carlucci) Pull request description: This PR is based on #1182 and aims to actually refactor the amount component while adding a space separator to the integer portion of BTC amount displays as per #962. The code organization is reworked to try and separate the conversion of `bitcoin::Amount` type to a `iced` renderable `Row` elements in steps via smaller functions by: 1. Converting the `Amount` type to a string with the integer and fraction portions formatted in space-separated three digit chunks. 2. Detecting where in that string the non-zero BTC amount occurs 3. Converting the string into parts and rendering the preceding zeros and spaces with normal styling while applying a bold `Row` render element for the significant amount. To me, this approach makes the code easier to read and is a small step toward separating the string formatting functionality from the render element building. If we find more bugs with this approach, or the team simply doesn't like the reorganization, it's fine to scrap it, as it was a decent learning exercise anyway. Looking forward to feedback. ACKs for top commit: edouardparis: ACK 59035060e9b2b911809fdc225bfa862244f5f6d6 Tree-SHA512: d71b94cf261cf799891239da3795dae49d2b22ebc888b2d3400fbf754f84df6620fcdeb6b6594ef99e4de8a67089181ac8598bdc7a4aba3e71c16d89ccb63fae
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 src/ folder at the root of this repository.
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 gui/src/ 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.