Last week Electrum 3.0 was released. The new version of the most popular Bitcoin wallet does not just support SegWit, but also uses the new address format Bech32.
Electrum 3.0 could be one of the most interesting upgrades of the popular wallet. It does not just migrate from Python3 to Qt5, but also supports SegWit as the first wallet with the native SegWit address format Bech32.
If you just want to start, we suggest to download the new version of Electrum here, or take a look at the release notes there. If you want to learn what the upgrade does, you should become aware about the challenges SegWit poses for wallet developers, and what the new address format bech32 means.
Migrating User’s Inputs to New Address Format
As you might know, SegWit is an upgrade of Bitcoin’s transaction format. Basically, it organizes data more efficiently by segregating the signature from the content of the transaction. This allows SegWit transactions to circumvent the 1mb limit for the blocksize.
However, to work as the announced capacity increases, the new format has to be used. To do so, users need to transfer their coins to a new SegWit address, from which they can write SegWit transactions.
The challenge for wallet developers is to implement SegWit in a way that users can easily and without too much disruption migrate their inputs to SegWit addresses. Until now all wallets which enable SegWit addresses – Ledger, Trezor, Core, GreenAddress – use so called “nested P2SH addresses.”
This means they take the existing Pay 2 Script Hash address – starting with a “3” – and put a SegWit address into it. This enables a high grade of compatibility to existing wallets, as every wallet is familiar with these addresses, but it is some kind of hack, which results in SegWit transactions needing around 10 percent more space. Obviously, this contradicts the goal of increasing capacity.
With Electrum 3.0 not only does a major wallet join club SegWit – it is the first to not use the nested p2sh addresses.
An Unknown Type of Address
If you want to use SegWit with the new version of Electrum, you must first create a new wallet. Since Electrum uses a seed to generate private keys and addresses, implementing a new address format in an existing wallet would cause problems. So you need to create a new wallet, and agree to the option to generate a SegWit wallet.
When you click on the “receive” tab, you will find a surprise: Instead of the typical address, beginning with a 1 or a 3 and consisting of 30 to 34 lower and capital cases – the so called Base58 addresses -, you’ll stumble upon something like this: “bc1q76awjp3nmklgnf0yyu0qncsekktf4e3qj248t4”.
The addresses of Electrum’s SegWit wallet are in the so called bech32 Format, which was adapted for SegWit by BIP173. Bech32 addresses consist of around 42 signs and start with bc1.
Other than the nested P2SH addresses, Bech32 addresses are natively SegWit compatible. This means the transaction does not need extra space to put SegWit in the P2SH address.
Additionally, Bech32 addresses have several advantages over the old Base58 addresses: the QR code is smaller, the protection against typing error is stronger, it enables auto completion, and due to only consisting of lower cases it should be easier to type and to be understood when read aloud.
However, there’s a problem. Outside of Electrum, there is no wallet which uses this format. Samourai wallet plans to enable it too, but currently it is not possible to receive coins in the SegWit wallet from other wallets. The only possible way to do is to use the non SegWit wallet of Electrum 3.0 to transfer funds on the SegWit wallet of Electrum 3.0.
Further most blockexplorers are confused by the new format. The explorer Electrum recommends, Blocktrail, doesn’t know the format at all and confuses the receiver with an unknown OP_Return output. Blockchain.info knows about it, for when you activate “show script and coinbase” it is able to decode the address. It does not, however, show it as an entry in the database with balances.
As a result of these circumstances, it is likely that the migration from standard coins to SegWit coins in Electrum will need some time, and that for a long time – if not forever – both addresses will coexist in parallel. But when it is done, and your funds have migrated to SegWit with Electrum, it will be done properly.