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

Try to parse P2TR more properly #19

Open
bernardladenthin opened this issue Nov 15, 2022 · 0 comments
Open

Try to parse P2TR more properly #19

bernardladenthin opened this issue Nov 15, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@bernardladenthin
Copy link
Owner

In a newer release P2TR might be supported.
https://bitcoinj.org/release-notes
Implement Taproot BIP341 – send to P2TR addresses. Receiving to and spending from P2TR addresses and chains will be implemented in a future release.

In AddressTxtLine the code SegwitAddress.fromBech32(keyUtility.networkParameters, address); is not correct for P2TR addresses and throws an

org.bitcoinj.core.AddressFormatException$InvalidChecksum: Checksum does not validate
	at org.bitcoinj.core.Bech32.decode(Bech32.java:156)
	at org.bitcoinj.core.SegwitAddress.fromBech32(SegwitAddress.java:167)

A workaround is used to catch the exception.

The goal is to prevent this exception.
See StaticUnsupportedAddress and BitcoinP2TR for the test.

@bernardladenthin bernardladenthin added the enhancement New feature or request label Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant