BIP 350: Implement Bech32m and use it for v1+ segwit addresses (0.20 backport) #21470

pull sipa wants to merge 5 commits into bitcoin:0.20 from sipa:202103_bech32m_0.20 changing 15 files +566 −484
  1. sipa commented at 9:26 PM on March 18, 2021: member

    Backport of #20861 for 0.20. Also includes #21471.

  2. Implement Bech32m encoding/decoding
    Github-Pull: #20861
    Rebased-From: da2bb6976dadeec682d163c258c9afecc87d6428
    5f9537b2d9
  3. Add Bech32m test vectors
    Github-Pull: #20861
    Rebased-From: 25b1c6e13ddf1626210d5e3d37298d1f3a78a94f
    cf18ac9665
  4. fanquake added the label Backport on Mar 18, 2021
  5. sipa renamed this:
    Implement Bech32m encoding/decoding (0.20 backport)
    BIP 350: Implement Bech32m and use it for v1+ segwit addresses (0.20 backport)
    on Mar 18, 2021
  6. in doc/bips.md:45 in 3ce09ce4c8 outdated
      41 | @@ -42,3 +42,4 @@ BIPs that are implemented by Bitcoin Core (up-to-date up to **v0.19.0**):
      42 |  * [`BIP 173`](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki): Bech32 addresses for native Segregated Witness outputs are supported as of **v0.16.0** ([PR 11167](https://github.com/bitcoin/bitcoin/pull/11167)). Bech32 addresses are generated by default as of **v0.20.0** ([PR 16884](https://github.com/bitcoin/bitcoin/pull/16884)).
      43 |  * [`BIP 174`](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki): RPCs to operate on Partially Signed Bitcoin Transactions (PSBT) are present as of **v0.17.0** ([PR 13557](https://github.com/bitcoin/bitcoin/pull/13557)).
      44 |  * [`BIP 176`](https://github.com/bitcoin/bips/blob/master/bip-0176.mediawiki): Bits Denomination [QT only] is supported as of **v0.16.0** ([PR 12035](https://github.com/bitcoin/bitcoin/pull/12035)).
      45 | +* [`BIP 350`](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki): Addresses for native v1+ segregated Witness outputs use Bech32m instead of Bech32 as of **v22.0** ([PR 20861](https://github.com/bitcoin/bitcoin/pull/20861)).
    


    jnewbery commented at 11:08 AM on March 23, 2021:
    * [`BIP 350`](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki): Addresses for native v1+ segregated Witness outputs use Bech32m instead of Bech32 as of **v0.20.2** ([PR 20861](https://github.com/bitcoin/bitcoin/pull/20861)).
    

    Also update top of document to:

    BIPs that are implemented by Bitcoin Core (up-to-date up to **v0.20.2**):


    benthecarman commented at 6:50 AM on March 24, 2021:

    This is backported to v0.19.X actually

    #21472


    jnewbery commented at 7:49 PM on March 25, 2021:

    Perhaps, although I think this should document the earliest release that included the BIP in this branch. It doesn't really make sense to say which of 0.19.n or 0.20.m is earlier, since they're parallel release tracks. In #21469, the first release is 0.21.1, and in #20861, the first release is 22.0.

    I also don't think that a 0.19 backport is necessary, but others may disagree.


    sipa commented at 7:08 PM on March 27, 2021:

    Listed v0.20.2.

  7. jnewbery commented at 11:11 AM on March 23, 2021: member

    One documentation comment. Otherwise, this is exactly the same as I got when I cherry-picked these commits to the 0.20 branch.

  8. sipa commented at 7:50 PM on March 25, 2021: member

    Anyone have a clue why appveyor fails here?

    Also, don't we need cirrus CI changes backported to 0.20 first?

  9. MarcoFalke commented at 7:37 AM on March 26, 2021: member

    The msvc is now using a dependency file (https://github.com/bitcoin/bitcoin/blob/0.21/build_msvc/vcpkg.json), which might need to be backported to fix the appveyor ci.

    Looks like travis isn't fully shut down yet and still runs on the branch. This is fine, because the ci system uses bash scripts that don't care which infrastructure they run on.

  10. Use Bech32m encoding for v1+ segwit addresses
    This also includes updates to the Python test framework implementation,
    test vectors, and release notes.
    
    Github-Pull: #20861
    Rebased-From: fe5e495c31de47b0ec732b943db11fe345d874af
    1a4e88e0e8
  11. naming nits
    Github-Pull: #20861
    Rebased-From: 03346022d611871f2cc185440b19d928b9264d9d
    c6709867d3
  12. Backport invalid address tests
    Reduced version of the test from master/#20861 by John Newbery.
    
    Github-Pull: #20861
    Rebased-From: fe5e495c31de47b0ec732b943db11fe345d874af
    c0f85fd850
  13. sipa force-pushed on Mar 27, 2021
  14. jnewbery commented at 12:50 PM on March 28, 2021: member

    utACK c0f85fd8503a6e6f66cb8659bd88deec92b96eec

    Verified the range-diff. Only difference is updating bips.md and adding the rpc_invalid_address_message.py test.

  15. MarcoFalke commented at 10:59 AM on April 1, 2021: member

    range-diff-only ACK c0f85fd850 🐔

    Compared against the version merged into the 0.21 branch with git range-diff. Only changes:

    • Account for naming difference in tests: decode_segwit_address vs decode
    • Version number in doc/bips.md
    • Remove signet mention from release notes snippet
    • Other minor merge conflicts in tests
    • Drop signet commit 7dfe406e20

    <details><summary>Show signature and timestamp</summary>

    Signature:

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    range-diff-only ACK c0f85fd850 🐔
    
    Compared against the version merged into the 0.21 branch with git range-diff. Only changes:
    
    * Account for naming difference in tests: decode_segwit_address vs decode
    * Version number in doc/bips.md
    * Remove signet mention from release notes snippet
    * Other minor merge conflicts in tests
    * Drop signet commit 7dfe406e20
    
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
    pUhYfwv+LPVF9v+957bB2YPLecWl1tfq4Q/rvj4+r8neaXzEdyyMmS3norOIxhKE
    f7WhOInn87DnDroCNfJjss/Jz6fMkKKEjeJ0N8lYwva28TqGhhQnWQyharME9SEw
    2/+KXAhg7Y8CUwfx1V0yd+wZhZhy9c4+rcc4yeIte/CyPpZuX2ch+bOuxd8zaA9a
    vKv8NNCeb17NgMLaDCrOkt3kVrVzmTR/4z82eLlHoo6BKMVqZNs1Kof51vpe3WqI
    7GNZzOZ2vwEPYHdrjCMHu4/GX/LZ50luAhZWr9dQSokb2q73yM2F8z7AcUkgP4sp
    nZhUKJTI+VQXmTcVajaf/7+uhlm0KnSJM9kn3q/pgQlzwtPNiR+XBvfjnUpht9db
    d/VfTegviM8tpEpfxyMys0mY6GS9aFxdNCez0XWeX2bIsbzMB8oEyTb+LF+oAwbk
    rLPmYU10BrVbpMxPHja7rbhVGejL5ShwLJe+olRXMsr/mxhO4XeVF+RiiUXAzbXO
    vZgTSNND
    =mCLL
    -----END PGP SIGNATURE-----
    

    Timestamp of file with hash a9384816e3019705b939aef50969fdb1f644619973c3523f30929fc5022c81ee -

    </details>

  16. fanquake added this to the milestone 0.20.2 on Apr 16, 2021
  17. laanwj merged this on Apr 23, 2021
  18. laanwj closed this on Apr 23, 2021

  19. tcharding referenced this in commit cf5d3734fa on Jul 22, 2022
  20. bitcoin locked this on Aug 18, 2022
  21. bitcoin unlocked this on Aug 20, 2022
  22. bitcoin locked this on Aug 20, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 09:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me