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

feat: Add Taproot Transaction Support with Schnorr Signatures #1285

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ygcl9698
Copy link

Overview

This PR implements Taproot transaction support using Schnorr signatures. It provides functionality for creating Taproot addresses and signing transactions on Bitcoin testnet.

Key Changes

  • Implement SchnorrSigner class for handling Taproot key operations
  • Add P2TR address creation functionality
  • Add support for Taproot transaction signing with Schnorr signatures
  • Include comprehensive debug logging for transaction verification
  • Support Bitcoin testnet for testing purposes

Technical Details

  • Uses bitcoinjs-lib v6.1.5 for Taproot support
  • Implements x-only public key handling
  • Adds proper Schnorr signature support for Taproot inputs
  • Includes transaction debugging and verification tools

Dependencies

  • bitcoinjs-lib@6.1.5
  • ecpair
  • @bitcoinerlab/secp256k1

Testing

Tested on Bitcoin testnet with the following scenarios:

  • Taproot address creation
  • Transaction signing
  • Witness script verification

Note: Requires Node.js 20+ for proper functionality.

@LegendarySSS
Copy link

I was learning how to add Taproot trading support and happened to see this pr, which was very enlightening to me, thank you.

@ygcl9698
Copy link
Author

I was learning how to add Taproot trading support and happened to see this pr, which was very enlightening to me, thank you.

I'm glad I could help you😁

@jasonandjay
Copy link
Collaborator

thanks for your contribution. add wechat DappLearning to join our developer group

Copy link
Member

@0x-stan 0x-stan left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Please add more content, such as a README that includes a detailed explanation of the process and underlying principles.

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.

4 participants