4

In Bitcoin core, when generating a new address for receiving a payment, you get this dialogue:

Receive Address

There is a tick-box for "Generate Bech32 address".

I understand that this is a relatively new feature not yet supported by all wallets. The tooltip help claims that

Bech32 addresses ... are cheaper to spend from and offer better protection against typos"

  • How much cheaper than the "P2SH wrapped SegWit address"? (and why?)
  • Don't P2SH wrapped SegWit addresses include check-digits at the end?

I did find a 52-minute Youtube video where someone with a familiar name was giving a presentation on Bech32 but I'm hoping that it can be explained simply and concisely for the non-technical end-user wondering whether to click that check-box or not.

3

1)

Native P2WPKH Unspent outputs save 22 bytes as their ScriptSigs are empty instead of 0x0014{20-byte-key-hash}. So, the amount of saving is insignificant.

2)

Yes, there's already a checksum of the same length.

The newer checksum algorithm is

Also, you might be interested in the list of Bech32 Advantages.

  • 1
    "So, the amount of saving is insignificant." the result is around 25% less weight per input. Since when is a one quarter reduction insignificant? – G. Maxwell Sep 6 '18 at 3:13
  • In addition to the scriptSig being removed, the public key and signature are moved into the witness data. The latter two are significant savings. – Dustin Oct 1 '18 at 23:05
  • Edit: Comparing two witness transactions that both keep public key and signature separate this is ostensibly correct. BIP 141 has this to say: "Comparing with the previous example, the scriptPubKey is 11 bytes smaller (with reduced security) while witness is the same. However, it also requires 35 bytes in scriptSig." – Dustin Oct 1 '18 at 23:11
1

Transaction fee is based on the number of bytes in your transaction. Segwit allows to move a significant part of the transaction to a new structure called witness. Bytes in the witness get a 75% discount (4 witness bytes count as 1).

How much you save depends on your transaction. If it involves a lot of signatures that can be moved to the witness you save more. For example with 1sat/byte fee and a 200 byte transaction out of which 120 bytes are signatures, you would pay 200 satoshis using legacy addresses but you would pay 80 + (120/4) = 110 satoshi with segwit.

How much cheaper than the "P2SH wrapped SegWit address"? (and why?)

If you check the box you will get a P2WPKH address else you will get a P2SH-P2WPKH address. Both get the discount. If you want a legacy address you have to specify it via an RPC command or change a value in your config file.

Don't P2SH wrapped SegWit addresses include check-digits at the end?

All legacy addresses include a 4-byte checksum which is good for detecting if there is an error or not.

Bech32 uses error-correcting codes which are far superior. Instead of a binary output (correct/incorrect) they can find multiple errors, pinpoint the exact wrong character and even correct them automatically (up to a number of errors depending on the code length)

  • About the fee part: the question is about the size difference between P2SH-WP2PKH and native P2WPKH. – MCCCS Sep 5 '18 at 14:39
  • "and even correct them automatically", no-- they don't correct them. If they did it would destroy the protection against sending funds to wrong places. – G. Maxwell Sep 6 '18 at 3:13
  • The BIP even explicitly says not to perform the error correction. If your address is wrong, and you know it, you should go back to the receiver and ask for the correct address instead of trying to guess. It is allowed to suggest where the errors may be, though. – Pieter Wuille Sep 6 '18 at 10:08
  • @G.Maxwell I didn't mean to suggest that you should do it, just that it is a capability of error-correcting codes in general. – Mike D Sep 6 '18 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.