Browse Source

minikeys: import with uncompressed pubkey instead of compressed (#4384)

3.2.x
ghost43 7 years ago
committed by GitHub
parent
commit
cc05c09d6b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      lib/bitcoin.py
  2. 10
      lib/tests/test_bitcoin.py

2
lib/bitcoin.py

@ -421,7 +421,7 @@ def serialize_privkey(secret: bytes, compressed: bool, txin_type: str,
def deserialize_privkey(key: str) -> (str, bytes, bool): def deserialize_privkey(key: str) -> (str, bytes, bool):
if is_minikey(key): if is_minikey(key):
return 'p2pkh', minikey_to_private_key(key), True return 'p2pkh', minikey_to_private_key(key), False
txin_type = None txin_type = None
if ':' in key: if ':' in key:

10
lib/tests/test_bitcoin.py

@ -574,14 +574,14 @@ class Test_keyImport(SequentialTestCase):
'scripthash': '242f02adde84ebb2a7dd778b2f3a81b3826f111da4d8960d826d7a4b816cb261'}, 'scripthash': '242f02adde84ebb2a7dd778b2f3a81b3826f111da4d8960d826d7a4b816cb261'},
# from http://bitscan.com/articles/security/spotlight-on-mini-private-keys # from http://bitscan.com/articles/security/spotlight-on-mini-private-keys
{'priv': 'SzavMBLoXU6kDrqtUVmffv', {'priv': 'SzavMBLoXU6kDrqtUVmffv',
'exported_privkey': 'p2pkh:L53fCHmQhbNp1B4JipfBtfeHZH7cAibzG9oK19XfiFzxHgAkz6JK', 'exported_privkey': 'p2pkh:5Kb8kLf9zgWQnogidDA76MzPL6TsZZY36hWXMssSzNydYXYB9KF',
'pub': '02588d202afcc1ee4ab5254c7847ec25b9a135bbda0f2bc69ee1a714749fd77dc9', 'pub': '04588d202afcc1ee4ab5254c7847ec25b9a135bbda0f2bc69ee1a714749fd77dc9f88ff2a00d7e752d44cbe16e1ebcf0890b76ec7c78886109dee76ccfc8445424',
'address': '19GuvDvMMUZ8vq84wT79fvnvhMd5MnfTkR', 'address': '1CC3X2gu58d6wXUWMffpuzN9JAfTUWu4Kj',
'minikey': True, 'minikey': True,
'txin_type': 'p2pkh', 'txin_type': 'p2pkh',
'compressed': True, # this is actually ambiguous... issue #2748 'compressed': False, # this is actually ambiguous... issue #2748
'addr_encoding': 'base58', 'addr_encoding': 'base58',
'scripthash': '60ad5a8b922f758cd7884403e90ee7e6f093f8d21a0ff24c9a865e695ccefdf1'}, 'scripthash': '5b07ddfde826f5125ee823900749103cea37808038ecead5505a766a07c34445'},
) )
@needs_test_with_all_ecc_implementations @needs_test_with_all_ecc_implementations

Loading…
Cancel
Save