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

[Bitcoin]: Add support for Taproot address generation #4074

Merged
merged 6 commits into from
Oct 25, 2024

Conversation

satoshiotomakan
Copy link
Collaborator

Description

This PR adds support for P2TR key-path address generation through.
Please note that by default (TWDerivationDefault) is a Native Segwit (P2WPKH).
To generate P2TR address, specify TWDerivationBitcoinTaproot.

For example,

val wallet = HDWallet(words, password)

val address = wallet.getAddressDerivation(CoinType.BITCOIN, Derivation.BITCOINTAPROOT)
assertEquals(address, "bc1pgqks0cynn93ymve4x0jq3u7hne77908nlysp289hc44yc4cmy0hslyckrz")

How to test

Types of changes

  • Refactored codegen tool, so new derivations added to registry.json are now appended to the end of the TWDerivation enum on each ./tools/generate-files command. This is required to avoid changing the order of existing derivations.

Checklist

  • Create pull request as draft initially, unless its complete.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • If there is a related Issue, mention it in the description.

If you're adding a new blockchain

  • I have read the guidelines for adding a new blockchain.

Copy link

Binary size comparison

➡️ aarch64-apple-ios:

- 12.18 MB
+ 12.18 MB 	 +1 KB

➡️ aarch64-apple-ios-sim:

- 12.18 MB
+ 12.18 MB 	 +1 KB

➡️ aarch64-linux-android:

- 15.62 MB
+ 15.63 MB 	 +2 KB

➡️ armv7-linux-androideabi:

- 13.33 MB
+ 13.33 MB 	 +1 KB

➡️ wasm32-unknown-emscripten:

- 11.08 MB
+ 11.09 MB 	 +1 KB

@satoshiotomakan satoshiotomakan merged commit 1640748 into master Oct 25, 2024
13 checks passed
@satoshiotomakan satoshiotomakan deleted the s/bitcoin-taproot-address branch October 25, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants