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

Bech32m support! #4591

Merged
merged 6 commits into from
Jun 11, 2021
Merged

Conversation

rustyrussell
Copy link
Contributor

We didn't allow non-v0 segwit addresses previously, because v1 addresses wouldn't propagate. Fortunately, because it turned out bech32 fell short with non-v0 addresses anyway. That's now fixed, with bech32m, which we now parse.

So we now accept v1+, so you can close channels to[1], withdraw to, v1+ addresses. We are now Taproot Ready! (TM).

[1] Only if they set option_shutdown_anysegwit, since only v0 addresses allowed in original spec. We've set this last release as EXPERIMENTAL_CONFIG, and this release it's always on.

I did this by copying the updated bech32 code, and then re-patching in
our minor changes:

1. Headers modded (we need size_t)
2. Explicit length for bech32_encode/decode (not 90).
3. Exposing and bech32_ prefix for convert_bits, charset, charset_rev.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell added wallet Optech Make Me Famous! Look! Look! Look! COOL NEW FEATURE! labels Jun 9, 2021
The test vectors in BIP-320 are for different networks.  Write a quick
tool to turn them into regtest ones.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Only v0 has specific length restrictions: taproot is v1 32 bytes long,
but explicitly other lengths remain undefined.

I noticed that I added option_shutdown_anysegwit as EXPERIMENTAL in
the last release, but didn't CHANGELOG it.  Then I changed it to
non-experimental as a spec update, but didn't CHANGELOG it then
either, so let's do that now!

    Changelog-Added: Protocol: We now send and accept `option_shutdown_anysegwit` so you can close channels to v1+ segwit addresses.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `withdraw`, `close` (and others) now accept taproot (and other future) segwit addresses.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Prior to this, sending a v1 address (or, in fact, any random crap!)
would cause the unsupporting node to unilaterally close.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
In particular, this includes the test plugins!

Not sure why this breaks *now* though.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack 81455f1

One step to Taproot :-D

@rustyrussell rustyrussell merged commit 3aafe8c into ElementsProject:master Jun 11, 2021
murchandamus added a commit to murchandamus/bitcoinops.github.io that referenced this pull request Jun 14, 2021
bitschmidty pushed a commit to harding/bitcoinops.github.io that referenced this pull request Jun 16, 2021
bitschmidty pushed a commit to harding/bitcoinops.github.io that referenced this pull request Jun 16, 2021
bitschmidty pushed a commit to bitcoinops/bitcoinops.github.io that referenced this pull request Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Optech Make Me Famous! Look! Look! Look! COOL NEW FEATURE! wallet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants