Commit graph

36 commits

Author SHA1 Message Date
SomberNight
4c7a92f39c
bitcoin: implement construct_script and use it 2020-10-24 07:49:06 +02:00
SomberNight
89bd520185
bitcoin: move construct_witness from transaction.py to bitcoin.py 2020-10-24 05:18:16 +02:00
SomberNight
9eb152ed98
keystore: improve check_password.
and add tests that exercise it

maybe fixes #4128
2020-09-11 13:42:12 +02:00
SomberNight
fc39295d20
lnpeer: review safety check re channel open flow, and tweak params 2020-06-08 21:17:23 +02:00
SomberNight
66c264f613
bitcoin.py: change API of address_to_hash 2020-04-12 15:34:19 +02:00
TheCharlatan
a4fe14bb82
BitBox02 Electrum plugin support
This commit adds support for the BitBox02 hardware wallet.
It supports both single and multisig for the electrum gui wallet.

To use the plugin a local installation of the BitBox02 python library is
required. It can be found on PiPy under the name 'bitbox02' and can be
installed from the bitbox02-firmware repository in the py/bitbox02
directory.

All communication to and from the BitBox02 is noise encrypted, the keys
required for this are stored in the wallet config file under the
bitbox02 key.

The BitBox02 registers a multisig configuration before allowing
transaction signing. This multisig configuration includes the threshold,
cosigner xpubs, keypath, a variable to indicate for mainnet and testnet,
and a name that the user can choose during configuration registration.
The user is asked to register the multisig configuration either during
address verification or during transaction signing.

The check the xpub of the BitBox02 for other hardware wallets, a button
is added in the wallet info dialog.

The wallet encryption key is fetched in a separate api call, requiring a
slightly tweaked override version of the wallet encryption password.
2020-04-12 15:34:37 +02:00
SomberNight
900a7631cf
commands: add new cmd "getprivatekeyforpath" to export a WIF for a path
related: #6061
2020-03-31 05:50:18 +02:00
SomberNight
510399d3d2
wallet: dust limit calculation should round up (not down)
related to prev commit

closes #6035
2020-03-15 17:42:02 +01:00
SomberNight
a500db371d
wallet: put hard limit on minimum of relayfee: 1 sat/byte
(note that the dust limit is calculated based on the relayfee)

closes #6035
2020-03-15 01:26:26 +01:00
SomberNight
6f2cd8b4f5
Qt tx dialog: allow setting custom locktime
closes #2405
closes #1685
2020-03-01 09:14:50 +01:00
SomberNight
5f6f7da2a1
bitcoin.py: base58 address: make sure all public methods test checksum
Note: the checksum was already being checked in practically all cases, by the caller.
Moved the check here, to the lower level (but still public) method for sanity.
2019-12-08 06:56:19 +01:00
SomberNight
8cf3587aeb
base_encode/base_decode: change to saner API 2019-12-08 06:19:51 +01:00
SomberNight
01f94fcf58
base_encode/base_decode: performance improvement
For example, for 50 KB of random data, and base 43,
previously,
- base_encode took ~38 seconds
- base_decode took ~270 seconds
now,
- base_encode takes ~7.5 seconds
- base_decode takes ~6 seconds
2019-12-08 06:07:01 +01:00
SomberNight
83740c1a78
psbt: implement CompactSize key types (previously single-byte types)
based on latest BIP-0174 update: bitcoin/bips#849
2019-11-07 03:27:38 +01:00
SomberNight
bafe8a2fff
integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight
e9a1c05d23
bitcoin.relayfee: minor clean-up 2019-09-18 22:08:19 +02:00
SomberNight
b3da13420b bitcoin.py: SCRIPT-related clean-up. transaction.py: construct_witness 2019-08-20 09:03:09 +02:00
SomberNight
98f46dbaf5 implement script_num_to_hex. fix encoding of argument for CSV in make_commitment 2019-08-20 09:03:09 +02:00
SomberNight
8390da9b7b
bitcoin.py: dedupe pubkeyhash_to_p2pkh_script 2019-07-31 01:18:51 +02:00
SomberNight
7584cebbe3
bitcoin: stricter check on WIF for compressed pubkeys
fixes #5290
2019-04-25 14:35:16 +02:00
SomberNight
d4a2e9634f
bitcoin: disallow importing/sweeping segwit scripts with uncompressed pubkey
fixes #4638
2019-04-19 00:37:28 +02:00
SomberNight
a1d98d4331
sweep/import key: show error in Qt GUI to user as tooltip 2019-04-19 00:15:45 +02:00
SomberNight
b39c51adf7
mv "electrum seed" stuff from bitcoin.py to mnemonic.py 2019-02-22 18:01:54 +01:00
SomberNight
e7f38467d7
move opcodes to bitcoin.py 2019-02-22 17:39:58 +01:00
SomberNight
53310690a5
version notifications: sig check would always fail on testnet 2019-01-26 15:30:30 +01:00
ThomasV
5a93bf054e 2fa segwit (from ghost43's PR) 2018-12-11 09:28:35 +01:00
SomberNight
a53dded50f
bitcoin: avoid floating point in int_to_hex 2018-11-26 01:34:23 +01:00
SomberNight
36f64d1ad9
bitcoin/ecc: some more type annotations 2018-11-18 22:07:27 +01:00
SomberNight
e37da62a1c
fix most "scripts"
related: #4754
2018-11-02 20:14:59 +01:00
SomberNight
791e0e1a67
move relayfee and dust_threshold to bitcoin.py 2018-10-25 23:08:59 +02:00
SomberNight
082a83dd85
rename crypto.Hash to sha256d 2018-10-25 22:28:24 +02:00
SomberNight
a88a2dea82
split bip32 from bitcoin.py 2018-10-25 22:20:33 +02:00
SomberNight
1af225015a
fix some type annotations involving tuples 2018-10-13 05:16:36 +02:00
SomberNight
04c1b522d6
minor fixes for prev
use TxOutputHwInfo namedtuple

warn user if device is set to wrong chain

undo parts of prev re testnet. fix p2wpkh.

testnet support. and minor stuff
2018-08-22 21:52:28 +02:00
SomberNight
b4b1de088a
move TrezorClient.expand_path to bitcoin.py
and allow its input to end with a '/' slash
2018-08-14 18:19:16 +02:00
Janus
097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00
Renamed from lib/bitcoin.py (Browse further)