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

[Draft] Add support for P2WPKh (Segwit) and P2TR key-path (Taproot) #3213

Closed
wants to merge 207 commits into from

Conversation

lamafab
Copy link
Contributor

@lamafab lamafab commented Jun 9, 2023

Related to #3178

Although testing and debugging for BRC20 are still in progress, we plan to add support for P2WPKH and P2TR key-path earlier. Personally, I'm not a fan of merging this prematurely. However, here's the current checklist:

  • Implement traditional P2PKH send and receive functionality
    • Tested in regtest and mainnet environments
  • Implement P2WPKH (Segwit) send and receive functionality
    • Tested in regtest and mainnet environment
  • Implement P2TR (key-path) send and receive functionality
    • Tested in regtest and mainnet environment
  • (not directly relevant for this PR) Implement the Ordinals protocol and BRC20 scripts
    • Partially tested in mainnet environment, but it's not functioning as expected. I'm currently debugging this. I initially wanted to test this in a testnet environment, but https://testnet.ordinals.com appears to be offline, and I couldn't obtain a clear answer from anyone on their Discord
  • Develop FFI bindings over relevant transaction Input/Output builders and transaction signing
    • Tested via FFI
    • Wrap C++ structures over the FFI calls into Rust

The existing wallet-core library offers a lot of Bitcoin-related functionality such as fee estimation and message signing. We're retaining all of these for existing features in the iOS and Android apps (including traditional P2PKH Bitcoin transactions). Therefore, we're creating a separate C++ structure explicitly for Segwit/Taproot with similar APIs.

As for the code itself, several TODO's and unhandled .unwrap()'s remain in the non-FFI exposed code (i.e., in the Ordinals/BRC20 sections). Rust API itself is likely to change. Btw, based on what I saw in the iOS codebase, it seems we only support P2PKH and (sending to) P2WPKH transactions, while others like P2PK and P2SH are not supported. Since we have Taproot now I think there's no longer a need to consider those, anyway.

lamafab added 30 commits June 8, 2023 22:40
@lamafab lamafab mentioned this pull request Jun 16, 2023
24 tasks
@lamafab
Copy link
Contributor Author

lamafab commented Jun 16, 2023

Closing in favor of #3233

@lamafab lamafab closed this Jun 16, 2023
@lamafab
Copy link
Contributor Author

lamafab commented Jun 19, 2023

@RomanDariicuk Can you please stop it with those cryptic replies? Clarify what you want or are trying to say.

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.

2 participants