trezor / python-trezor

:snake: Don't use this repo, use the new monorepo instead:
https://github.com/trezor/trezor-firmware
GNU Lesser General Public License v3.0
201 stars 194 forks source link

Added a few more sample scripts #362

Closed brianddk closed 5 years ago

brianddk commented 5 years ago

encrypt_value.py

Use trezor to encrypt an arbitrary value from stdin and armor the encrypted value to stdout. Padding and length checks are automatically handled. Key and Address are generated or taken from command line

offline_txn.py

A very simple offline transaction assuming blockbook TXN json is provided by the user. A good way sign a known transaction on an air-gapped system

simple_txn.py

A very simple online transaction.

wallet_search.py

A script to walk trezor coins and addresses looking for activity. This only works on coins with blockbook servers.

matejcik commented 5 years ago

encrypt_value.py - I don't think this is too useful, given that you can encrypt files in a more-or-less standardized manner with GPG

wallet_search.py - This is not the right repo for that kind of script. For one, people would use it and then we'd be forced to fix bugs in it :) Also it's going to be partially superseded by the upcoming microwallet tool. Besides, it's not a great example script. You regenerate a client connection for every coin, load JSON data manually (that might not be present on the system that runs it), etc. I'd recommend keeping it in your own repo or in a gist.


That leaves simple_txn.py and offline_txn.py, which are neat example scripts. I've left review comments on offline_txn. I'd actually recommend merging them into one script, because the tx_api interface will be removed soon and so simple_txn will stop working.

matejcik commented 5 years ago

closing for now. whenever you want to continue on this, please open a PR against https://github.com/trezor/trezor-firmware