Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trezor cannot send to bech32 addresses #2976

Closed
lzsaver opened this issue Oct 4, 2017 · 13 comments
Closed

Trezor cannot send to bech32 addresses #2976

lzsaver opened this issue Oct 4, 2017 · 13 comments

Comments

@lzsaver
Copy link
Contributor

lzsaver commented Oct 4, 2017

File -> New/Restore -> Standard wallet -> Create a new seed -> Segwit

I'm getting bc1-addresses, is it okay? I thought I should get 3-addresses.

@SomberNight
Copy link
Member

Yes, that is expected. Electrum "segwit" seeds have native segwit outputs with BIP173 ("bech32") addresses.

electrum/RELEASE-NOTES

Lines 12 to 24 in 91ed74a

- Native segwit scripts are supported with Electrum software
wallets, using a new type of seed. Segwit seeds have version
0x100. Note that the wizard will not create Segwit seeds by
default; users must opt-in with the segwit option.
- Native segwit scripts are represented using bech32 addresses,
following BIP173. Please note that BIP173 is still in draft
status, and that other wallets/websites may not support
it. Thus, you should keep a non-segwit wallet in order to be
able to receive bitcoins during the transition period. If BIP173
ends up being rejected or substantially modified, bech32 wallets
may have to be restored from seed. This will not affect funds
sent to bech32 addresses, and it will not affect the capacity of
Electrum to spend these funds.

@lzsaver
Copy link
Contributor Author

lzsaver commented Oct 4, 2017

Oh, I did not read BIP173. It seems that it has not been accepted yet. Thanks.

@lzsaver
Copy link
Contributor Author

lzsaver commented Oct 4, 2017

Traceback (most recent call last):
  File "/home/user/electrum-good/lib/python3.5/site-packages/electrum_gui/qt/util.py", line 589, in run
    result = task.task()
  File "/home/user/electrum-good/lib/python3.5/site-packages/electrum/wallet.py", line 1138, in sign_transaction
    k.sign_transaction(tx, password)
  File "/home/user/electrum-good/lib/python3.5/site-packages/electrum_plugins/trezor/plugin.py", line 70, in sign_transaction
    self.plugin.sign_transaction(self, tx, prev_tx, xpub_path)
  File "/home/user/electrum-good/lib/python3.5/site-packages/electrum_plugins/trezor/plugin.py", line 248, in sign_transaction
    outputs = self.tx_outputs(keystore.get_derivation(), tx, keystore.is_segwit())
  File "/home/user/electrum-good/lib/python3.5/site-packages/electrum_plugins/trezor/plugin.py", line 368, in tx_outputs
    addrtype, hash_160 = b58_address_to_hash160(address)
  File "/home/user/electrum-good/lib/python3.5/site-packages/electrum/bitcoin.py", line 315, in b58_address_to_hash160
    return _bytes[0], _bytes[1:21]
TypeError: 'NoneType' object is not subscriptable

I can't send coins to the bc1-address. Tested on 088b1e6 and 91ed74a + your patch.
It seems to be trezor-specific (not implemented in Trezor?).

By the way, is it good idea to use BIP173 by default while it is just a draft?

@SomberNight
Copy link
Member

It's likely not implemented in Trezor (or at least the Trezor plugin). I think this warrants a separate issue.

@lzsaver
Copy link
Contributor Author

lzsaver commented Oct 4, 2017

I'll check it with your b1167e9 patch.

@lzsaver
Copy link
Contributor Author

lzsaver commented Oct 4, 2017

It does not work with the b1167e9 patch, and it does not work on dd006b5. It seems to be trezor-related.

@lzsaver lzsaver changed the title [91ed74a] bc1-addresses? [dd006b5] [trezor] Electrum can't send to bc1-addresses Oct 4, 2017
@lzsaver lzsaver changed the title [dd006b5] [trezor] Electrum can't send to bc1-addresses [3006932] [trezor] Electrum can't send to bc1-addresses Oct 5, 2017
@lzsaver
Copy link
Contributor Author

lzsaver commented Oct 5, 2017

By the way, is it good idea to use BIP173 by default while it is just a draft?

It seems they are going to accept it, bech32 support was added to Bitcoin Core.

@ecdsa
Copy link
Member

ecdsa commented Oct 11, 2017

I added this blind fix: 0df24d9
it still fails for me, but it might work on recent firmware

@lzsaver lzsaver changed the title [3006932] [trezor] Electrum can't send to bc1-addresses [5a45f25] [trezor] [bech32] Electrum can't send to bc1-addresses Oct 20, 2017
@ecdsa ecdsa changed the title [5a45f25] [trezor] [bech32] Electrum can't send to bc1-addresses Trezor cannot send to bech32 addresses Oct 23, 2017
@ecdsa
Copy link
Member

ecdsa commented Oct 23, 2017

still failing after firmware update

@ecdsa
Copy link
Member

ecdsa commented Oct 23, 2017

trezor/trezor-common#15 (comment)

@jhoenicke
Copy link
Contributor

FYI, I finished my implementation of bech32 in TREZOR firmware trezor/trezor-mcu#236.
Electrum doesn't need any changes to send to bech32 addresses with the TREZOR with the new firmware: https://www.blocktrail.com/tBTC/tx/f7236e1da665db69bfb931ed2d0e7cd3c46f2d36fc6cc5c7199ca317c04c45d1

It would need some changes to use a wallet with bech32 addresses with Trezor, but I think we don't want to go that way soon.

Now I need a blockexplorer that shows the address.

@lzsaver
Copy link
Contributor Author

lzsaver commented Nov 2, 2017

Now I need a blockexplorer that shows the address.

Blockchain.info shows bc-addresses if you click 'Show scripts & coinbase'.

@lzsaver
Copy link
Contributor Author

lzsaver commented Dec 10, 2017

Thank you. It works (tested on Trezor 1.6).

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants