Giter Club home page Giter Club logo

firma's Introduction

MIT license Crates

Firma

WARNING - Early-stage software, do not use with real bitcoins.

Firma is a tool to create bitcoin multisig wallets with private keys stored on offline devices.

The offline device could be a CLI terminal or a spare Android phone.

Information is transferred between devices through QR codes. Since PSBT could become large some kB, more than 1 QR code could be needed, those QRs are chained with QR structured append

Wallets data are saved in the local filesystem (see datadir) and optionally encrypted with an externally provided key (on Android everything is encrypted by the default with a key protected by native keystore).

It is based on:

High-level process:

                                      +---------------------+
+---------------------+               |+---------------------+
|                     |     xpubs     ||                     |
| online machine      | <------------ ||  offline machines   |
|                     |               ||                     |
| * firma-online      |     PSBT      ||  * firma-offline    |
| * bitcoin node      | ------------> ||  * xprv             |
| * xpubs             | <------------ ||                     |
|                     |               +|                     |
+---------------------+                +---------------------+

Setup

  • Create one ore more extended private keys xprv on one or more offline devices.
  • Group together corresponding extended public keys xpub and import these on an on-line Bitcoin core node in watch-only mode.
  • Bring back the wallet descriptor with xpubs on offline machines. While not strictly necessary for signing, wallet on offline machine act as a backup and as added information (eg check if a change is owned by the wallet)

Usage

Receiving
  • The firma-online tool could create addresses to receive bitcoins.
Spending
  • Create the transaction from the firma-online tool and export it in PSBT format.
  • Bring PSBT to offline devices, check the transaction, if everything looks correct, sign the PSBT with the private key present on the device.
  • Bring all the PSBT back to the node which can combine and finalize these as complete transaction (this operation could occur in parallel or serially).

Requirements

You need:

Install from crates

cargo install firma-cli

Install from sources

git clone https://github.com/RCasatta/firma/
cd firma/cli
cargo build --release

executables are target/release/firma-online and target/release/firma-offline

Tests

Integration tests require an env var pointing to bitcoin core executable (bitcoind).

For example:

BITCOIND_EXE=./bitcoin-0.20.1/bin/bitcoind cargo test

Example

Check the bin readme for an example with CLI

Faq

How Firma handle fee bug on segwit inputs?

Full previous tx is included in the PSBT to check the prevout hash match the previous transaction, causing an error if amounts are changed as the attack requires.

How Firma handle attacks on the online wallet generating receive addresses?

The offline app could generate addresses as well. The receive process should take into account both an online and an offline device, checking the receiving address generated matches.

Moreover, wallet signature is supported in the offline devices. This signature could be imported in the online device and verified, to ensure the watch-only wallet is not tampered.

How Firma offline know the change address is mine?

Firma online stores the full watch-only descriptor of the wallet thus could generate the address given the derivation present in the PSBT, if the address matches it is owned by the wallet.

How Firma tackle physical attacks on the device?

Anything that is persisted to disk can be optionally encrypted.

On cli, user could leverage their existing gpg infrastructure with:

# encryption key creation and storage in encrypted gpg
dd if=/dev/urandom bs=1 count=32 | gpg --encrypt >encryption_key.gpg

# bitcoin private key creation
gpg --decrypt encryption_key.gpg | firma-offline --read-stdin random --key-name bitcoin-key

On Android, system keystore is used to encrypt 32 random bytes, so that physical attacks need to break the secure element if the device has one.

Why do I need the wallet descriptor in the offline device?

While the wallet descriptor isn't strictly necessary in the offline signer, it allows some safety checks like the address checking. Most importantly the descriptor is absolutely necessary as a part of the backup, for example in 3of5 scheme, 3 master private keys are not enough to sign transactions because we need 5 master public keys. For this reason the flow requires every offline device store also the wallet descriptor containing all the master public keys.

I've seen secret data in the logs even if I am using the `encryption_key`, what are you doing?

Logs output is disabled in release build, but you may see secrets in logs if you are using a debug builds. Actively redacting sensible data has been pursued, however, it could always be printed the json used to communicate with the lib that must containing this secret data to work, so the approach to disable logs in release build has been taken.

Sponsor

Project sponsored by Squarecrypto

Donations

I am the maintainer of one of the OpenTimestamps calendar, if you feel, you can donate there

firma's People

Contributors

justinmoon avatar rcasatta avatar valerio-vaccaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

firma's Issues

Lib build for android

At the moment two shell scripts are used build-android.sh and build-android-release.sh which requires editing according to the platform used.
Change this to use build.rs such that standard cargo build command with --target could be used

Test with 0.20

Make Travis test run also with bitcoin 0.20 and then update Readme

Use PSBT binary

At the moment qr codes content for PSBT is a json with the following data:

pub struct PsbtJson {
    pub name: String,
    pub psbt: String,
    pub fee: f64,
    pub changepos: i32,
}

which is basically the json returned from bitcoind with an added "name" field, useful to import the psbt.
For compactness and compatibility reasons I want to switch to use only the psbt binary in the qr codes.
To keep the name information it's possible to use the PSBT binary proprietary field https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#proprietary-use-type to add proprietary data to the psbt.

PSBT without HD path

In the multisig example https://github.com/RCasatta/firma/tree/d2377e8eb6c1a702fc9d2d1729dc6043378cd981#p2wsh-2of2-multisig
the psbt created from core comes without the HD path of the keys, to handle this situation the signing code derive a thousand keys and check if the pub key in the script is in this set

// temp code for handling psbt generated from core without the knowledge there is a master key

This is an hack, understand and fix the psbt creation with the hd path and then remove the hacky code.

Remove shrink of tx

At the moment before passing the psbt to the bitcoin node tx of previous input are stripped out because core refuse them
bitcoin/bitcoin#19215 this will allow them back so one day it could be removed

bip39 support?

I am not a super-fan of bip39, I know it's non-standard but I prefer a bech32 hex-seed which is shorter, has error correction and could derive master keys.
I would like to support for example like giving a bitcoin wallet derived from you master key to your son, and bip39 is designed to not allow that. I guess I could easily add an import bip39 mnemonic but I would avoid to add the mnemonic to the Firma create key process. I am open to discussion though

Merge only_sigs and psbt

In some context (qr codes) the psbt could be too big in size, in this case could be useful to encode in the qr code only the signatures part only_sigs.

Implement a function to merge psbt and the only_sigs to create a signed_bst

Add "is mine" in pretty print

To verify ownership of change outputs, pretty print should calculate if addresses are mine, it needs all the public keys in a file and should verify if the offline node owns a private key in the set.

Calculate expected sizes of tx in pretty print

At the moment the size of the tx is considered without the signatures, according to the input type an estimate of the size of the final tx could be guessed to give more precise information

spend utxo

Add 2 subcommand to firma-online:

  • list_utxo
  • spend_utxo to create 1 input 1 output transaction, output amount will not be specified and will be input value less fee

Restrict derivation levels

To avoid bitcoin ramson, in derivation enforce to strictly accept only 1 level after the change index.

loadwallet if not loaded

at the moments firma-online command fails if the wallet is not loaded in bitcoin-core.
implement automatic loadwallet if the wallet-name is not in listwallets

requires listwallets command in lib bitcoincore-rpc lib

Fix build x86_64 lib for android

At the moment is erroring with

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-Wl,--allow-multiple-definition" "-m64" "-L" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.0.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.1.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.10.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.11.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.12.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.13.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.14.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.15.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.2.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.3.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.4.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.5.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.6.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.7.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.8.rcgu.o" "git/firma/target/x86_64-linux-android/release/deps/firma.firma.ceud5b1b-cgu.9.rcgu.o" "-o" "git/firma/target/x86_64-linux-android/release/deps/libfirma.so" "-Wl,--version-script=/var/folders/cj/ltjktt390fz912lkdsd1z0cm0000gn/T/rustcS2BYkR/list" "git/firma/target/x86_64-linux-android/release/deps/firma.49eqpo1vhq4bt49s.rcgu.o" "-Wl,--gc-sections" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "git/firma/target/x86_64-linux-android/release/deps" "-L" "git/firma/target/release/deps" "-L" "git/firma/target/x86_64-linux-android/release/build/secp256k1-sys-5f385483de25e151/out" "-L" "git/firma/target/x86_64-linux-android/release/build/rust-crypto-e76ae86629c59565/out" "-L" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib" "-Wl,-Bstatic" "git/firma/target/x86_64-linux-android/release/deps/libdirs-d71636dd6020e7c9.rlib" "git/firma/target/x86_64-linux-android/release/deps/libdirs_sys-d010bee487a124f6.rlib" "git/firma/target/x86_64-linux-android/release/deps/libminiscript-366fa31534b51cb6.rlib" "git/firma/target/x86_64-linux-android/release/deps/libhex-3fdf3974c7ddba82.rlib" "git/firma/target/x86_64-linux-android/release/deps/libbase64-8e00d375cba7988d.rlib" "git/firma/target/x86_64-linux-android/release/deps/libjni-46937f140852f5f4.rlib" "git/firma/target/x86_64-linux-android/release/deps/libcesu8-2992410918342227.rlib" "git/firma/target/x86_64-linux-android/release/deps/libcombine-1d6835ed1443d81a.rlib" "git/firma/target/x86_64-linux-android/release/deps/libascii-6c82980155279f5c.rlib" "git/firma/target/x86_64-linux-android/release/deps/libunreachable-f770af938b837ce8.rlib" "git/firma/target/x86_64-linux-android/release/deps/libvoid-8e6ac9a8a2673f79.rlib" "git/firma/target/x86_64-linux-android/release/deps/liberror_chain-bae80dc4bfc4b9ca.rlib" "git/firma/target/x86_64-linux-android/release/deps/libjni_sys-66cf5d09efadf5e9.rlib" "git/firma/target/x86_64-linux-android/release/deps/libandroid_logger-5dda9aee1df08922.rlib" "git/firma/target/x86_64-linux-android/release/deps/libenv_logger-c01b3c260f6f2e9a.rlib" "git/firma/target/x86_64-linux-android/release/deps/libandroid_log_sys-fb38dd70c994e928.rlib" "git/firma/target/x86_64-linux-android/release/deps/libnum_bigint-767375aaa23ee5ca.rlib" "git/firma/target/x86_64-linux-android/release/deps/libregex-e7de01a38e506d85.rlib" "git/firma/target/x86_64-linux-android/release/deps/libthread_local-01f085f769470567.rlib" "git/firma/target/x86_64-linux-android/release/deps/libregex_syntax-1bfae0f2795e774b.rlib" "git/firma/target/x86_64-linux-android/release/deps/libaho_corasick-1249215bd59374f0.rlib" "git/firma/target/x86_64-linux-android/release/deps/libmemchr-db1c2f7ba6dc8817.rlib" "git/firma/target/x86_64-linux-android/release/deps/libqrcode-a8a258e2d8f5317d.rlib" "git/firma/target/x86_64-linux-android/release/deps/libchecked_int_cast-0733cac25203fc3d.rlib" "git/firma/target/x86_64-linux-android/release/deps/libimage-86063f79cc280718.rlib" "git/firma/target/x86_64-linux-android/release/deps/libbytemuck-89c25c0869960c4d.rlib" "git/firma/target/x86_64-linux-android/release/deps/libpng-2dd77d9eedaa815a.rlib" "git/firma/target/x86_64-linux-android/release/deps/libinflate-45ad1f564321c9d4.rlib" "git/firma/target/x86_64-linux-android/release/deps/libcrc32fast-8bba21a7a0d9c111.rlib" "git/firma/target/x86_64-linux-android/release/deps/libdeflate-f247d48272175121.rlib" "git/firma/target/x86_64-linux-android/release/deps/libnum_iter-1ea1432132738f20.rlib" "git/firma/target/x86_64-linux-android/release/deps/libjpeg_decoder-268c7da74068912f.rlib" "git/firma/target/x86_64-linux-android/release/deps/librayon-831689d3d2fe1f43.rlib" "git/firma/target/x86_64-linux-android/release/deps/librayon_core-8af945c3e279e5a4.rlib" "git/firma/target/x86_64-linux-android/release/deps/libcrossbeam_queue-ba57ab54930a252d.rlib" "git/firma/target/x86_64-linux-android/release/deps/libcrossbeam_deque-720df41e943affd4.rlib" "git/firma/target/x86_64-linux-android/release/deps/libcrossbeam_epoch-649dd8f20381534f.rlib" "git/firma/target/x86_64-linux-android/release/deps/libscopeguard-fbc96f24bb650e0c.rlib" "git/firma/target/x86_64-linux-android/release/deps/libmemoffset-fe345876a216d3c8.rlib" "git/firma/target/x86_64-linux-android/release/deps/libcrossbeam_utils-3c43a092030a0838.rlib" "git/firma/target/x86_64-linux-android/release/deps/libmaybe_uninit-de1e8e6b7e9749db.rlib" "git/firma/target/x86_64-linux-android/release/deps/libeither-44fac596268d3a18.rlib" "git/firma/target/x86_64-linux-android/release/deps/libscoped_threadpool-df9d5434ae289ab5.rlib" "git/firma/target/x86_64-linux-android/release/deps/libnum_rational-9da61491a2d99b7f.rlib" "git/firma/target/x86_64-linux-android/release/deps/libnum_integer-18ad4ac5d1a98e69.rlib" "git/firma/target/x86_64-linux-android/release/deps/libgif-4811f76c5ff10711.rlib" "git/firma/target/x86_64-linux-android/release/deps/libcolor_quant-0b59409668cdcbde.rlib" "git/firma/target/x86_64-linux-android/release/deps/libnum_traits-c459246e7405fc0d.rlib" "git/firma/target/x86_64-linux-android/release/deps/libtiff-f9c8e9fcf67038cf.rlib" "git/firma/target/x86_64-linux-android/release/deps/libminiz_oxide-535ddbfdd696ec69.rlib" "git/firma/target/x86_64-linux-android/release/deps/libadler32-8f4f934516eb84df.rlib" "git/firma/target/x86_64-linux-android/release/deps/liblzw-1bc13f2dbfca56e6.rlib" "git/firma/target/x86_64-linux-android/release/deps/librand-12f60d879f350a13.rlib" "git/firma/target/x86_64-linux-android/release/deps/librand_chacha-1dd36cd0c46b6b88.rlib" "git/firma/target/x86_64-linux-android/release/deps/libppv_lite86-517e056930158dc4.rlib" "git/firma/target/x86_64-linux-android/release/deps/librand_core-6ab6b1d4d3b80dd4.rlib" "git/firma/target/x86_64-linux-android/release/deps/libgetrandom-2e2a467d57be0118.rlib" "git/firma/target/x86_64-linux-android/release/deps/libcrypto-e7e8d3b353468002.rlib" "git/firma/target/x86_64-linux-android/release/deps/librustc_serialize-66d930c0eb2b69e8.rlib" "git/firma/target/x86_64-linux-android/release/deps/librand-27201ec9d1af4e78.rlib" "git/firma/target/x86_64-linux-android/release/deps/librand-67d7f4253e4170eb.rlib" "git/firma/target/x86_64-linux-android/release/deps/libbitcoincore_rpc-14c9458bcfbf0b60.rlib" "git/firma/target/x86_64-linux-android/release/deps/libbitcoincore_rpc_json-dbbf476e7621b3b3.rlib" "git/firma/target/x86_64-linux-android/release/deps/libjsonrpc-019802b37caebb2d.rlib" "git/firma/target/x86_64-linux-android/release/deps/libhyper-aa008c72df37d94e.rlib" "git/firma/target/x86_64-linux-android/release/deps/libmime-f3890962e9681e4e.rlib" "git/firma/target/x86_64-linux-android/release/deps/liblog-bd892b2b6fd34875.rlib" "git/firma/target/x86_64-linux-android/release/deps/liblanguage_tags-d035e353baad7c86.rlib" "git/firma/target/x86_64-linux-android/release/deps/libtypeable-1c9a04ea7292e386.rlib" "git/firma/target/x86_64-linux-android/release/deps/libtraitobject-4ebb7b81ba301ea5.rlib" "git/firma/target/x86_64-linux-android/release/deps/libnum_cpus-e74f099c0f67a506.rlib" "git/firma/target/x86_64-linux-android/release/deps/libhttparse-29c5c0e15cbc6918.rlib" "git/firma/target/x86_64-linux-android/release/deps/libunicase-08e07f5cb4582959.rlib" "git/firma/target/x86_64-linux-android/release/deps/liburl-565cf405bbbc6f11.rlib" "git/firma/target/x86_64-linux-android/release/deps/libpercent_encoding-62a780b06067c42e.rlib" "git/firma/target/x86_64-linux-android/release/deps/libidna-664f8913a6bd9d11.rlib" "git/firma/target/x86_64-linux-android/release/deps/libunicode_normalization-b57b91b601cfe39b.rlib" "git/firma/target/x86_64-linux-android/release/deps/libsmallvec-8bbc306ba22e04fc.rlib" "git/firma/target/x86_64-linux-android/release/deps/libunicode_bidi-65080d3d05397976.rlib" "git/firma/target/x86_64-linux-android/release/deps/libmatches-12d24f0e52d3cfe3.rlib" "git/firma/target/x86_64-linux-android/release/deps/libtime-df2659c4210ec3da.rlib" "git/firma/target/x86_64-linux-android/release/deps/libbase64-6e0f85c4ae23d0b9.rlib" "git/firma/target/x86_64-linux-android/release/deps/libsafemem-4859e275c8775d7c.rlib" "git/firma/target/x86_64-linux-android/release/deps/libbyteorder-a567cac710b2ff12.rlib" "git/firma/target/x86_64-linux-android/release/deps/libserde_json-aea4fb0f6a600f91.rlib" "git/firma/target/x86_64-linux-android/release/deps/libryu-303e88de6094084b.rlib" "git/firma/target/x86_64-linux-android/release/deps/libitoa-33a0008036ad0013.rlib" "git/firma/target/x86_64-linux-android/release/deps/libstructopt-afb3c87b54ec5017.rlib" "git/firma/target/x86_64-linux-android/release/deps/liblazy_static-cfe376d848f8dca5.rlib" "git/firma/target/x86_64-linux-android/release/deps/libclap-8a4f058357ba0371.rlib" "git/firma/target/x86_64-linux-android/release/deps/libvec_map-320f1e876f4ab5e8.rlib" "git/firma/target/x86_64-linux-android/release/deps/libtextwrap-fb579443c981619d.rlib" "git/firma/target/x86_64-linux-android/release/deps/libunicode_width-d0abc7a4e055e8bd.rlib" "git/firma/target/x86_64-linux-android/release/deps/libstrsim-5fe4a786e1588d33.rlib" "git/firma/target/x86_64-linux-android/release/deps/libbitflags-c022687c9a416abf.rlib" "git/firma/target/x86_64-linux-android/release/deps/libatty-1248b623d0afe6f9.rlib" "git/firma/target/x86_64-linux-android/release/deps/liblibc-433e1495330a43b5.rlib" "git/firma/target/x86_64-linux-android/release/deps/libansi_term-0c1b94309baae795.rlib" "git/firma/target/x86_64-linux-android/release/deps/liblog-cf8af82bdaa40c27.rlib" "git/firma/target/x86_64-linux-android/release/deps/libcfg_if-1023a122f274a054.rlib" "git/firma/target/x86_64-linux-android/release/deps/libbitcoin-44a0a489d654bf87.rlib" "git/firma/target/x86_64-linux-android/release/deps/libhex-4ac2095e2a54b63a.rlib" "git/firma/target/x86_64-linux-android/release/deps/libbech32-26bfaa263b1e24b3.rlib" "git/firma/target/x86_64-linux-android/release/deps/libsecp256k1-13a954568a720a03.rlib" "git/firma/target/x86_64-linux-android/release/deps/libsecp256k1_sys-b25b50e6dad50e6f.rlib" "git/firma/target/x86_64-linux-android/release/deps/libbitcoin_hashes-43cb8f779b8a1264.rlib" "git/firma/target/x86_64-linux-android/release/deps/libserde-d78d93d778c2fca3.rlib" "-Wl,--start-group" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libstd-dc52920bd26c475a.rlib" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libpanic_unwind-fbcd44ea9de9e84d.rlib" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libhashbrown-272816f622506607.rlib" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/librustc_std_workspace_alloc-2e6d5dad063860e2.rlib" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libbacktrace-09346cb3edb25087.rlib" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libbacktrace_sys-6be22fb13da66c1e.rlib" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/librustc_demangle-d92cb76010923f7e.rlib" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libunwind-d42f53699194f2f0.rlib" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libcfg_if-ae95ddcce4dfb7e8.rlib" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/liblibc-6e56391bb7b37928.rlib" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/liballoc-2040256f85136fa7.rlib" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/librustc_std_workspace_core-00d9c20e6830f002.rlib" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libcore-c6bf74a0bdc13499.rlib" "-Wl,--end-group" ".rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-linux-android/lib/libcompiler_builtins-f0ccc9ecda5eae05.rlib" "-Wl,-Bdynamic" "-llog" "-ldl" "-llog" "-lgcc" "-lc" "-lm" "-shared"
  = note: ld: unknown option: --as-needed
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: aborting due to previous error

error: could not compile `firma`.

To learn more, run the command again with --verbose.
cp: ../target/x86_64-linux-android/release/libfirma.so: No such file or directory

android: create receive address

Create receive address allowing to double-check address generated from the watch-only instance with the offline device, add a note discouraging to send before double-checking with node

Consider not using change derivation

Consider using a single derivation for descriptor simplicity

I don't think the use case "show the xpub descriptor" to a third party is useful in firma, and that's probably the only advantage of using separate derivation (because the third party wouldn't know your changes)

consider GZIP psbt data before qr-encoding

To handle "segwit bug" previous tx must be included for inputs also for segwits outputs, compression could recover some space

there are some gain, in this example 24%

let bytes = include_bytes!("../../test_data/sign/psbt_bip.signed.json");
        let (psbt_ser, _) = extract_psbt(bytes);
        let mut e = GzEncoder::new(Vec::new(), Compression::best());
        e.write_all(&psbt_ser).unwrap();
        let compressed_bytes = e.finish().unwrap();
        assert_eq!(psbt_ser.len(), 1583);
        assert_eq!(compressed_bytes.len(), 1204);

should not impact compatibility in shell commands like:

echo $PSBT | base64 -D | qrencode -S -v 10 -8 -o test.png

just need gzip in the middle

echo $PSBT | base64 -D | gzip -c | qrencode -S -v 10 -8 -o test.png

Remove image dep

Image dep allows handling of several format of image types, we could go with just a monochrome bitmap encoder

Ship APK

Requires #8, when the lib is ready make a simple android app that could work as an offline psbt signer, it must be compatible with very low API such that people use old unused phone for this purpose

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.